Opened 18 years ago

Last modified 14 years ago

#8401 closed enhancement

darwinports installer package postflight tweak — at Initial Version

Reported by: asigel@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.6
Component: base Version: 1.2
Keywords: Cc:
Port:

Description

mktemp is used in the postflight script of the installer. the return of the mktemp is not checked so it may not have succeeded. the subsequent write to can fail when it doesnt have to.

Instead of doing this:

BINPATH=/opt/local/bin SBINPATH=/opt/local/sbin TMP=/usr/bin/mktemp /tmp/dp.$$ $SHELL -l <<EOF > $TMP

/usr/bin/printenv PATH exit

EOF

if grep $BINPATH $TMP >/dev/null 2>&1; then

maybe you can do something like:

if $SHELL -c "/usr/bin/printenv PATH"|grep -c $BINPATH >/dev/null; then

echo "You already have the right PATH - l337!"

else

most people would probably never run into a failure case.. but why create a temp file if you dont have to..

Change History (0)

Note: See TracTickets for help on using tickets.