<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Here is a pull request that fixes the issue for me.</div><div class=""><br class=""></div><a href="https://github.com/macports/macports-base/pull/16" class="">https://github.com/macports/macports-base/pull/16</a><div class=""><br class=""></div><div class=""><div class="">"Fix the detection of /opt/local/bin in user's PATH</div><div class=""><br class=""></div><div class="">The postflight script was using the SHELL variable, which is root's shell</div><div class="">and not USHELL, which is the user's shell.</div><div class=""><br class=""></div><div class="">The test for MacPorts paths in the users PATH can be made more robust.</div><div class="">The old code will match on /opt/locale for example.</div><div class=""><br class=""></div><div class="">Spit the PATH into one path per line with tr and then grep for an exact match</div><div class="">with /opt/local/bin.”</div><div class=""><br class=""></div><div class="">I tested this for bash and checked the logs of the installed for unexpected messages.</div><div class=""><br class=""></div></div><div class="">Barry</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 30 Jan 2017, at 20:48, Clemens Lang <<a href="mailto:cal@macports.org" class="">cal@macports.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class="">On Mon, Jan 30, 2017 at 05:37:41PM +0000, Barry Scott wrote:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On 30 Jan 2017, at 12:44, Barry Scott <<a href="mailto:barry@barrys-emacs.org" class="">barry@barrys-emacs.org</a>> wrote:<br class=""><br class="">When I run the postinstall as me it works are intended for my<br class="">.bash_profile. When I run via sudo it looks at root’s file and<br class="">states tit does not support the “sh” shell. I suspect that the<br class="">environment that postinstall is running in is a strange in some way.<br class="">(I have seen Mac specific oddities when developing python based apps<br class="">like no LANG env var.)<br class=""></blockquote></blockquote><br class="">That may very well be the problem. I suspect the installer is run as<br class="">root, and $USER is actually root for the installer.<br class=""><br class="">You should be able to see the debug output of the script in installer<br class="">using Window > Installer Log and switching the detail level to 'Show All<br class="">Logs'.<br class=""><br class=""><blockquote type="cite" class="">I found the sudo port -d pkg MacPorts command. But that does not use<br class="">my git tree.<br class=""></blockquote><br class="">We use sudo port pkg MacPorts to create the installer. You can modify<br class="">the MacPorts port file to point to your source tree. Instead of<br class=""><br class=""> github.setup macports macports-base v2.4.0<br class=""> ...<br class=""> distname ${name}-${version}<br class=""> github.tarball_from releases<br class=""> ...<br class=""> checksums ...<br class=""><br class="">use<br class=""><br class=""> fetch.type git<br class=""> git.url <a href="file:///absolute/path/to/your/working/dir/.git" class="">file:///absolute/path/to/your/working/dir/.git</a><br class=""> git.branch $latest_commit_hash (or just HEAD for testing)<br class=""><br class="">Note that this will only pick up committed changes, so you'll have to<br class="">commit things for this to work. Also note that the 'macports' user must<br class="">be able to read the path.<br class=""><br class="">Since the installer won't be signed using this method you may have to<br class="">open it using right click > open.<br class=""><br class="">-- <br class="">Clemens<br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>