Ignore:
Timestamp:
Nov 29, 2007, 5:35:54 AM (13 years ago)
Author:
jmpp@…
Message:

Check if we're on Leopard before running, we already install stuff into /etc/{man,}path.d so we don't need to adjust anything on that platform.
Also cleanup the script somewhat: use echo -e since our shebang assures us we're using bash.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/portmgr/dmg/postflight

    r31487 r31600  
    3131# $Id$
    3232
    33 echo ""
    34 echo "Checking the PATH variable for $USER..."
    35 echo ""
    3633
    3734BINPATH=/opt/local/bin
    3835SBINPATH=/opt/local/sbin
    3936
     37
     38echo -e "\nChecking the PATH variable for $USER...\n"
     39
     40# No need to do any path adjustments if we're on Leopard, as we already install our path configs into /etc/paths.d/ and /etc/manpaths.d/
     41if [ $(sw_vers -productVersion | awk -F . '{print $2}') -eq 5 ]; then
     42    echo "No need to adjust the PATH and MANPATH environment variables on Leopard!"
     43    exit 0
     44fi
     45
    4046if $SHELL -c "/usr/bin/printenv PATH" | grep -c $BINPATH > /dev/null; then
    41     echo "You already have the right PATH - l337!"
     47    echo "You already have the right PATH!"
    4248else
    4349    USHELL=`basename $SHELL`
     
    7480# run selfupdate
    7581
    76 echo""
    77 echo "Selfupdating The MacPorts system ..."
    78 echo ""
     82echo -e "\nSelfupdating The MacPorts system ...\n"
    7983
    8084port -d selfupdate
    8185if [ $? != 0 ]; then
    8286    echo "An attempt to synchronize your recent MacPorts installation with the rsync server failed, please run 'port -d selfupdate' manually to find out the cause of the error."
    83     exit
     87    exit 1
    8488fi
    8589
    86 # done !!
    87 echo ""
    88 echo "You have succesfully installed the MacPorts system."
    89 echo ""
     90# Postflight script is done with its job!
     91echo -e "\nYou have succesfully installed the MacPorts system.\n"
    9092echo "Launch a terminal and try it out !!"
    91 echo "Read the port manual page for help."
    92 echo ""
     93echo -e "Read the port manual page for help.\n"
Note: See TracChangeset for help on using the changeset viewer.