#16199: MacPorts-1-1.6.0 postflight shell recognition failure --------------------------------------+------------------------------------- Reporter: nick.colclasure@mac.com | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: MacPorts base bugs Component: base | Version: 1.6.0 Resolution: | Keywords: MacPorts-1-1.6.0 shell recognition postflight --------------------------------------+------------------------------------- Comment (by raimue@macports.org): No, sorry. I meant how you invoked the postflight script. But after some testing I was now able to reproduce the issue anyway. A simple reproduction recipe for the problem: {{{ echo 'echo $USER $SUDO_USER' > foo.sh chmod +x foo.sh sudo ./foo.sh }}} This gives for me {{{ root raim }}} The postflight script reads $USER which is set to 'root' when running with sudo. But in Installer.app $USER is probably exported to the installing user. Maybe it should just respect $SUDO_USER, if available. Workaround: {{{ bash postflight sudo port -v selfupdate }}} No sudo for postflight this time, most probably you will see an error message that selfupdate failed. But that's no big deal and we just do it afterwards. -- Ticket URL: <http://trac.macports.org/ticket/16199#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS