Bug 117751 - ccm commands names switched from dash to underscore
Summary: ccm commands names switched from dash to underscore
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Web Application Framework
Classification: Retired
Component: dev environment
Version: nightly
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Dennis Gregorovic
QA Contact: Jon Orris
URL:
Whiteboard:
Depends On:
Blocks: 113496
TreeView+ depends on / blocked
 
Reported: 2004-03-08 04:53 UTC by Jon Orris
Modified: 2007-04-18 17:04 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-03-08 23:27:12 UTC
Embargoed:


Attachments (Terms of Use)

Description Jon Orris 2004-03-08 04:53:11 UTC
Description of problem:
@41000
The devel ccm commands all appear to have switched from dashes to
underscores, ex: ccm_start_resin instead of ccm-start-resin.

This may be an intentional change, and not a bug, but it will break
any scripts, such as autotest & rpmtest, which rely on the names of
these scripts. In addition, many people likely have - embedded in
muscle memory, so to speak.

Comment 1 Dennis Gregorovic 2004-03-08 06:54:46 UTC
This was half-intentional: in traditional bourne shell and bash
running in posix mode, dashes are not allowed in function names. 
However, assuming that you are running bash and it's not in posix
mode, the names with dashes should be set as well.  i.e.  

ccm-start() {
  ccm_start $@
}

Please attach the output of running 'set' before and after ccm-profile.

Comment 2 Daniel Berrangé 2004-03-08 10:21:26 UTC
Having two forms for every function, one of which is only sometimes
available, is really not very nice for either documentation purposes
or learning the system. I assume this was required for the solaris
port, of the tools ? Would it be possible to figure out another way to
ensure that the hyphenated versions are always available ? Possibly we
could define shell aliases with hyphens which in turn call the
underscore'd function's? Or another approach is to get rid of the
functions / aliases altogether & instead create each as a real shell
script in a special bin directory. Thus, the ccm-profile script could
setup the CCM_HOME & other required vars & then add
$CCM_DEVEL_HOME/bin to the $PATH to pull in the functions.

Comment 3 Dennis Gregorovic 2004-03-08 15:39:44 UTC
Yes, this change was done as part of the Solaris port.  I just checked
and we can use dashed in alias names with bash+posix, but not with
traditional bourne shell.  (aliases don't work at all with the
traditional bourne shell).  Also, there were other problems with
aliases, such as subshells not inheriting them.  So, I would vote
against aliases.

The idea of each function as an actual shell script is intriguing
though.  I'll look into this more after the RC1 blockers are done.

Comment 4 Dennis Gregorovic 2004-03-08 16:26:35 UTC
One more piece of information: the 'BASH' environment is not exported
by default, so project.pl in ccm-devel isn't picking it up and
therefore not setting the functions with dashes in the names.  I'm
bumping this up on my priority queue.

