Bug 103647 - ccm-profile should be a function instead of an alias
ccm-profile should be a function instead of an alias
Status: CLOSED WONTFIX
Product: Red Hat Web Application Framework
Classification: Retired
Component: dev environment (Show other bugs)
nightly
All Linux
medium Severity low
: ---
: ---
Assigned To: Dennis Gregorovic
Jon Orris
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-09-03 11:07 EDT by Dennis Gregorovic
Modified: 2007-04-18 12:57 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-22 10:54:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dennis Gregorovic 2003-09-03 11:07:06 EDT
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@redhat.com>
To: 	Dennis Gregorovic <dgregor@redhat.com>
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 10:54:36 EST
closing out old CCM bugs

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