Re: Permission denied, "pkg" phase

2016-08-26 Thread Craig Treleaven
> On Aug 26, 2016, at 6:46 AM, Rainer Müller  wrote:
> 
> On 2016-08-26 05:09, Craig Treleaven wrote:
>> I’ve tried adding:
>> 
>> pkg.asroot  yes
>> 
>> to my portfile but that seems to be unrecognized.
>> 
>> Is there a way around this?
> 
> Not without patching base. I have no experience with creating pkgs, so I
> don't know if it makes sense to allow running this as root at all.
> 
> Rainer
> 

Thank you, Rainer!

Your patch allowed the pkg/mpkg commands to work.  I do notice that the owner 
of certain files has changed from macports to root, however.  I’ll test 
deploying the installer and see if the result works OK.  I’ll try producing an 
mdmg, as well.

If those work out OK, is this something that would be an acceptable change to 
base for distribution?

Craig
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: Permission denied, "pkg" phase

2016-08-26 Thread Rainer Müller
On 2016-08-26 05:09, Craig Treleaven wrote:
> I’ve tried adding:
> 
> pkg.asroot  yes
> 
> to my portfile but that seems to be unrecognized.
> 
> Is there a way around this?

Not without patching base. I have no experience with creating pkgs, so I
don't know if it makes sense to allow running this as root at all.

Rainer
Index: src/package1.0/portpkg.tcl
===
--- src/package1.0/portpkg.tcl  (revision 151752)
+++ src/package1.0/portpkg.tcl  (working copy)
@@ -45,6 +45,7 @@
 
 # define options
 options package.type package.destpath package.flat package.resources 
package.scripts
+options pkg.asroot
 
 # Set defaults
 default package.destpath {${workpath}}
@@ -52,6 +53,7 @@
 default package.scripts  {${workpath}/pkg_scripts}
 # Need productbuild to make flat packages really work
 default package.flat {[expr {[vercmp $macosx_deployment_target 10.6] >= 
0}]}
+default pkg.asroot no
 
 set_ui_prefix
 
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Permission denied, "pkg" phase

2016-08-25 Thread Craig Treleaven
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?

Craig


Please excuse typos--sent from my iPhone.
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev