Permission denied, "pkg" phase

Craig Treleaven ctreleaven at
Thu Aug 25 20:09:24 PDT 2016

How do I get elevated privileges in a “pre-pkg” block?

In a thread a couple of days ago, it was pointed out that “pkg” and “mpkg” are phases and that one can have a pre-pkg or post-mpkg block.  I want to include a copy of daemondo in an mpkg and it looks like all I need to do is copy the executable into the destroot.  The pkg phase will then then create an installer component including it and mpkg will add that to the meta package.  I’ve been testing this with the gforth port just to work out the concept.

The offending block is:

pre-pkg {
  xinstall -m 644 ${prefix}/bin/daemondo ${destroot}${prefix}/bin/

resulting in:

Error: org.macports.pkg for port gforth returned: xinstall: Unable to create new file for: /opt/local/var/macports/build/_Users_craigtreleaven_mp_ports_lang_gforth/gforth/work/destroot/opt/local/bin//daemondo, Permission denied
DEBUG: Error code: NONE

I’ve tried adding:

pkg.asroot  yes

to my portfile but that seems to be unrecognized.

Is there a way around this?


Please excuse typos--sent from my iPhone.

More information about the macports-dev mailing list