Update of /cvsroot/fink/fink/perlmod/Fink
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv32345

Modified Files:
        ChangeLog Engine.pm 
Log Message:
make it easier to allow various env vars to propagate over sudo env cleaning


Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.439
retrieving revision 1.440
diff -u -d -r1.439 -r1.440
--- Engine.pm   6 Jan 2010 23:47:53 -0000       1.439
+++ Engine.pm   7 Jan 2010 02:27:30 -0000       1.440
@@ -321,7 +321,11 @@
        my $method = $config->param_default("RootMethod", "sudo");
        if ($method eq "sudo") {
                my $env = '';
-               $env = "/usr/bin/env PERL5LIB='$ENV{'PERL5LIB'}'" if (exists 
$ENV{'PERL5LIB'} and defined $ENV{'PERL5LIB'});
+               foreach (qw/ PERL5LIB /) {
+                       # explicitly propagate env vars that sudo wipes
+                       $env .= "$_='".$ENV{"$_"}."'" if defined $ENV{"$_"};
+               }
+               $env = "/usr/bin/env $env" if length $env;
                $cmd = "/usr/bin/sudo $env $cmd";
        } elsif ($method eq "su") {
                $cmd = "/usr/bin/su root -c '$cmd'";

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.1649
retrieving revision 1.1650
diff -u -d -r1.1649 -r1.1650
--- ChangeLog   7 Jan 2010 02:26:51 -0000       1.1649
+++ ChangeLog   7 Jan 2010 02:27:30 -0000       1.1650
@@ -1,5 +1,10 @@
 2010-01-06  Daniel Macks  <[email protected]>
 
+       * Engine.pm: easier/clearer control of env vars propagated over
+       sudo
+
+2010-01-06  Daniel Macks  <[email protected]>
+
        * all: update copyright
 
 2009-11-23  Augusto Devegili  <[email protected]>


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Fink-commits mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to