CPANPLUS 0.083_09
Jos I. Boumans [Fri, 9 Nov 2007 15:50:11 +0000 (16:50 +0100)]
From: "Jos I. Boumans" <jos@dwim.org>
Message-Id: <B17C3858-AF8D-4FDE-AE15-F612E7B41FC9@dwim.org>

p4raw-id: //depot/perl@32252

14 files changed:
lib/CPANPLUS.pm
lib/CPANPLUS/Config.pm
lib/CPANPLUS/Internals.pm
lib/CPANPLUS/Shell/Default.pm
lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz.packed
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed
lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed
lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed
lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed
lib/CPANPLUS/t/inc/conf.pl

index d8fbea5..5722305 100644 (file)
@@ -13,7 +13,7 @@ BEGIN {
     use vars        qw( @EXPORT @ISA $VERSION );
     @EXPORT     =   qw( shell fetch get install );
     @ISA        =   qw( Exporter );
-    $VERSION = "0.83_08";     #have to hardcode or cpan.org gets unhappy
+    $VERSION = "0.83_09";     #have to hardcode or cpan.org gets unhappy
 }
 
 ### purely for backward compatibility, so we can call it from the commandline:
index b092133..f9f5391 100644 (file)
@@ -486,18 +486,42 @@ remains empty if you do not require super user permissiosn to install.
 =cut
 
         $Conf->{'program'}->{'sudo'} = do {
-            $>  # check for all install dirs!
-                # installsiteman3dir is a 5.8'ism.. don't check
-                # it on 5.6.x...
-                ? ( -w $Config{'installsitelib'} &&
-                    ( defined $Config{'installsiteman3dir'} &&
-                           -w $Config{'installsiteman3dir'}
-                    ) &&
-                    -w $Config{'installsitebin'} 
-                        ? undef
-                        : can_run('sudo') 
-                  )
-                : can_run('sudo')
+
+            ### let's assume you dont need sudo,
+            ### unless one of the below criteria tells us otherwise
+            my $sudo = undef;
+            
+            ### you're a normal user, you might need sudo
+            if( $> ) {
+    
+                ### check for all install dirs!
+                ### installsiteman3dir is a 5.8'ism.. don't check
+                ### it on 5.6.x...            
+                ### you have write permissions to the installdir,
+                ### you don't need sudo
+                if( -w $Config{'installsitelib'} &&
+                    ( defined $Config{'installsiteman3dir'} && 
+                      -w $Config{'installsiteman3dir'} 
+                    ) && -w $Config{'installsitebin'} 
+                ) {                    
+                    $sudo = undef;
+                    
+                ### you have PERL_MM_OPT set to some alternate
+                ### install place. You probably have write permissions
+                ### to that
+                } elsif ( $ENV{'PERL_MM_OPT'} and 
+                          $ENV{'PERL_MM_OPT'} =~ /INSTALL|LIB|PREFIX/
+                ) {
+                    $sudo = undef;
+
+                ### you probably don't have write permissions
+                } else {                
+                    $sudo = can_run('sudo');
+                }
+            }  
+            
+            ### and return the value
+            $sudo;
         };
 
 =item perlwrapper
index 6bc6813..68d71aa 100644 (file)
@@ -40,7 +40,7 @@ use vars qw[@ISA $VERSION];
             CPANPLUS::Internals::Report
         ];
 
-$VERSION = "0.83_08";
+$VERSION = "0.83_09";
 
 =pod
 
index 66d3184..d3068e0 100644 (file)
@@ -26,7 +26,7 @@ local $Data::Dumper::Indent     = 1; # for dumpering from !
 BEGIN {
     use vars        qw[ $VERSION @ISA ];
     @ISA        =   qw[ CPANPLUS::Shell::_Base::ReadLine ];
-    $VERSION = "0.83_08";
+    $VERSION = "0.83_09";
 }
 
 load CPANPLUS::Shell;
index c9546f8..576975c 100644 (file)
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
 
-Created at Sun Nov  4 11:24:49 2007
+Created at Fri Nov  9 15:20:34 2007
 #########################################################################
 __UU__
 M'XL("%_EO$4``S`Q;6%I;')C+G1X=`!+S,E,+%9P#8T(5@`#)=>*DM"2S)QB
index 0c22cdc..0d01bf8 100644 (file)
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed
 
-Created at Sun Nov  4 11:24:49 2007
+Created at Fri Nov  9 15:20:34 2007
 #########################################################################
 __UU__
 M'XL("!1%OT4"`T)U;F1L92U&;V\M0F%R+3`N,#$N=&%R`.V7:V_:,!2&^8I_
index 71e0feb..29f0ca9 100644 (file)
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed
 
-Created at Sun Nov  4 11:24:50 2007
+Created at Fri Nov  9 15:20:34 2007
 #########################################################################
 __UU__
 M'XL("/8X34("`T9O;RU"87(M,"XP,2YT87(`[9KQ;]I&%,?Y^?Z*1YE$(A5C
index 8a25510..2d0f598 100644 (file)
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz.packed
 
-Created at Sun Nov  4 11:24:50 2007
+Created at Fri Nov  9 15:20:34 2007
 #########################################################################
 __UU__
 M'XL(`'3DO44``^W/,0J`,`Q`T1RE)Y"T-O4XXN"DB%2]OR(*NNC4[;_E#\F0
index cc106ad..11e5785 100644 (file)
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed
 
-Created at Sun Nov  4 11:24:50 2007
+Created at Fri Nov  9 15:20:34 2007
 #########################################################################
 __UU__
 M'XL("`DY34("`T9O;RU"87(M,"XP,2YT87(`[5IK3]M(%,U7YE=<H%5``A.;
index 117ce6d..7534d14 100644 (file)
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed
 
-Created at Sun Nov  4 11:24:50 2007
+Created at Fri Nov  9 15:20:34 2007
 #########################################################################
 __UU__
 M'XL("-<X34(``T9O;RU"87(M,"XP,2YT87(`[9E;;]HP%,=Y]J<X+9722@-R
index 19b5437..6966be0 100644 (file)
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed
 
-Created at Sun Nov  4 11:24:50 2007
+Created at Fri Nov  9 15:20:34 2007
 #########################################################################
 __UU__
 M'XL("-\X34(``T9O;RU"87(M,"XP,2YT87(`[5K_3QI)%/=7YZ]XU39H(BN[
index 4b4ff96..e41cf53 100644 (file)
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
 
-Created at Sun Nov  4 11:24:50 2007
+Created at Fri Nov  9 15:20:34 2007
 #########################################################################
 __UU__
 M'XL("$TN$T<``S`R<&%C:V%G97,N9&5T86EL<RYT>'0`G=-1;],P$`#@=_^*
index be6cb03..da8a1f5 100644 (file)
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed
 
-Created at Sun Nov  4 11:24:50 2007
+Created at Fri Nov  9 15:20:34 2007
 #########################################################################
 __UU__
 M'XL("#'FO$4``S`S;6]D;&ES="YD871A`%U3_6O;,!#].?HKCBXC"20A=<@&
index dc43992..fe6a20f 100644 (file)
@@ -24,7 +24,7 @@ BEGIN {
 
     ### and add them to the environment, so shellouts get them
     $old_env_perl5lib = $ENV{'PERL5LIB'};
-    $ENV{'PERL5LIB'}  = join ':', 
+    $ENV{'PERL5LIB'}  = join $Config{'path_sep'}, 
                         grep { defined } $ENV{'PERL5LIB'}, @paths, @rel2abs;
     
     ### add our own path to the front of $ENV{PATH}, so that cpanp-run-perl