Prevent MacPorts editing .bash_profile over and over again...

Clemens Lang cal at
Mon Jan 30 20:48:29 UTC 2017


On Mon, Jan 30, 2017 at 05:37:41PM +0000, Barry Scott wrote:
> > On 30 Jan 2017, at 12:44, Barry Scott <barry at> wrote:
> > 
> > When I run the postinstall as me it works are intended for my
> > .bash_profile. When I run via sudo it looks at root’s file and
> > states tit does not support the “sh” shell. I suspect that the
> > environment that postinstall is running in is a strange in some way.
> > (I have seen Mac specific oddities when developing python based apps
> > like no LANG env var.)

That may very well be the problem. I suspect the installer is run as
root, and $USER is actually root for the installer.

You should be able to see the debug output of the script in installer
using Window > Installer Log and switching the detail level to 'Show All

> I found the sudo port -d pkg MacPorts command. But that does not use
> my git tree.

We use sudo port pkg MacPorts to create the installer. You can modify
the MacPorts port file to point to your source tree. Instead of

 github.setup macports macports-base v2.4.0
 distname ${name}-${version}
 github.tarball_from releases
 checksums ...


 fetch.type git
 git.url file:///absolute/path/to/your/working/dir/.git
 git.branch $latest_commit_hash (or just HEAD for testing)

Note that this will only pick up committed changes, so you'll have to
commit things for this to work. Also note that the 'macports' user must
be able to read the path.

Since the installer won't be signed using this method you may have to
open it using right click > open.


More information about the macports-users mailing list