[31916] branches/release_1_6/base/portmgr/dmg/postflight

jmpp at macports.org jmpp at macports.org
Tue Dec 11 15:08:18 PST 2007


Revision: 31916
          http://trac.macosforge.org/projects/macports/changeset/31916
Author:   jmpp at macports.org
Date:     2007-12-11 15:08:16 -0800 (Tue, 11 Dec 2007)

Log Message:
-----------

tcsh apparently does not allow running a non-interactive shell in login mode, it only accepts -l as an only invocation flag.
Therefore abstract our login parameter into a the $LOGIN_FLAG variable and use it accordingly.

Modified Paths:
--------------
    branches/release_1_6/base/portmgr/dmg/postflight

Modified: branches/release_1_6/base/portmgr/dmg/postflight
===================================================================
--- branches/release_1_6/base/portmgr/dmg/postflight	2007-12-11 22:28:02 UTC (rev 31915)
+++ branches/release_1_6/base/portmgr/dmg/postflight	2007-12-11 23:08:16 UTC (rev 31916)
@@ -43,9 +43,11 @@
 case "$USHELL" in
     tcsh)
         CONF_FILE=tcshrc
+        LOGIN_FLAG=""
         ;;
     bash)
         CONF_FILE=profile
+        LOGIN_FLAG="-l"
         ;;
     *)
         echo "Unknown shell! Please set your MacPorts compatible environment manually."
@@ -91,16 +93,16 @@
 echo -e "\nChecking the shell environment for user \"$USER\"...\n"
 
 # Adding our setting to the PATH variable if not already there:
-if $SHELL -lc "/usr/bin/printenv PATH" | grep $PREFIX > /dev/null 2>&1; then
+if $SHELL $LOGIN_FLAG -c "/usr/bin/printenv PATH" | grep $PREFIX > /dev/null 2>&1; then
     echo "Your shell already has the right PATH environment variable for use with MacPorts!"
 else
     write_setting PATH
 fi
 
 # We gather the path into a variable of our own for quicker operation:
-ORIGINAL_MANPATH="$($SHELL -lc "/usr/bin/printenv MANPATH")"
+ORIGINAL_MANPATH="$($SHELL $LOGIN_FLAG -c "/usr/bin/printenv MANPATH")"
 # Adding out setting to the MANPATH variable only if it exists and, following that:
-if ! $SHELL -lc "/usr/bin/env | grep MANPATH > /dev/null 2>&1" || \
+if ! $SHELL $LOGIN_FLAG -c "/usr/bin/env | grep MANPATH > /dev/null 2>&1" || \
 # if it doesn't already contain our path:
   echo "$ORIGINAL_MANPATH" | grep $MANPAGES > /dev/null 2>&1 || \
 # if there's no empty component somewhere in the middle of it:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071211/68f8c713/attachment.html


More information about the macports-changes mailing list