RFE: macports installer package postflight tweak
Reported by: |
asigel@… |
Owned by: |
macports-tickets@… |
Priority:
|
Normal
|
Milestone:
|
MacPorts 1.6
|
Component:
|
base
|
Version:
|
1.2
|
Keywords:
|
|
Cc:
|
|
Port:
|
|
|
|
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 (9)
severity: |
normal →
trivial
|
Type: |
defect →
enhancement
|
Summary: |
darwinports installer package postflight tweak →
RFE: darwinports installer package postflight tweak
|
Milestone: |
→ MacPorts base bugs
|
Priority: |
Expected →
Normal
|
Summary: |
RFE: darwinports installer package postflight tweak →
RFE: macports installer package postflight tweak
|
Description: |
modified (diff)
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
Milestone: |
MacPorts base bugs →
MacPorts Future
|
Milestone: |
MacPorts Future →
MacPorts 1.6
|
Doablem, but can we guarantee that the -c construct will work with every shell out there? I'm a bash user and just skimmed over tcsh's, ksh's and zsh's and confirmed it for them.... but am I missing any other? I know we already sorta blindly assume it for the -l construct, but it's not like I'm that comfortable about it.
-jmpp