Bug 103647 - ccm-profile should be a function instead of an alias
Summary: ccm-profile should be a function instead of an alias
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Web Application Framework
Classification: Retired
Component: dev environment
Version: nightly
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Dennis Gregorovic
QA Contact: Jon Orris
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-09-03 15:07 UTC by Dennis Gregorovic
Modified: 2007-04-18 16:57 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-12-22 15:54:36 UTC
Embargoed:


Attachments (Terms of Use)

Description Dennis Gregorovic 2003-09-03 15:07:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030716

Description of problem:
From: 	Matthew Booth <mbooth>
To: 	Dennis Gregorovic <dgregor>
Subject: 	Patch to ccm-devel.sh
Date: 	01 Sep 2003 12:11:10 +0100	
The attached patch makes ccm-profile into a function and exports it. It
pulls the entire contents of /usr/bin/ccm-devel-profile.sh into
/etc/profile.d/ccm-devel.sh, hence removing the need for this file to
exist.

My motivation for doing this is that I noticed when using screen I had
to manually source /etc/profile in order for ccm-profile to work. As an
alias it is set in the current shell, but is not exported to
subprocesses. A function can be exported.


--- /root/ccm-devel.sh  Mon Sep  1 11:59:18 2003
+++ /etc/profile.d/ccm-devel.sh Mon Sep  1 12:05:12 2003
@@ -9,7 +9,36 @@
 export CCM_DEVEL_ROOT
 export CCM_RPM_DIR
 
-alias ccm-profile='. ccm-devel-profile.sh'
+ccm-profile() {
+       if [ -z $1 ]; then
+         echo "ccm-devel-profile.sh <servername>"
+         return
+       fi
+
+       if [ -z $CCM_DEVEL_CONF_DIR ]; then
+         echo "CCM_DEVEL_CONF_DIR not set"
+         return
+       fi
+
+       . $CCM_DEVEL_CONF_DIR/project.sh
+
+       for i in $CCM_DEVEL_CONF_DIR/project.d/*.sh
+       do
+         if [ -x $i ]
+         then
+           . $i
+         fi
+       done
+
+       # "$CCM_HOME/project.sh" allows the user to set environment variables or 
+       # perform other actions on a per-project basis.
+
+       if [ -x "$CCM_HOME/project.sh" ]; then
+           . "$CCM_HOME/project.sh" 
+       fi
+}
+
+export -f ccm-profile
 
 # Set up ccm-profile completion
 # In order for this to work, we must be on a GNU/Linux OS running Bash >= 2.04

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.run build system under screen
2.
3.
    

Actual Results:  ccm-profile doesn't work

Expected Results:  ccm-profile works

Additional info:

Comment 1 Dennis Gregorovic 2004-12-22 15:54:36 UTC
closing out old CCM bugs


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