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


Re: Updating tk +quartz failed on Snow Leopard

2016-08-26 Thread Ken Cunningham

On 2016-08-25, at 8:20 PM, Kevin Walzer wrote:

> On 8/25/16 10:02 PM, Ryan Schmidt wrote:
>> I just haven't researched whether one is supposed to use 
>> MAC_OS_X_VERSION_MIN_REQUIRED or MAC_OS_X_VERSION_MAX_ALLOWED or 
>> __MAC_OS_X_VERSION_MAX_ALLOWED or something else.
> Can someone try something like this:
> 
> #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
> 
> [do someStuff:here andHere];
> 
> #endif
> 
> and see if it builds on 10.6? If so, send me a patch and I'll test it on 
> 10.11 and commit if it works. I have no access to 10.6.
> 
> Thanks,
> Kevin
> 
> -- 
> Kevin Walzer
> Code by Kevin/Mobile Code by Kevin
> http://www.codebykevin.com
> http://www.wtmobilesoftware.com
> 
> ___
> macports-dev mailing list
> macports-dev@lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-dev


It looks like it works as expected. There are different ways to do the same 
thing, but the easy-to-read, non-underscore version of these tests uses 
 rather than the newer but more complicated 
, and worked like this:

Testing out the following code on snow leopard:

--
#include 
#include 

#define MY_CURRENT_OS   MAC_OS_X_VERSION_MAX_ALLOWED

int main() {

printf("%d\n", MAC_OS_X_VERSION_MAX_ALLOWED); 
printf("%d\n", MAC_OS_X_VERSION_MIN_REQUIRED);



#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
printf("This code will only be seen and compiled Lion or greater!\n");
// and more
#endif

#if MAC_OS_X_VERSION_MAX_ALLOWED == 1060
printf("This code is only seen and compiled on Snow Leopard\n");
// and more
#endif

#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050
printf("This code is only seen and compiled on Leopard or Older\n");
// and more

#endif


#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
printf("This MIN version specifies code that is only seen and compiled 
on Snow Leopard or earlier\n");
// and more
#endif


return 0;
}

--

produces the following output:

KensMacBookPro:compiler tests cunningh$ clang test.c -o test
KensMacBookPro:compiler tests cunningh$ ./test
1060
1060
This code is only seen and compiled on Snow Leopard
This MIN version specifies code that is only seen and compiled on Snow Leopard 
or earlier

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