Bug 118927 - miscellaneous issues with ccm-devel scripts
Summary: miscellaneous issues with ccm-devel scripts
Alias: None
Product: Red Hat Web Application Framework
Classification: Retired
Component: installation   
(Show other bugs)
Version: nightly
Hardware: All Linux
Target Milestone: ---
Assignee: Dennis Gregorovic
QA Contact: Jon Orris
Depends On:
TreeView+ depends on / blocked
Reported: 2004-03-22 21:17 UTC by Vadim Nasardinov
Modified: 2007-04-18 17:04 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-03-30 23:28:22 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Vadim Nasardinov 2004-03-22 21:17:25 UTC
I've run into a couple of issues with the scripts provided by the
"ccm-devel" RPM.

When executing

|$ ccm-profile ccm60

I get

|/etc/ccm-devel/project5x.sh: line 5: return: can only `return' from a function or sourced script
|/etc/ccm-devel/project5x.sh: line 206: `ccm-inst': not a valid identifier
|bash: tempenv.sh: line 1: syntax error near unexpected token `newline'
|bash: tempenv.sh: line 1: `ccm-devel-profile.sh <servername>'

The first error is due to the fact that "return" is used outside of a
function body, as in the following example:

|$ p4 print //tools/ccmbuild/devel/dev/etc/project5x.sh#2 | \
|  grep -vE '^//tools' | head -n 5 | tail -n 3
|if [ "x$1" = "x" ] ; then
|  echo "ccm-devel-profile.sh <servername>"
|  return

This generates a warning and the script continues to execute.  The
intent seems to have been to call "exit 0" or "exit 1" or some such
instead.  There is more than one place where "return" is used in this

|$ rpm -qf /etc/ccm-devel/project5x.sh

The second error is that bash doesn't like the '-' in the function
name.  ccm-inst is the first occurrence of such a name in

|$ cat -n /etc/ccm-devel/project5x.sh | head -n 206 | tail -n 7
|   200  function ccm-inst() {
|   201      (
|   202          cddev;
|   203          ant clean;
|   204          ant deploy
|   205      )
|   206  }

The error with tempenv.sh happens because the earlier use of "return"
fails to abort the script execution, and tempenv.sh ends up looking
like so:

|$ cat /tempenv.saved
|ccm-devel-profile.sh <servername>
|Warning: Cannot find postgres jdbc2 library
|Looked for: /usr/share/pgsql/java/rh-pgsql-jdbc2.jar /usr/share/pgsql/jdbc7.2dev-1.2.jar /usr/share/pgsql/pg73b1jdbc2.jar
|Point PG_JDBC2_LIB to correct location if using PostgreSQL

The tempenv.sh thingy is also a source of infrequent errors of the
following kind:

|$ ccm-profile ccm60
|bash: tempenv.sh: Permission denied

This happens when you run the ccm-profile command from a directory in
which you don't have write permissions, such as /usr/bin.  This
happens because the /usr/bin/ccm-devel-profile.sh script tries to
create a temporary file named tempenv.sh in the current directory.  If
you don't have write permissions for the current directory, you're

$ cat -n /usr/bin/ccm-devel-profile.sh | head -n 19 | tail -n 4
    16  perl $CCM_DEVEL_CONF_DIR/project.pl $@ > tempenv.sh
    17  if [ $? != 0 ]; then
    18    return
    19  fi

$ rpm -qf /usr/bin/ccm-devel-profile.sh

Comment 1 Dennis Gregorovic 2004-03-22 21:25:14 UTC
The first issue listed (about using return) was fixed @41473.  Looking
at the rest now...

Comment 2 Dennis Gregorovic 2004-03-22 21:27:50 UTC
As of @41277, ccm-devel-profile.sh uses a temp file instead if
./tempenv.sh, so you can run ccm-profile from anywhere.

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