Comment 5 Jon Orris 2004-03-08 16:28:47 UTC
Set before & after:
Before:
[jorris@goodeats jorris]$ set
BASH=/bin/bash
BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release"
[5]="i386-redhat-linux-gnu")
BASH_VERSION='2.05b.0(1)-release'
CCM_CONFIG_HOME=/usr/share/ccm-devel
CCM_CONFIG_LIB_DIR=/usr/share/java
CCM_DEVEL_CONF_DIR=/etc/ccm-devel
CCM_DEVEL_ROOT=/var/ccm-devel
CCM_DIST_HOME=/usr/share/ccm-devel
CCM_HOME=/usr/share/ccm
CCM_RPM_DIR=/var/ccm-devel/rpm/jorris
CCM_SCRIPTS_HOME=/usr/share/ccm-scripts
CCM_SERVLET_CONTAINER=tomcat
CCM_SERVLET_RESIN_CONF=/usr/share/ccm-tools/server/resin/bin/resin-conf-gen
CCM_SERVLET_TOMCAT_CONF=/usr/share/ccm-tools/server/tomcat/bin/tomcat-conf-gen
CCM_SHARED_LIB_DIST_DIR=/usr/share/java
CCM_TOOLS_HOME=/usr/share/ccm-tools
CCM_WEBAPP_DIST_DIR=/usr/share/java/webapps
CLASSPATH=/home/boston/jorris/dev/lib/classes12.zip:/usr/share/java/junit.jar:/opt/oracle/product/9.2.0.1/jdbc/lib/classes12.zip
COLORS=/etc/DIR_COLORS.xterm
COLORTERM=gnome-terminal
COLUMNS=80
DIRSTACK=()
DISPLAY=:0.0
EUID=3397
GDMSESSION=Default
GNOME_DESKTOP_SESSION_ID=Default
GROUPS=()
GTK_RC_FILES=/etc/gtk/gtkrc:/home/boston/jorris/.gtkrc-1.2-gnome2
G_BROKEN_FILENAMES=1
HISTFILE=/home/boston/jorris/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/home/boston/jorris
HOSTNAME=goodeats.boston.redhat.com
HOSTTYPE=i386
IFS=$' \t\n'
INPUTRC=/etc/inputrc
JAVA_HOME=/usr/java/j2sdk1.4.2_03
JAVA_LIBS=/usr/share/java
KRB5CCNAME=FILE:/tmp/krb5cc_3397_q43hJ2
LAMHELPFILE=/etc/lam/lam-helpfile
LANG=en_US.UTF-8
LANGVAR=en_US.UTF-8
LD_LIBRARY_PATH=/opt/oracle/product/9.2.0.1/lib:/lib:/usr/lib:/usr/local/lib
LESSOPEN='|/usr/bin/lesspipe.sh %s'
LINES=24
LOGNAME=jorris
LS_COLORS='no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:'
MACHTYPE=i386-redhat-linux-gnu
MAIL=/var/spool/mail/jorris
MAILCHECK=60
NLS_CHARACTER_SET=AMERICAN_AMERICA.UTF8
NLS_DATE_FORMAT=YYYY-MM-DD
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
OPTERR=1
OPTIND=1
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/9.2.0.1
ORACLE_SID=O920DB
ORA_NLS33=/opt/oracle/product/9.2.0.1/ocommon/nls/admin/data
OSTYPE=linux-gnu
P4CONFIG=/home/boston/jorris/.p4config
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/boston/jorris/bin:/usr/java/j2sdk1.4.2_03/bin:/opt/oracle/product/9.2.0.1/bin:/opt/oracle/product/9.2.0.1/bin
PIPESTATUS=([0]="0")
PPID=25401
PROMPT_COMMAND='echo -ne
"\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
PS1='[\u@\h \W]\$ '
PS2='> '
PS4='+ '
PVM_ROOT=/usr/share/pvm3
PVM_RSH=/usr/bin/rsh
PWD=/home/boston/jorris
QTDIR=/usr/lib/qt-3.1
SESSION_MANAGER=local/goodeats.boston.redhat.com:/tmp/.ICE-unix/25302
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=2
SSH_AGENT_PID=25354
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SSH_AUTH_SOCK=/tmp/ssh-nBG25302/agent.25302
SUPPORTED=en_US.UTF-8:en_US:en
TERM=xterm
TNS_ADMIN=/opt/oracle/product/9.2.0.1/network/admin
UID=3397
USER=jorris
WINDOWID=25188219
XAUTHORITY=/home/boston/jorris/.Xauthority
XMODIFIERS=@im=none
_=rebuildora8
i=/etc/profile.d/which-2.sh
prefix=/usr
sysconfdir=/etc
complete_ccm_dev_profiles ()
{
    for dir in `ls --color=never -d ${CCM_DEVEL_ROOT}/dev/${USER}/$2*
2>/dev/null`;
    do
        COMPREPLY[${#COMPREPLY[*]}]=`basename $dir`;
    done
}

After:
[jorris@goodeats jorris]$ ccm-profile test-qgen
CCM_DEV_HOME: /var/ccm-devel/dev/jorris/test-qgen
CCM_WEB_HOME: /var/ccm-devel/web/jorris/test-qgen
CCM_HOME: /var/ccm-devel/web/jorris/test-qgen
[jorris@goodeats jorris]$ set
BASH=/bin/bash
BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release"
[5]="i386-redhat-linux-gnu")
BASH_VERSION='2.05b.0(1)-release'
CCM_CONFIG_HOME=/usr/share/ccm-devel
CCM_CONFIG_LIB_DIR=/usr/share/java
CCM_DEVEL_CONF_DIR=/etc/ccm-devel
CCM_DEVEL_ROOT=/var/ccm-devel
CCM_DEV_HOME=/var/ccm-devel/dev/jorris/test-qgen
CCM_DIST_HOME=/usr/share/ccm-devel
CCM_HOME=/var/ccm-devel/web/jorris/test-qgen
CCM_RPM_DIR=/var/ccm-devel/rpm/jorris
CCM_SCRIPTS_HOME=/usr/share/ccm-scripts
CCM_SERVLET_CONTAINER=tomcat
CCM_SERVLET_RESIN_CONF=/usr/share/ccm-tools/server/resin/bin/resin-conf-gen
CCM_SERVLET_TOMCAT_CONF=/usr/share/ccm-tools/server/tomcat/bin/tomcat-conf-gen
CCM_SHARED_LIB_DIST_DIR=/usr/share/java
CCM_TOOLS_HOME=/usr/share/ccm-tools
CCM_WEBAPP_DIST_DIR=/usr/share/java/webapps
CCM_WEB_HOME=/var/ccm-devel/web/jorris/test-qgen
CLASSPATH=/home/boston/jorris/dev/lib/classes12.zip:/usr/share/java/junit.jar:/opt/oracle/product/9.2.0.1/jdbc/lib/classes12.zip:/usr/share/java/servletapi4.jarCOLORS=/etc/DIR_COLORS.xterm
COLORTERM=gnome-terminal
COLUMNS=80
DIRSTACK=()
DISPLAY=:0.0
EUID=3397
GDMSESSION=Default
GNOME_DESKTOP_SESSION_ID=Default
GROUPS=()
GTK_RC_FILES=/etc/gtk/gtkrc:/home/boston/jorris/.gtkrc-1.2-gnome2
G_BROKEN_FILENAMES=1
HISTFILE=/home/boston/jorris/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/home/boston/jorris
HOSTNAME=goodeats.boston.redhat.com
HOSTTYPE=i386
IFS=$' \t\n'
INPUTRC=/etc/inputrc
JAVA_HOME=/usr/java/j2sdk1.4.2_03
JAVA_LIBS=/usr/share/java
KRB5CCNAME=FILE:/tmp/krb5cc_3397_q43hJ2
LAMHELPFILE=/etc/lam/lam-helpfile
LANG=en_US.UTF-8
LANGVAR=en_US.UTF-8
LD_LIBRARY_PATH=/opt/oracle/product/9.2.0.1/lib:/lib:/usr/lib:/usr/local/lib
LESSOPEN='|/usr/bin/lesspipe.sh %s'
LINES=24
LOGNAME=jorris
LS_COLORS='no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:'
MACHTYPE=i386-redhat-linux-gnu
MAIL=/var/spool/mail/jorris
MAILCHECK=60
NLS_CHARACTER_SET=AMERICAN_AMERICA.UTF8
NLS_DATE_FORMAT=YYYY-MM-DD
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
OPTERR=1
OPTIND=1
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/9.2.0.1
ORACLE_SID=O920DB
ORA_NLS33=/opt/oracle/product/9.2.0.1/ocommon/nls/admin/data
OSTYPE=linux-gnu
P4CONFIG=/home/boston/jorris/.p4config-test-qgen
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/boston/jorris/bin:/usr/java/j2sdk1.4.2_03/bin:/opt/oracle/product/9.2.0.1/bin:/opt/oracle/product/9.2.0.1/bin
PIPESTATUS=([0]="0")
PPID=25401
PROMPT_COMMAND='echo -ne
"\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
PS1='[\u@\h \W]\$ '
PS2='> '
PS4='+ '
PVM_ROOT=/usr/share/pvm3
PVM_RSH=/usr/bin/rsh
PWD=/home/boston/jorris
QTDIR=/usr/lib/qt-3.1
SERVER=test-qgen
SESSION_MANAGER=local/goodeats.boston.redhat.com:/tmp/.ICE-unix/25302
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=2
SSH_AGENT_PID=25354
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SSH_AUTH_SOCK=/tmp/ssh-nBG25302/agent.25302
SUPPORTED=en_US.UTF-8:en_US:en
TERM=xterm
TNS_ADMIN=/opt/oracle/product/9.2.0.1/network/admin
UID=3397
USER=jorris
WINDOWID=25188219
XAUTHORITY=/home/boston/jorris/.Xauthority
XMODIFIERS=@im=none
_=test-qgen
dir=/var/ccm-devel/dev/jorris/test-qgen
i=/etc/ccm-devel/project.d/ccm-devel-perforce.sh
prefix=/usr
sysconfdir=/etc
ccm_inst ()
{
    ( cddev;
    ant clean;
    ant deploy )
}
ccm_restart ()
{
    ccm_stop;
    ccm_start
}
ccm_start ()
{
    ccm start
}
ccm_start_resin ()
{
    ccm_start --container=resin
}
ccm_start_tomcat ()
{
    ccm_start --container=tomcat
}
ccm_start_tomcat4 ()
{
    ccm_start_tomcat
}
ccm_stop ()
{
    ccm stop
}
ccm_stop_resin ()
{
    ccm_stop --container=resin
}
ccm_stop_tomcat ()
{
    ccm_stop --container=tomcat
}
ccm_stop_tomcat4 ()
{
    ccm_stop_tomcat
}
cddev ()
{
    cd "/var/ccm-devel/dev/jorris/test-qgen"
}
cdweb ()
{
    cd "/var/ccm-devel/web/jorris/test-qgen"
}
complete_ccm_dev_profiles ()
{
    for dir in `ls --color=never -d ${CCM_DEVEL_ROOT}/dev/${USER}/$2*
2>/dev/null`;
    do
        COMPREPLY[${#COMPREPLY[*]}]=`basename $dir`;
    done
}
tailccm ()
{
    ( cdweb;
    tail -f logs/ccm.log )
}
taillogs ()
{
    ( cdweb;
    tail -f logs/*.log )
}


Comment 6 Dennis Gregorovic 2004-03-08 17:21:46 UTC
functions switched to scripts @41125


Note You need to log in before you can comment on or make changes to this bug.