Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove trailing whitespace

  • Loading branch information...
commit e134418664e1f05b76be4bb5e9f00b90c6c70fdf 1 parent 5ca2446
@bingos bingos authored
Showing with 3,309 additions and 3,309 deletions.
  1. +1 −1  ChangeLog
  2. +31 −31 Makefile.PL
  3. +7 −7 README
  4. +3 −3 TODO
  5. +105 −105 bin/cpan2dist
  6. +16 −16 bin/cpanp-boxed
  7. +21 −21 dev-bin/copy-inc-bingos.pl
  8. +25 −25 dev-bin/copy-inc.pl
  9. +1 −1  dev-bin/sandbox-test.pl
  10. +2 −2 inc/Module/Install/Fetch.pm
  11. +3 −3 inc/Module/Install/Makefile.pm
  12. +1 −1  inc/Module/Install/Metadata.pm
  13. +1 −1  inc/Module/Install/Win32.pm
  14. +116 −116 inc/bundle/Archive/Extract.pm
  15. +7 −7 inc/bundle/Archive/Tar.pm
  16. +6 −6 inc/bundle/Archive/Tar/Constant.pm
  17. +11 −11 inc/bundle/Archive/Tar/File.pm
  18. +2 −2 inc/bundle/CPAN/Meta/YAML.pm
  19. +13 −13 inc/bundle/Class/Inspector.pm
  20. +2 −2 inc/bundle/Devel/InnerPackage.pm
  21. +95 −95 inc/bundle/File/Fetch.pm
  22. +5 −5 inc/bundle/File/Fetch/Item.pm
  23. +6 −6 inc/bundle/File/Spec.pm
  24. +1 −1  inc/bundle/File/Spec/Mac.pm
  25. +13 −13 inc/bundle/File/Spec/OS2.pm
  26. +14 −14 inc/bundle/File/Spec/Unix.pm
  27. +20 −20 inc/bundle/File/Spec/VMS.pm
  28. +12 −12 inc/bundle/File/Spec/Win32.pm
  29. +1 −1  inc/bundle/IO/String.pm
  30. +147 −147 inc/bundle/IPC/Cmd.pm
  31. +30 −30 inc/bundle/JSON/PP.pm
  32. +11 −11 inc/bundle/Log/Message.pm
  33. +16 −16 inc/bundle/Log/Message/Simple.pm
  34. +8 −8 inc/bundle/Module/Load.pm
  35. +53 −53 inc/bundle/Module/Load/Conditional.pm
  36. +17 −17 inc/bundle/Module/Loaded.pm
  37. +40 −40 inc/bundle/Module/Pluggable.pm
  38. +21 −21 inc/bundle/Module/Pluggable/Object.pm
  39. +83 −83 inc/bundle/Object/Accessor.pm
  40. +13 −13 inc/bundle/Package/Constants.pm
  41. +8 −8 inc/bundle/Params/Check.pm
  42. +55 −55 inc/bundle/Term/UI.pm
  43. +4 −4 inc/bundle/Term/UI/History.pm
  44. +4 −4 inc/bundle/version.pm
  45. +22 −22 inc/bundle/version/vpp.pm
  46. +17 −17 lib/CPANPLUS.pm
  47. +66 −66 lib/CPANPLUS/Backend.pm
  48. +3 −3 lib/CPANPLUS/Backend/RV.pm
  49. +67 −67 lib/CPANPLUS/Config.pm
  50. +69 −69 lib/CPANPLUS/Configure.pm
  51. +92 −92 lib/CPANPLUS/Configure/Setup.pm
  52. +2 −2 lib/CPANPLUS/Dist.pm
  53. +17 −17 lib/CPANPLUS/Dist/Autobundle.pm
  54. +37 −37 lib/CPANPLUS/Dist/Base.pm
  55. +231 −231 lib/CPANPLUS/Dist/MM.pm
  56. +4 −4 lib/CPANPLUS/Error.pm
  57. +2 −2 lib/CPANPLUS/FAQ.pod
  58. +1 −1  lib/CPANPLUS/Hacking.pod
  59. +30 −30 lib/CPANPLUS/Internals.pm
  60. +82 −82 lib/CPANPLUS/Internals/Constants.pm
  61. +36 −36 lib/CPANPLUS/Internals/Constants/Report.pm
  62. +40 −40 lib/CPANPLUS/Internals/Extract.pm
  63. +60 −60 lib/CPANPLUS/Internals/Fetch.pm
  64. +10 −10 lib/CPANPLUS/Internals/Search.pm
  65. +140 −140 lib/CPANPLUS/Internals/Source.pm
  66. +33 −33 lib/CPANPLUS/Internals/Source/Memory.pm
  67. +61 −61 lib/CPANPLUS/Internals/Source/SQLite.pm
  68. +16 −16 lib/CPANPLUS/Internals/Source/SQLite/Tie.pm
  69. +75 −75 lib/CPANPLUS/Internals/Utils.pm
  70. +107 −107 lib/CPANPLUS/Module.pm
  71. +1 −1  lib/CPANPLUS/Module/Author.pm
  72. +1 −1  lib/CPANPLUS/Module/Author/Fake.pm
  73. +2 −2 lib/CPANPLUS/Module/Checksums.pm
  74. +12 −12 lib/CPANPLUS/Module/Fake.pm
  75. +82 −82 lib/CPANPLUS/Selfupdate.pm
  76. +9 −9 lib/CPANPLUS/Shell.pm
  77. +2 −2 lib/CPANPLUS/Shell/Classic.pm
  78. +161 −161 lib/CPANPLUS/Shell/Default.pm
  79. +38 −38 lib/CPANPLUS/Shell/Default/Plugins/CustomSource.pm
  80. +14 −14 lib/CPANPLUS/Shell/Default/Plugins/HOWTO.pod
  81. +9 −9 lib/CPANPLUS/Shell/Default/Plugins/Remote.pm
  82. +11 −11 lib/CPANPLUS/Shell/Default/Plugins/Source.pm
  83. +28 −28 t/00_CPANPLUS-Internals-Utils.t
  84. +23 −23 t/01_CPANPLUS-Configure.t
  85. +28 −28 t/02_CPANPLUS-Internals.t
  86. +10 −10 t/031_CPANPLUS-Internals-Source-SQLite.t
  87. +4 −4 t/032_CPANPLUS-Internals-Source-via-sqlite.t
  88. +53 −53 t/03_CPANPLUS-Internals-Source.t
  89. +54 −54 t/04_CPANPLUS-Module.t
  90. +21 −21 t/05_CPANPLUS-Internals-Fetch.t
  91. +9 −9 t/06_CPANPLUS-Internals-Constants.t
  92. +2 −2 t/07_CPANPLUS-Internals-Extract.t
  93. +111 −111 t/08_CPANPLUS-Backend.t
  94. +3 −3 t/09_CPANPLUS-Internals-Search.t
  95. +25 −25 t/10_CPANPLUS-Error.t
  96. +20 −20 t/15_CPANPLUS-Shell.t
  97. +34 −34 t/19_CPANPLUS-Dist.t
  98. +26 −26 t/20_CPANPLUS-Dist-MM.t
  99. +20 −20 t/21_CPANPLUS-Dist-No-Build.t
  100. +10 −10 t/25_CPANPLUS.t
  101. +24 −24 t/30_CPANPLUS-Internals-Selfupdate.t
  102. +34 −34 t/40_CPANPLUS-Internals-Report.t
  103. +57 −57 t/inc/conf.pl
View
2  ChangeLog
@@ -1,6 +1,6 @@
Changes for 0.9103 Sun Mar 20 00:38:05 2011
================================================
-* Fixed the logic not sending NA reports when
+* Fixed the logic not sending NA reports when
'perl' is expressed as a prereq
Changes for 0.9102 Mon Feb 28 11:35:43 2011
View
62 Makefile.PL
@@ -7,7 +7,7 @@ use 5.006001;
use strict;
use warnings;
-BEGIN {
+BEGIN {
### chdir to the makefile.pl dir
use FindBin;
chdir $FindBin::Bin;
@@ -24,7 +24,7 @@ BEGIN {
### there's issues with redhat 9.0's stock perl -- they applied some
### custom patches on their 5.8.0 and it breaks use constant a => sub {};
-if( $^O eq 'linux' and -e '/etc/redhat-release' and
+if( $^O eq 'linux' and -e '/etc/redhat-release' and
$] == '5.008' and (grep /Red Hat, Inc/, values %Config::Config)
) {
print qq(
@@ -34,7 +34,7 @@ You are using perl $] supplied by RedHat, who have applied custom
patches that break various perl modules, including this one.
You will have to migrate to a perl without these flaws. You could
-do this for example by building a perl installation by hand.
+do this for example by building a perl installation by hand.
You can obtain the sources from www.cpan.org.
We're sorry for the inconvenience.
@@ -48,9 +48,9 @@ We're sorry for the inconvenience.
### it spews warnings though, so grep those out
### also grep out the warnings we get from using Module::Loaded
-BEGIN {
+BEGIN {
$SIG{__WARN__} = sub {
- print STDERR "@_" if
+ print STDERR "@_" if
"@_" !~ /^CPANPLUS::inc/ and
"@_" !~ /Constant subroutine/;
};
@@ -79,25 +79,25 @@ my $Config = CPANPLUS::Configure->new;
unless( $RunSetup ) {
print qq[
### IMPORTANT! ######################################################
-
-
+
+
As of CPANPLUS 0.070, configuration during 'perl Makefile.PL'
is no longer required. A default config is now shipped that
should work out of the box on most machines, for priviliged
and unprivileged users.
-If you wish to configure CPANPLUS to your environment, you can
+If you wish to configure CPANPLUS to your environment, you can
either do that from the interactive shell after installation:
\$ cpanp
CPAN Terminal> s reconfigure
-
+
Or you can invoke this program as follows, to do it now:
- \$ $^X Makefile.PL --setup
+ \$ $^X Makefile.PL --setup
This also means that any config created by any CPANPLUS older
-than 0.070 will no longer work, and you are required to
+than 0.070 will no longer work, and you are required to
reconfigure. See the ChangeLog file for details.
We appologize for the inconvenience.
@@ -112,8 +112,8 @@ We appologize for the inconvenience.
);
$setup->init;
-}
-
+}
+
{ print loc("
### PLEASE NOTE ###################################################
@@ -122,34 +122,34 @@ out of it's extraction dir, by typing:
\$ perl bin/cpanp-boxed
-This may help you with bootstrap issues, or other situations
+This may help you with bootstrap issues, or other situations
where you need to use CPANPLUS but can not use a system installation.
-You can install all of CPANPLUS' dependencies like this, before
+You can install all of CPANPLUS' dependencies like this, before
installing CPANPLUS itself by running:
- \$ perl bin/cpanp-boxed -s selfupdate dependencies
+ \$ perl bin/cpanp-boxed -s selfupdate dependencies
All the modules bundled are found in the 'inc/bundle' directory. If
you, for whatever reason, wish to not install these from cpan, you
could include them into your environment as such (using tcsh):
\$ setenv PERL5LIB $FindBin::Bin/inc/bundle
-
+
###################################################################
-
- " );
+
+ " );
print "\n";
}
### toss out the old source files, they might be compiled
### in an incompatilbe format (rt #18121)
### use 'can', because it might be different backend now
-{ my $pat = File::Spec->catfile(
- $Config->get_conf('base'),
+{ my $pat = File::Spec->catfile(
+ $Config->get_conf('base'),
$Config->_get_source('stored') .'*'. STORABLE_EXT,
);
-
+
for my $file( glob($pat) ) {
1 while $file && unlink $file;
}
@@ -160,14 +160,14 @@ could include them into your environment as such (using tcsh):
my %prereq = ( %{ $su->list_core_dependencies( 'AS_HASH' ) },
map { ### might not need anything -- make sure we
### place an empty hash ref there
- %{ $su->modules_for_feature( $_, 'AS_HASH' ) || {} }
+ %{ $su->modules_for_feature( $_, 'AS_HASH' ) || {} }
} $su->list_enabled_features
);
my @scripts = _scripts();
my $extraclean .= join ' ', grep { /\d$/ } @scripts;
- ### restore the original @INC, so proper probing of missing
+ ### restore the original @INC, so proper probing of missing
### prereqs can be done
@INC = @ORIG_INC;
name ('CPANPLUS');
@@ -181,8 +181,8 @@ could include them into your environment as such (using tcsh):
#install_script ($_) for grep { $_ !~ /cpanp-boxed/ } glob('bin/*');
requires (%prereq);
makemaker_args ( test => { TESTS => $Tests } ) if $Tests;
- makemaker_args ( clean => { FILES =>
- '.cpanplus t/.*.output t/*.rpt ' .
+ makemaker_args ( clean => { FILES =>
+ '.cpanplus t/.*.output t/*.rpt ' .
't/dummy-cpanplus/* t/dummy-cpanplus/.cpanplus '.
't/dummy-localmirror/* ' . 't/dummy-perl/arch ' .
't/dummy-perl/bin/* ' . 't/dummy-perl/lib/* ' .
@@ -191,17 +191,17 @@ could include them into your environment as such (using tcsh):
} );
repository ('http://oss.dwim.org/cpanplus-devel');
- ### write the makefile
+ ### write the makefile
### this makes all prereqs rediscovered
{ use Module::Loaded;
for ( keys %prereq ) {
mark_as_unloaded( $_ ) if is_loaded( $_ );
- }
-
- ### silence warnings about redefines...
+ }
+
+ ### silence warnings about redefines...
### this will still warn about redefine of CONSTANTS subs...
no warnings; local $^W;
- &WriteAll( check_nmake => 1 );
+ &WriteAll( check_nmake => 1 );
}
}
View
14 README
@@ -32,21 +32,21 @@ out of it's extraction dir, by typing:
$ perl bin/cpanp-boxed
-This may help you with bootstrap issues, or other situations
+This may help you with bootstrap issues, or other situations
where you need to use CPANPLUS but can not use a system installation.
-You can install all of CPANPLUS' dependencies like this, before
+You can install all of CPANPLUS' dependencies like this, before
installing CPANPLUS itself by running:
- $ perl bin/cpanp-boxed -s selfupdate dependencies
+ $ perl bin/cpanp-boxed -s selfupdate dependencies
All the modules bundled are found in the 'inc/bundle' directory. If
you, for whatever reason, wish to not install these from cpan, you
could include them into your environment as such (using tcsh):
$ setenv PERL5LIB `pwd`/inc/bundle
-
-
+
+
###################################################################
###
### Notes for windows users
@@ -89,10 +89,10 @@ DBI package.
If you wish to report module test results as part of installation process,
please answer "Y" to the 'Report tests results? [y/N]:' question during
the interactive configuration. You can also type "s edit" in the CPANPLUS
-Default Shell to edit the config file manually, or just enter "s conf
+Default Shell to edit the config file manually, or just enter "s conf
cpantest 1" and "s save" to save the settings.
-Please consult the CPAN Tester's Website (http://testers.cpan.org/) for
+Please consult the CPAN Tester's Website (http://testers.cpan.org/) for
detailed information.
View
6 TODO
@@ -4,8 +4,8 @@
feasible to have EU::AI install prereqs. bundle them for now.
* compat API added to CPANPLUS, but we still have a bootstrap issue
without some of these prereqs, so keep bundling anyway
-
-
+
+
### todo code marks things that are present in 0.04x but not in 0.05x yet
### wishlist is new features we want to add
@@ -49,7 +49,7 @@
* Periodic host checking (see if they're still good mirrors)
* Make error stack reports available on a per-module (dist) basis,
as discussed in '[Cpanplus-devel] error stack reporting a bit overzealous'
-* Test reports should only contain texts of the module they pertain to,
+* Test reports should only contain texts of the module they pertain to,
rather than all modules in the current loop (like i 1..10 from the shell)
also reported as ticket [#11404]
View
210 bin/cpan2dist
@@ -40,7 +40,7 @@ GetOptions( $opts,
'default-ignorelist!', 'edit-metafile!',
'install!'
);
-
+
die usage() if exists $opts->{'help'};
### parse options
@@ -49,8 +49,8 @@ my $keep = $opts->{'keepsource'} ? 1 : 0;
my $prereqbuild = exists $opts->{'buildprereq'}
? $opts->{'buildprereq'}
: 0;
-my $timeout = exists $opts->{'timeout'}
- ? $opts->{'timeout'}
+my $timeout = exists $opts->{'timeout'}
+ ? $opts->{'timeout'}
: 300;
### use default answers?
@@ -64,7 +64,7 @@ my $format;
$conf->set_conf( dist_type => $format );
### is this a valid format??
- die loc("Invalid format: " . ($format || "[NONE]") ) . usage()
+ die loc("Invalid format: " . ($format || "[NONE]") ) . usage()
unless $formats{$format};
### any options to fix config entries
@@ -72,14 +72,14 @@ my $format;
while( my($key,$val) = each %$set_conf ) {
$conf->set_conf( $key => $val );
}
- }
+ }
### any options to fix program entries
{ my $set_prog = $opts->{'set-program'} || {};
while( my($key,$val) = each %$set_prog ) {
$conf->set_program( $key => $val );
}
- }
+ }
### any other options passed
{ my %map = ( verbose => 'verbose',
@@ -87,54 +87,54 @@ my $format;
skiptest => 'skiptest',
makefile => 'prefer_makefile'
);
-
- ### set config options from arguments
+
+ ### set config options from arguments
while (my($key,$val) = each %map) {
- my $bool = exists $opts->{$key}
- ? $opts->{$key}
+ my $bool = exists $opts->{$key}
+ ? $opts->{$key}
: $conf->get_conf($val);
$conf->set_conf( $val => $bool );
- }
- }
+ }
+ }
}
my @modules = @ARGV;
if( exists $opts->{'modulelist'} ) {
- push @modules, map { parse_file( $_ ) } @{ $opts->{'modulelist'} };
-}
+ push @modules, map { parse_file( $_ ) } @{ $opts->{'modulelist'} };
+}
die usage() unless @modules;
### set up munge callback if requested
{ if( $opts->{'edit-metafile'} ) {
my $editor = $conf->get_program('editor');
-
+
if( $editor ) {
-
+
### register install callback ###
$cb->_register_callback(
name => 'munge_dist_metafile',
code => sub {
my $self = shift;
my $text = shift or return;
-
+
my($fh,$file) = tempfile( UNLINK => 1 );
-
+
unless( print $fh $text ) {
warn "Could not print metafile information: $!";
return;
}
-
+
close $fh;
-
+
system( $editor => $file );
-
+
my $cont = $cb->_get_file_contents( file => $file );
-
+
return $cont;
},
);
-
+
} else {
warn "No editor configured. Can not edit metafiles!\n";
}
@@ -144,13 +144,13 @@ die usage() unless @modules;
my $fh;
LOGFILE: {
if( my $file = $opts->{logfile} ) {
- open $fh, ">$file" or (
+ open $fh, ">$file" or (
warn loc("Could not open '%1' for writing: %2", $file,$!),
last LOGFILE
- );
-
+ );
+
warn "Logging to '$file'\n";
-
+
*STDERR = $fh;
*STDOUT = $fh;
}
@@ -159,7 +159,7 @@ LOGFILE: {
### reload indices if so desired
$cb->reload_indices() if $opts->{'flushcache'};
-{ my @ban = exists $opts->{'ban'}
+{ my @ban = exists $opts->{'ban'}
? map { qr/$_/ } @{ $opts->{'ban'} }
: ();
@@ -167,54 +167,54 @@ $cb->reload_indices() if $opts->{'flushcache'};
if( exists $opts->{'banlist'} ) {
push @ban, map { parse_file( $_, 1 ) } @{ $opts->{'banlist'} };
}
-
+
push @ban, map { s/\s+//; $_ }
map { [split /\s*#\s*/]->[0] }
grep { /#/ }
- map { split /\n/ } _default_ban_list()
+ map { split /\n/ } _default_ban_list()
if $opts->{'default-banlist'};
-
- ### use our prereq install callback
+
+ ### use our prereq install callback
$conf->set_conf( prereqs => PREREQ_ASK );
-
+
### register install callback ###
$cb->_register_callback(
name => 'install_prerequisite',
code => \&__ask_about_install,
);
-
+
### check for ban patterns when handling prereqs
sub __ask_about_install {
-
+
my $mod = shift or return;
my $prereq = shift or return;
-
-
+
+
### die with an error object, so we can verify that
### the die came from this location, and that it's an
### 'acceptable' death
my $pat = ban_me( $prereq );
die bless sub { loc("Module '%1' requires '%2' to be installed " .
"but found in your ban list (%3) -- skipping",
- $mod->module, $prereq->module, $pat )
+ $mod->module, $prereq->module, $pat )
}, PREREQ_SKIP_CLASS if $pat;
return 1;
- }
-
+ }
+
### should we skip this module?
sub ban_me {
my $mod = shift;
-
+
for my $pat ( @ban ) {
return $pat if $mod->module =~ /$pat/i;
}
return;
}
-}
+}
### patterns to strip from prereq lists
-{ my @ignore = exists $opts->{'ignore'}
+{ my @ignore = exists $opts->{'ignore'}
? map { qr/$_/ } @{ $opts->{'ignore'} }
: ();
@@ -225,10 +225,10 @@ $cb->reload_indices() if $opts->{'flushcache'};
push @ignore, map { s/\s+//; $_ }
map { [split /\s*#\s*/]->[0] }
grep { /#/ }
- map { split /\n/ } _default_ignore_list()
+ map { split /\n/ } _default_ignore_list()
if $opts->{'default-ignorelist'};
-
+
### register install callback ###
$cb->_register_callback(
name => 'filter_prereqs',
@@ -238,7 +238,7 @@ $cb->reload_indices() if $opts->{'flushcache'};
sub __filter_prereqs {
my $cb = shift;
my $href = shift;
-
+
for my $name ( keys %$href ) {
my $obj = $cb->parse_module( module => $name ) or (
warn "Cannot make a module object out of ".
@@ -249,44 +249,44 @@ $cb->reload_indices() if $opts->{'flushcache'};
warn loc("'%1' found in your ignore list (%2) ".
"-- filtering it out\n", $name, $pat);
- delete $href->{ $name };
+ delete $href->{ $name };
}
}
return $href;
}
-
+
### should we skip this module?
sub ignore_me {
my $mod = shift;
-
+
for my $pat ( @ignore ) {
return $pat if $mod->module =~ /$pat/i;
return $pat if $mod->package_name =~ /$pat/i;
}
return;
- }
-}
+ }
+}
my %done;
for my $name (@modules) {
my $obj;
-
+
### is it a tarball? then we get it locally and transform it
### and its dependencies into .debs
if( $tarball ) {
### make sure we use an absolute path, so chdirs() dont
### mess things up
- $name = File::Spec->rel2abs( $name );
+ $name = File::Spec->rel2abs( $name );
### ENOTARBALL?
unless( -e $name ) {
warn loc("Archive '$name' does not exist");
next;
}
-
+
$obj = CPANPLUS::Module::Fake->new(
module => basename($name),
path => dirname($name),
@@ -303,7 +303,7 @@ for my $name (@modules) {
### set the location of the tarball
$obj->status->fetch($name);
- ### plain old cpan module?
+ ### plain old cpan module?
} else {
### find the corresponding module object ###
@@ -318,26 +318,26 @@ for my $name (@modules) {
warn loc("'%1' found in your ban list (%2) -- skipping\n",
$obj->module, $pat );
next;
- }
-
- ### or just ignored it?
+ }
+
+ ### or just ignored it?
if( my $pat = ignore_me( $obj ) ) {
warn loc("'%1' found in your ignore list (%2) -- skipping\n",
$obj->module, $pat );
next;
- }
-
+ }
+
my $target = $opts->{'install'} ? 'install' : 'create';
- my $dist = eval {
+ my $dist = eval {
local $SIG{ALRM} = sub { die bless {}, ALARM_CLASS }
if $timeout;
-
+
alarm $timeout || 0;
my $dist_opts = $opts->{'dist-opts'} || {};
- my $rv = $obj->install(
+ my $rv = $obj->install(
prereq_target => $target,
target => $target,
keep_source => $keep,
@@ -346,32 +346,32 @@ for my $name (@modules) {
### any passed arbitrary options
%$dist_opts,
);
-
- alarm 0;
+
+ alarm 0;
$rv;
- };
-
+ };
+
### set here again, in case the install dies
alarm 0;
### install failed due to a 'die' in our prereq skipper?
if( $@ and ref $@ and $@->isa( PREREQ_SKIP_CLASS ) ) {
- warn loc("Dist creation of '%1' skipped: '%2'",
+ warn loc("Dist creation of '%1' skipped: '%2'",
$obj->module, $@->() );
next;
} elsif ( $@ and ref $@ and $@->isa( ALARM_CLASS ) ) {
warn loc("\nDist creation of '%1' skipped, build time exceeded: ".
"%2 seconds\n", $obj->module, $timeout );
- next;
+ next;
### died for some other reason? just report and skip
} elsif ( $@ ) {
warn loc("Dist creation of '%1' failed: '%2'",
$obj->module, $@ );
next;
- }
+ }
### we didn't get a dist object back?
unless ($dist and $obj->status->dist) {
@@ -398,7 +398,7 @@ sub parse_file {
s/^(\S+).*/$1/; # skip extra info
push @rv, $qr ? qr/$_/ : $_; # add pattern to the list
}
-
+
return @rv;
}
@@ -430,11 +430,11 @@ sub usage {
Usage: cpan2dist [--format FMT] [OPTS] Mod::Name [Mod::Name, ...]
cpan2dist [--format FMT] [OPTS] --modulelist /tmp/mods.list
- cpan2dist [--format FMT] [OPTS] --archive /tmp/dist [/tmp/dist2]
+ cpan2dist [--format FMT] [OPTS] --archive /tmp/dist [/tmp/dist2]
Will create a distribution of type FMT of the modules
specified on the command line, and all their prerequisites.
-
+
Can also create a distribution of type FMT from a local
archive and all of its prerequisites.
@@ -446,21 +446,21 @@ $formats
You can install more formats from CPAN!
\n];
-
+
$usage .= << '=cut';
=pod
-
+
Options:
### take no argument:
--help Show this help message
--install Install this package (and any prerequisites you built)
- after building it.
+ after building it.
--skiptest Skip tests. Can be negated using --noskiptest
--force Force operation. Can be negated using --noforce
--verbose Be verbose. Can be negated using --noverbose
--keepsource Keep sources after building distribution. Can be
- negated by --nokeepsource. May not be supported
+ negated by --nokeepsource. May not be supported
by all formats
--makefile Prefer Makefile.PL over Build.PL. Can be negated
using --nomakefile. Defaults to your config setting
@@ -484,7 +484,7 @@ Options:
Are appended to the ban list built up by --ban
May be given multiple times.
--ignore Patterns of modules to exclude from prereq list. Useful
- for when a prereq listed by a CPAN module is resolved
+ for when a prereq listed by a CPAN module is resolved
in another way than from its corresponding CPAN package
(Match is done on both module name, and package name of
the package the module is in, case-insensitive)
@@ -497,71 +497,71 @@ Options:
--logfile File to log all output to. By default, all output goes
to the console.
--timeout The allowed time for buliding a distribution before
- aborting. This is useful to terminate any build that
- hang or happen to be interactive despite being told not
- to be. Defaults to 300 seconds. To turn off, you can
+ aborting. This is useful to terminate any build that
+ hang or happen to be interactive despite being told not
+ to be. Defaults to 300 seconds. To turn off, you can
set it to 0.
--set-config Change any options as specified in your config for this
- invocation only. See CPANPLUS::Config for a list of
+ invocation only. See CPANPLUS::Config for a list of
supported options.
--set-program Change any programs as specified in your config for this
- invocation only. See CPANPLUS::Config for a list of
+ invocation only. See CPANPLUS::Config for a list of
supported programs.
--dist-opts Arbitrary options passed along to the chosen installer
format's prepare()/create() routine. Please see the
- documentation of the installer of your choice for
+ documentation of the installer of your choice for
options it accepts.
### builtin lists
--default-banlist Use our builtin banlist. Works just like --ban
and --banlist, but with pre-set lists. See the
"Builtin Lists" section for details.
- --default-ignorelist Use our builtin ignorelist. Works just like
- --ignore and --ignorelist but with pre-set lists.
+ --default-ignorelist Use our builtin ignorelist. Works just like
+ --ignore and --ignorelist but with pre-set lists.
See the "Builtin Lists" section for details.
Examples:
- ### build a debian package of DBI and its prerequisites,
+ ### build a debian package of DBI and its prerequisites,
### don't bother running tests
cpan2dist --format CPANPLUS::Dist::Deb --buildprereq --skiptest DBI
-
+
### build a debian package of DBI and its prerequisites and install them
cpan2dist --format CPANPLUS::Dist::Deb --buildprereq --install DBI
-
- ### Build a package, whose format is determined by your config, of
+
+ ### Build a package, whose format is determined by your config, of
### the local tarball, reloading cpanplus' indices first and using
### the tarballs Makefile.PL if it has one.
cpan2dist --makefile --flushcache --archive /path/to/Cwd-1.0.tgz
-
+
### build a package from Net::FTP, but dont build any packages or
- ### dependencies whose name match 'Foo', 'Bar' or any of the
+ ### dependencies whose name match 'Foo', 'Bar' or any of the
### patterns mentioned in /tmp/ban
cpan2dist --ban Foo --ban Bar --banlist /tmp/ban Net::FTP
-
+
### build a package from Net::FTP, but ignore its listed dependency
### on IO::Socket, as it's shipped per default with the OS we're on
cpan2dist --ignore IO::Socket Net::FTP
-
+
### building all modules listed, plus their prerequisites
- cpan2dist --ignorelist /tmp/modules.ignore --banlist /tmp/modules.ban
- --modulelist /tmp/modules.list --buildprereq --flushcache
+ cpan2dist --ignorelist /tmp/modules.ignore --banlist /tmp/modules.ban
+ --modulelist /tmp/modules.list --buildprereq --flushcache
--makefile --defaults
-
+
### pass arbitrary options to the format's prepare()/create() routine
cpan2dist --dist-opts deb_version=3 --dist-opts prefix=corp
=cut
-
+
$usage .= qq[
Builtin Lists:
Ignore list:] . _default_ignore_list() . qq[
Ban list:] . _default_ban_list();
-
+
### strip the pod directives
$usage =~ s/=pod\n//g;
-
+
return $usage;
}
@@ -581,7 +581,7 @@ if you like, or supply your own if need be.
=head2 Built-In Ignore List
-=pod
+=pod
You can use this list of regexes to ignore modules matching
to be listed as prerequisites of a package. Particularly useful
@@ -601,9 +601,9 @@ sub _default_ignore_list {
^Cwd$ # Provided with core anyway
^File::Spec # Provided with core anyway
^Config$ # Perl's own config, not shipped separately
- ^ExtUtils::MakeMaker$ # Shipped with perl, recent versions
+ ^ExtUtils::MakeMaker$ # Shipped with perl, recent versions
# have bug 14721 (see rt.cpan.org)
- ^ExtUtils::Install$ # Part of of EU::MM, same reason
+ ^ExtUtils::Install$ # Part of of EU::MM, same reason
=cut
@@ -657,10 +657,10 @@ This module by Jos Boumans E<lt>kane@cpan.orgE<gt>.
=head1 COPYRIGHT
-The CPAN++ interface (of which this module is a part of) is copyright (c)
+The CPAN++ interface (of which this module is a part of) is copyright (c)
2001 - 2007, Jos Boumans E<lt>kane@cpan.orgE<gt>. All rights reserved.
-This library is free software; you may redistribute and/or modify it
+This library is free software; you may redistribute and/or modify it
under the same terms as Perl itself.
=cut
View
32 bin/cpanp-boxed
@@ -29,15 +29,15 @@ BEGIN {
@RUN_TIME_INC = ($PRIV_LIB, @INC);
unshift @INC, $LIB_DIR, $BUNDLE_DIR;
-
+
### set it in the environment too, for when we shell out
### (like at 'perl makefile.pl' time.
- $ENV{'PERL5LIB'} = join $Config{'path_sep'}, grep { defined }
+ $ENV{'PERL5LIB'} = join $Config{'path_sep'}, grep { defined }
$PRIV_LIB, # to find the boxed config
- #$LIB_DIR, # the CPANPLUS libs
- $ENV{'PERL5LIB'}; # original PERL5LIB
+ #$LIB_DIR, # the CPANPLUS libs
+ $ENV{'PERL5LIB'}; # original PERL5LIB
-}
+}
use FindBin;
use File::Find qw[find];
@@ -56,20 +56,20 @@ use CPANPLUS::Internals::Utils;
find( sub { my $file = $File::Find::name;
return unless -e $file && -f _ && -s _;
-
+
return if $file =~ /\._/; # osx temp files
-
+
### strip base dir. Might not end in / (or local
### dir delimiter), so remove that if needed too
$file =~ s/^$base_re(\W)?//;
### file already loaded.
return if $INC{$file};
-
+
### construct pm name and strip suffix
- my $unixfile = File::Spec::Unix->catfile(
+ my $unixfile = File::Spec::Unix->catfile(
File::Spec->splitdir( $file )
- );
+ );
my $pm = join '::', File::Spec->splitdir( $file );
$pm =~ s/\.pm$//i or return; # not a .pm file
@@ -83,7 +83,7 @@ use CPANPLUS::Internals::Utils;
### file fails or some such.. so remove it from our %INC!
if( $@ ) {
push @failures, $unixfile;
-
+
### dont enable warnings -- some modules
### are OS specific. Uncomment only for debug
### reasons
@@ -91,8 +91,8 @@ use CPANPLUS::Internals::Utils;
}
- }, $dir );
- }
+ }, $dir );
+ }
### delete AFTER we've loaded everything!
delete $INC{$_} for @failures;
@@ -108,12 +108,12 @@ my $Config = CONFIG_BOXED;
my $Util = 'CPANPLUS::Internals::Utils';
my $ConfigFile = $ConfObj->_config_pm_to_file( $Config => $PRIV_LIB );
-### setup the environment if needed
+### setup the environment if needed
{ ### no base dir even, set it up
unless( IS_DIR->( $BASE ) ) {
$Util->_mkdir( dir => $BASE ) or die CPANPLUS::Error->stack_as_string;
}
-
+
### no config file exists yet, so we create it
unless( -e $ConfigFile ) {
### alter what needs changing
@@ -139,7 +139,7 @@ You can bootstrap your CPANPLUS by running:
s selfupdate enabled_features
===
- \n
+ \n
];
### set the @INC to a runtime version, so our bundled modules
View
42 dev-bin/copy-inc-bingos.pl
@@ -5,7 +5,7 @@
$|++;
-my $Prefix = '../'; # updir from cpanplus/devel
+my $Prefix = '../'; # updir from cpanplus/devel
my $Libdir = 'lib/';
my $Cwd = cwd();
my $Target = $Cwd . '/inc/bundle'; # Target dir to copy to
@@ -75,9 +75,9 @@
JSON::PP
CPAN::Meta::YAML
];
-
+
# IPC::Run no more!
-
+
UPDATE: for my $module ( @Modules ) {
my $obj = $CB->module_tree( $module );
@@ -91,15 +91,15 @@
if( $obj->is_uptodate ) {
print "already uptodate\n";
-
+
next UPDATE;
}
}
$obj->fetch( fetchdir => '/tmp' ) or die "Could not fetch";
- my $dir = $obj->extract( extractdir => '/tmp' )
+ my $dir = $obj->extract( extractdir => '/tmp' )
or die "Could not extract";
-
+
### either they have the lib structure
if( -d $dir . "/lib" ) {
chdir $dir . "/lib" or die "Could not chdir: $!";
@@ -112,47 +112,47 @@
system("cp ../vperl/vpp.pm $Target/version/")
and die "Could not copy special files for $module";
}
-
+
print "done\n";
next UPDATE;
- }
+ }
### ok, so no libdir... let's see if they have just the pm in
### the topdir
chdir $dir or die "Could not chdir to $dir: $!";
-
+
my @parts = split '::', $module;
my $file = pop(@parts) . '.pm';
if ( -e $file ) {
my $tdir = $Target . '/' . join '/', @parts;
mkpath($tdir) unless -d $tdir;
-
+
my $to = join '/', $tdir, $file;
system("cp $file $to") and die "Could not copy $file to $to: $!\n";
-
+
print "done\n";
next UPDATE;
}
-
+
die "Dont know how to copy $module from $dir\n";
-
- }
-}
-
-#
+ }
+}
+
+
+#
# ### set all the versions to -1
# if(0) {
# for my $file ( map { chomp; $_ } `find $Target -type f` ) {
# system( "p4 edit $file" );
-#
+#
# my $code = q[s/(\$|:)VERSION\s*=.+$/${1}VERSION = "-1";/];
-#
+#
# my $cmd = qq[$^X -pi -e'$code'];
# print "Running [$cmd $file]\n";
-#
+#
# system( "$cmd $file" );
-# }
+# }
# }
### revert all that wasn't touched
View
50 dev-bin/copy-inc.pl
@@ -5,7 +5,7 @@
$|++;
-my $Prefix = '../'; # updir from cpanplus/devel
+my $Prefix = '../'; # updir from cpanplus/devel
my $Libdir = 'lib/';
my $Cwd = cwd();
my $Target = $Cwd . '/inc/bundle'; # Target dir to copy to
@@ -14,7 +14,7 @@
$CB->configure_object->set_conf( verbose => 0 );
-### from p4
+### from p4
{ my @Copy = qw[
archive-extract/
archive-tar-new/
@@ -33,7 +33,7 @@
for my $entry (@Copy) {
my $dir = $Prefix . $entry . $Libdir;
-
+
print "Copying files from $entry...";
system("cp -R $dir $Target");
print "done\n";
@@ -42,8 +42,8 @@
-### from installations
-unless( $MineOnly ) {
+### from installations
+unless( $MineOnly ) {
my @Modules = qw[
File::Spec
IO::String
@@ -54,9 +54,9 @@
version
Parse::CPAN::Meta
];
-
+
# IPC::Run no more!
-
+
UPDATE: for my $module ( @Modules ) {
my $obj = $CB->module_tree( $module );
@@ -70,15 +70,15 @@
if( $obj->is_uptodate ) {
print "already uptodate\n";
-
+
next UPDATE;
}
}
$obj->fetch( fetchdir => '/tmp' ) or die "Could not fetch";
- my $dir = $obj->extract( extractdir => '/tmp' )
+ my $dir = $obj->extract( extractdir => '/tmp' )
or die "Could not extract";
-
+
### either they have the lib structure
if( -d $dir . "/lib" ) {
chdir $dir . "/lib" or die "Could not chdir: $!";
@@ -91,47 +91,47 @@
system("cp ../vperl/vpp.pm $Target/version/")
and die "Could not copy special files for $module";
}
-
+
print "done\n";
next UPDATE;
- }
+ }
### ok, so no libdir... let's see if they have just the pm in
### the topdir
chdir $dir or die "Could not chdir to $dir: $!";
-
+
my @parts = split '::', $module;
my $file = pop(@parts) . '.pm';
if ( -e $file ) {
my $tdir = $Target . '/' . join '/', @parts;
mkpath($tdir) unless -d $tdir;
-
+
my $to = join '/', $tdir, $file;
system("cp $file $to") and die "Could not copy $file to $to: $!\n";
-
+
print "done\n";
next UPDATE;
}
-
+
die "Dont know how to copy $module from $dir\n";
-
- }
-}
-
-#
+ }
+}
+
+
+#
# ### set all the versions to -1
# if(0) {
# for my $file ( map { chomp; $_ } `find $Target -type f` ) {
# system( "p4 edit $file" );
-#
+#
# my $code = q[s/(\$|:)VERSION\s*=.+$/${1}VERSION = "-1";/];
-#
+#
# my $cmd = qq[$^X -pi -e'$code'];
# print "Running [$cmd $file]\n";
-#
+#
# system( "$cmd $file" );
-# }
+# }
# }
### revert all that wasn't touched
View
2  dev-bin/sandbox-test.pl
@@ -52,7 +52,7 @@
for my $entry (@Copy) {
my $dir = $Prefix . $entry . $Libdir;
-
+
system("cp -R $dir $Target");
}
View
4 inc/Module/Install/Fetch.pm
@@ -13,13 +13,13 @@ BEGIN {
sub get_file {
my ($self, %args) = @_;
- my ($scheme, $host, $path, $file) =
+ my ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
$args{url} = $args{ftp_url}
or (warn("LWP support unavailable!\n"), return);
- ($scheme, $host, $path, $file) =
+ ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
}
View
6 inc/Module/Install/Makefile.pm
@@ -64,7 +64,7 @@ sub clean_files {
my $self = shift;
my $clean = $self->makemaker_args->{clean} ||= {};
%$clean = (
- %$clean,
+ %$clean,
FILES => join(' ', grep length, $clean->{FILES}, @_),
);
}
@@ -73,7 +73,7 @@ sub realclean_files {
my $self = shift;
my $realclean = $self->makemaker_args->{realclean} ||= {};
%$realclean = (
- %$realclean,
+ %$realclean,
FILES => join(' ', grep length, $realclean->{FILES}, @_),
);
}
@@ -155,7 +155,7 @@ sub fix_up_makefile {
my $top_class = ref($self->_top) || '';
my $top_version = $self->_top->VERSION || '';
- my $preamble = $self->preamble
+ my $preamble = $self->preamble
? "# Preamble by $top_class $top_version\n"
. $self->preamble
: '';
View
2  inc/Module/Install/Metadata.pm
@@ -272,7 +272,7 @@ sub author_from {
my $author = $1 || $2;
$author =~ s{E<lt>}{<}g;
$author =~ s{E<gt>}{>}g;
- $self->author($author);
+ $self->author($author);
}
else {
warn "Cannot determine author info from $file\n";
View
2  inc/Module/Install/Win32.pm
@@ -16,7 +16,7 @@ sub check_nmake {
my $self = shift;
$self->load('can_run');
$self->load('get_file');
-
+
require Config;
return unless (
$^O eq 'MSWin32' and
View
232 inc/bundle/Archive/Extract.pm
@@ -26,7 +26,7 @@ use constant ON_WIN32 => $^O eq 'MSWin32' ? 1 : 0;
### we can't use this extraction method, because of missing
### modules/binaries:
-use constant METHOD_NA => [];
+use constant METHOD_NA => [];
### If these are changed, update @TYPES and the new() POD
use constant TGZ => 'tgz';
@@ -40,7 +40,7 @@ use constant LZMA => 'lzma';
use constant XZ => 'xz';
use constant TXZ => 'txz';
-use vars qw[$VERSION $PREFER_BIN $PROGRAMS $WARN $DEBUG
+use vars qw[$VERSION $PREFER_BIN $PROGRAMS $WARN $DEBUG
$_ALLOW_BIN $_ALLOW_PURE_PERL $_ALLOW_TAR_ITER
];
@@ -53,7 +53,7 @@ $_ALLOW_BIN = 1; # allow binary extractors
$_ALLOW_TAR_ITER = 1; # try to use Archive::Tar->iter if available
# same as all constants
-my @Types = ( TGZ, TAR, GZ, ZIP, BZ2, TBZ, Z, LZMA, XZ, TXZ );
+my @Types = ( TGZ, TAR, GZ, ZIP, BZ2, TBZ, Z, LZMA, XZ, TXZ );
local $Params::Check::VERBOSE = $Params::Check::VERBOSE = 1;
@@ -113,9 +113,9 @@ Archive::Extract - A generic archive extracting mechanism
Archive::Extract is a generic archive extraction mechanism.
It allows you to extract any archive file of the type .tar, .tar.gz,
-.gz, .Z, tar.bz2, .tbz, .bz2, .zip, .xz,, .txz, .tar.xz or .lzma
-without having to worry how it
-does so, or use different interfaces for each type by using either
+.gz, .Z, tar.bz2, .tbz, .bz2, .zip, .xz,, .txz, .tar.xz or .lzma
+without having to worry how it
+does so, or use different interfaces for each type by using either
perl modules, or commandline tools on your system.
See the C<HOW IT WORKS> section further down for details.
@@ -160,7 +160,7 @@ my $Mapping = { # binary program # pure perl module
};
### build accessors ###
- for my $method( keys %$tmpl,
+ for my $method( keys %$tmpl,
qw[_extractor _gunzip_to files extract_path],
) {
no strict 'refs';
@@ -244,7 +244,7 @@ Returns a C<Archive::Extract> object on success, or false on failure.
sub new {
my $class = shift;
my %hash = @_;
-
+
### see above why we use subs here and generate the template;
### it's basically to not re-use arrayrefs
my %utmpl = map { $_ => $tmpl->{$_}->() } keys %$tmpl;
@@ -273,7 +273,7 @@ Returns a C<Archive::Extract> object on success, or false on failure.
bless $parsed, $class;
- ### don't know what type of file it is
+ ### don't know what type of file it is
### XXX this *has* to be an object call, not a package call
return $parsed->_error(loc("Cannot determine file type for '%1'",
$parsed->{archive} )) unless $parsed->{type};
@@ -287,11 +287,11 @@ Extracts the archive represented by the C<Archive::Extract> object to
the path of your choice as specified by the C<to> argument. Defaults to
C<cwd()>.
-Since C<.gz> files never hold a directory, but only a single file; if
-the C<to> argument is an existing directory, the file is extracted
-there, with its C<.gz> suffix stripped.
-If the C<to> argument is not an existing directory, the C<to> argument
-is understood to be a filename, if the archive type is C<gz>.
+Since C<.gz> files never hold a directory, but only a single file; if
+the C<to> argument is an existing directory, the file is extracted
+there, with its C<.gz> suffix stripped.
+If the C<to> argument is not an existing directory, the C<to> argument
+is understood to be a filename, if the archive type is C<gz>.
In the case that you did not specify a C<to> argument, the output
file will be the name of the archive file, stripped from its C<.gz>
suffix, in the current working directory.
@@ -340,7 +340,7 @@ sub extract {
check( $tmpl, \%hash ) or return;
- ### so 'to' could be a file or a dir, depending on whether it's a .gz
+ ### so 'to' could be a file or a dir, depending on whether it's a .gz
### file, or basically anything else.
### so, check that, then act accordingly.
### set an accessor specifically so _gunzip can know what file to extract
@@ -348,12 +348,12 @@ sub extract {
my $dir;
{ ### a foo.gz file
if( $self->is_gz or $self->is_bz2 or $self->is_Z or $self->is_lzma or $self->is_xz ) {
-
+
my $cp = $self->archive; $cp =~ s/\.(?:gz|bz2?|Z|lzma|xz)$//i;
-
+
### to is a dir?
if ( -d $to ) {
- $dir = $to;
+ $dir = $to;
$self->_gunzip_to( basename($cp) );
### then it's a filename
@@ -394,7 +394,7 @@ sub extract {
### ../lib/Archive/Extract.pm line 742. (rt #19815)
$self->files( [] );
- ### find out the dispatch methods needed for this type of
+ ### find out the dispatch methods needed for this type of
### archive. Do a $self->is_XXX to figure out the type, then
### get the hashref with bin + pure perl dispatchers.
my ($map) = map { $Mapping->{$_} } grep { $self->$_ } keys %$Mapping;
@@ -403,30 +403,30 @@ sub extract {
my @methods;
push @methods, $map->{'pp'} if $_ALLOW_PURE_PERL;
push @methods, $map->{'bin'} if $_ALLOW_BIN;
-
+
### reverse it if we prefer bin extractors
@methods = reverse @methods if $PREFER_BIN;
my($na, $fail);
for my $method (@methods) {
$self->debug( "# Extracting with ->$method\n" );
-
+
my $rv = $self->$method;
-
+
### a positive extraction
if( $rv and $rv ne METHOD_NA ) {
$self->debug( "# Extraction succeeded\n" );
$self->_extractor($method);
last;
-
+
### method is not available
- } elsif ( $rv and $rv eq METHOD_NA ) {
+ } elsif ( $rv and $rv eq METHOD_NA ) {
$self->debug( "# Extraction method not available\n" );
- $na++;
+ $na++;
} else {
$self->debug( "# Extraction method failed\n" );
$fail++;
- }
+ }
}
### warn something went wrong if we didn't get an extractor
@@ -434,10 +434,10 @@ sub extract {
my $diag = $fail ? loc("Extract failed due to errors") :
$na ? loc("Extract failed; no extractors available") :
'';
-
+
$self->_error($diag);
$ok = 0;
- }
+ }
}
### and chdir back ###
@@ -566,7 +566,7 @@ sub bin_gzip { return $PROGRAMS->{'gzip'} if $PROGRAMS->{'gzip'} }
sub bin_unzip { return $PROGRAMS->{'unzip'} if $PROGRAMS->{'unzip'} }
sub bin_tar { return $PROGRAMS->{'tar'} if $PROGRAMS->{'tar'} }
sub bin_bunzip2 { return $PROGRAMS->{'bunzip2'} if $PROGRAMS->{'bunzip2'} }
-sub bin_uncompress { return $PROGRAMS->{'uncompress'}
+sub bin_uncompress { return $PROGRAMS->{'uncompress'}
if $PROGRAMS->{'uncompress'} }
sub bin_unlzma { return $PROGRAMS->{'unlzma'} if $PROGRAMS->{'unlzma'} }
sub bin_unxz { return $PROGRAMS->{'unxz'} if $PROGRAMS->{'unxz'} }
@@ -586,7 +586,7 @@ sub have_old_bunzip2 {
### no bunzip2? no old bunzip2 either :)
return unless $self->bin_bunzip2;
- ### if we can't run this, we can't be sure if it's too old or not
+ ### if we can't run this, we can't be sure if it's too old or not
### XXX stupid stupid stupid bunzip2 doesn't understand --version
### is not a request to extract data:
### $ bunzip2 --version
@@ -597,7 +597,7 @@ sub have_old_bunzip2 {
### $ echo $?
### 1
### HATEFUL!
-
+
### double hateful: bunzip2 --version also hangs if input is a pipe
### See #32370: Archive::Extract will hang if stdin is a pipe [+PATCH]
### So, we have to provide *another* argument which is a fake filename,
@@ -605,7 +605,7 @@ sub have_old_bunzip2 {
### *sigh*
### Even if the file exists, it won't clobber or change it.
my $buffer;
- scalar run(
+ scalar run(
command => [$self->bin_bunzip2, '--version', 'NoSuchFile'],
verbose => 0,
buffer => \$buffer
@@ -613,7 +613,7 @@ sub have_old_bunzip2 {
### no output
return unless $buffer;
-
+
my ($version) = $buffer =~ /version \s+ (\d+)/ix;
return 1 if $version < 1;
@@ -636,54 +636,54 @@ sub have_old_bunzip2 {
### if this is gnu tar we are running, we need to use --force-local
push @ExtraTarFlags, '--force-local' if `$cmd --version` =~ /gnu tar/i;
- }
+ }
### use /bin/tar to extract ###
sub _untar_bin {
my $self = shift;
-
+
### check for /bin/tar ###
### check for /bin/gzip if we need it ###
### if any of the binaries are not available, return NA
- { my $diag = not $self->bin_tar ?
+ { my $diag = not $self->bin_tar ?
loc("No '%1' program found", '/bin/tar') :
- $self->is_tgz && !$self->bin_gzip ?
+ $self->is_tgz && !$self->bin_gzip ?
loc("No '%1' program found", '/bin/gzip') :
$self->is_tbz && !$self->bin_bunzip2 ?
loc("No '%1' program found", '/bin/bunzip2') :
$self->is_txz && !$self->bin_unxz ?
loc("No '%1' program found", '/bin/unxz') :
'';
-
+
if( $diag ) {
$self->_error( $diag );
return METHOD_NA;
}
- }
-
+ }
+
### XXX figure out how to make IPC::Run do this in one call --
### currently i don't know how to get output of a command after a pipe
### trapped in a scalar. Mailed barries about this 5th of june 2004.
-
+
### see what command we should run, based on whether
### it's a .tgz or .tar
-
+
### XXX solaris tar and bsdtar are having different outputs
### depending whether you run with -x or -t
### compensate for this insanity by running -t first, then -x
- { my $cmd =
- $self->is_tgz ? [$self->bin_gzip, '-cdf', $self->archive, '|',
+ { my $cmd =
+ $self->is_tgz ? [$self->bin_gzip, '-cdf', $self->archive, '|',
$self->bin_tar, '-tf', '-'] :
- $self->is_tbz ? [$self->bin_bunzip2, '-cd', $self->archive, '|',
+ $self->is_tbz ? [$self->bin_bunzip2, '-cd', $self->archive, '|',
$self->bin_tar, '-tf', '-'] :
- $self->is_txz ? [$self->bin_unxz, '-cd', $self->archive, '|',
+ $self->is_txz ? [$self->bin_unxz, '-cd', $self->archive, '|',
$self->bin_tar, '-tf', '-'] :
[$self->bin_tar, @ExtraTarFlags, '-tf', $self->archive];
-
- ### run the command
+
+ ### run the command
### newer versions of 'tar' (1.21 and up) now print record size
- ### to STDERR as well if v OR t is given (used to be both). This
+ ### to STDERR as well if v OR t is given (used to be both). This
### is a 'feature' according to the changelog, so we must now only
### inspect STDOUT, otherwise, failures like these occur:
### nntp.perl.org/group/perl.cpan.testers/2009/02/msg3230366.html
@@ -692,17 +692,17 @@ sub have_old_bunzip2 {
buffer => \$buffer,
verbose => $DEBUG );
- ### command was unsuccessful
- unless( $out[0] ) {
+ ### command was unsuccessful
+ unless( $out[0] ) {
return $self->_error(loc(
"Error listing contents of archive '%1': %2",
$self->archive, $buffer ));
}
-
+
### no buffers available?
if( !IPC::Cmd->can_capture_buffer and !$buffer ) {
$self->_error( $self->_no_buffer_files( $self->archive ) );
-
+
} else {
### if we're on solaris we /might/ be using /bin/tar, which has
### a weird output format... we might also be using
@@ -715,27 +715,27 @@ sub have_old_bunzip2 {
\s+ [\d,.]+ \s bytes,
\s+ [\d,.]+ \s tape \s blocks
|x ? $1 : $_);
-
+
### only STDOUT, see above. Sometimes, extra whitespace
### is present, so make sure we only pick lines with
### a length
- } grep { length } map { split $/, $_ } @{$out[3]};
-
+ } grep { length } map { split $/, $_ } @{$out[3]};
+
### store the files that are in the archive ###
$self->files(\@files);
}
}
-
+
### now actually extract it ###
- { my $cmd =
+ { my $cmd =
$self->is_tgz ? [$self->bin_gzip, '-cdf', $self->archive, '|',
$self->bin_tar, '-xf', '-'] :
- $self->is_tbz ? [$self->bin_bunzip2, '-cd', $self->archive, '|',
+ $self->is_tbz ? [$self->bin_bunzip2, '-cd', $self->archive, '|',
$self->bin_tar, '-xf', '-'] :
- $self->is_txz ? [$self->bin_unxz, '-cd', $self->archive, '|',
+ $self->is_txz ? [$self->bin_unxz, '-cd', $self->archive, '|',
$self->bin_tar, '-xf', '-'] :
[$self->bin_tar, @ExtraTarFlags, '-xf', $self->archive];
-
+
my $buffer = '';
unless( scalar run( command => $cmd,
buffer => \$buffer,
@@ -744,17 +744,17 @@ sub have_old_bunzip2 {
return $self->_error(loc("Error extracting archive '%1': %2",
$self->archive, $buffer ));
}
-
+
### we might not have them, due to lack of buffers
if( $self->files ) {
### now that we've extracted, figure out where we extracted to
my $dir = $self->__get_extract_dir( $self->files );
-
+
### store the extraction dir ###
$self->extract_path( $dir );
}
}
-
+
### we got here, no error happened
return 1;
}
@@ -773,7 +773,7 @@ sub _untar_at {
### so users don't have to even think about this variable. If they
### do, they still get their set value outside of this call.
local $Archive::Tar::WARN = $Archive::Tar::WARN;
-
+
### we definitely need Archive::Tar, so load that first
{ my $use_list = { 'Archive::Tar' => '0.0' };
@@ -782,7 +782,7 @@ sub _untar_at {
$self->_error(loc("You do not have '%1' installed - " .
"Please install it as soon as possible.",
'Archive::Tar'));
-
+
return METHOD_NA;
}
}
@@ -804,7 +804,7 @@ sub _untar_at {
"You do not have '%1' installed - Please ".
"install it as soon as possible.", $which)
);
-
+
return METHOD_NA;
}
@@ -813,10 +813,10 @@ sub _untar_at {
unless( can_load( modules => $use_list ) ) {
$self->_error(loc(
"You do not have '%1' installed - Please " .
- "install it as soon as possible.",
+ "install it as soon as possible.",
'IO::Uncompress::Bunzip2')
);
-
+
return METHOD_NA;
}
@@ -831,10 +831,10 @@ sub _untar_at {
unless( can_load( modules => $use_list ) ) {
$self->_error(loc(
"You do not have '%1' installed - Please " .
- "install it as soon as possible.",
+ "install it as soon as possible.",
'IO::Uncompress::UnXz')
);
-
+
return METHOD_NA;
}
@@ -865,26 +865,26 @@ sub _untar_at {
my $next;
unless ( $next = Archive::Tar->iter( @read ) ) {
return $self->_error(loc(
- "Unable to read '%1': %2", $self->archive,
+ "Unable to read '%1': %2", $self->archive,
$Archive::Tar::error));
}
while ( my $file = $next->() ) {
push @files, $file->full_path;
-
+
$file->extract or return $self->_error(loc(
- "Unable to read '%1': %2",
+ "Unable to read '%1': %2",
$self->archive,
$Archive::Tar::error));
}
-
- ### older version, read the archive into memory
+
+ ### older version, read the archive into memory
} else {
my $tar = Archive::Tar->new();
unless( $tar->read( @read ) ) {
- return $self->_error(loc("Unable to read '%1': %2",
+ return $self->_error(loc("Unable to read '%1': %2",
$self->archive, $Archive::Tar::error));
}
@@ -900,7 +900,7 @@ sub _untar_at {
{ local $^W; # quell 'splice() offset past end of array' warnings
# on older versions of A::T
- ### older archive::tar always returns $self, return value
+ ### older archive::tar always returns $self, return value
### slightly fux0r3d because of it.
$tar->extract or return $self->_error(loc(
"Unable to extract '%1': %2",
@@ -1063,7 +1063,7 @@ sub _unzip_bin {
unless( $self->bin_unzip ) {
$self->_error(loc("No '%1' program found", '/bin/unzip'));
return METHOD_NA;
- }
+ }
### first, get the files.. it must be 2 different commands with 'unzip' :(
{ ### on VMS, capital letter options have to be quoted. This is
@@ -1071,7 +1071,7 @@ sub _unzip_bin {
### Subject: [patch@31735]Archive Extract fix on VMS.
my $opt = ON_VMS ? '"-Z"' : '-Z';
my $cmd = [ $self->bin_unzip, $opt, '-1', $self->archive ];
-
+
my $buffer = '';
unless( scalar run( command => $cmd,
verbose => $DEBUG,
@@ -1120,7 +1120,7 @@ sub _unzip_az {
unless( can_load( modules => $use_list ) ) {
$self->_error(loc("You do not have '%1' installed - Please " .
"install it as soon as possible.", 'Archive::Zip'));
- return METHOD_NA;
+ return METHOD_NA;
}
my $zip = Archive::Zip->new();
@@ -1130,8 +1130,8 @@ sub _unzip_az {
}
my @files;
-
-
+
+
### Address: #43278: Explicitly tell Archive::Zip where to put the files:
### "In my BackPAN indexing, Archive::Zip was extracting things
### in my script's directory instead of the current working directory.
@@ -1139,21 +1139,21 @@ sub _unzip_az {
### eventually calls File::Spec::Win32::rel2abs which on Windows might
### call Cwd::getdcwd. getdcwd returns the wrong directory in my
### case, even though I think I'm on the same drive.
- ###
+ ###
### To fix this, I pass the optional second argument to
### extractMember using the cwd from Archive::Extract." --bdfoy
## store cwd() before looping; calls to cwd() can be expensive, and
### it won't change during the loop
my $extract_dir = cwd();
-
+
### have to extract every member individually ###
for my $member ($zip->members) {
push @files, $member->{fileName};
### file to extract to, to avoid the above problem
my $to = File::Spec->catfile( $extract_dir, $member->{fileName} );
-
+
unless( $zip->extractMember($member, $to) == &Archive::Zip::AZ_OK ) {
return $self->_error(loc("Extraction of '%1' from '%2' failed",
$member->{fileName}, $self->archive ));
@@ -1185,27 +1185,27 @@ sub __get_extract_dir {
### which was the problem in bug #23999
my $res = -d $files->[$pos]
? File::Spec->catdir( $files->[$pos], '' )
- : File::Spec->catdir( dirname( $files->[$pos] ) );
+ : File::Spec->catdir( dirname( $files->[$pos] ) );
$$dir = $res;
}
- ### if the first and last dir don't match, make sure the
+ ### if the first and last dir don't match, make sure the
### dirname is not set wrongly
my $dir;
-
+
### dirs are the same, so we know for sure what the extract dir is
if( $dir1 eq $dir2 ) {
$dir = $dir1;
-
+
### dirs are different.. do they share the base dir?
### if so, use that, if not, fall back to '.'
} else {
my $base1 = [ File::Spec->splitdir( $dir1 ) ]->[0];
my $base2 = [ File::Spec->splitdir( $dir2 ) ]->[0];
-
- $dir = File::Spec->rel2abs( $base1 eq $base2 ? $base1 : '.' );
- }
+
+ $dir = File::Spec->rel2abs( $base1 eq $base2 ? $base1 : '.' );
+ }
return File::Spec->rel2abs( $dir );
}
@@ -1223,12 +1223,12 @@ sub _bunzip2_bin {
unless( $self->bin_bunzip2 ) {
$self->_error(loc("No '%1' program found", '/bin/bunzip2'));
return METHOD_NA;
- }
+ }
my $fh = FileHandle->new('>'. $self->_gunzip_to) or
return $self->_error(loc("Could not open '%1' for writing: %2",
$self->_gunzip_to, $! ));
-
+
### guard against broken bunzip2. See ->have_old_bunzip2()
### for details
if( $self->have_old_bunzip2 and $self->archive !~ /\.bz2$/i ) {
@@ -1252,7 +1252,7 @@ sub _bunzip2_bin {
if( !IPC::Cmd->can_capture_buffer and !$buffer ) {
$self->_error( $self->_no_buffer_content( $self->archive ) );
}
-
+
$self->_print($fh, $buffer) if defined $buffer;
close $fh;
@@ -1268,31 +1268,31 @@ sub _bunzip2_bin {
### extractor..
# sub _bunzip2_cz1 {
# my $self = shift;
-#
+#
# my $use_list = { 'IO::Uncompress::Bunzip2' => '0.0' };
# unless( can_load( modules => $use_list ) ) {
# return $self->_error(loc("You do not have '%1' installed - Please " .
# "install it as soon as possible.",
# 'IO::Uncompress::Bunzip2'));
# }
-#
+#
# my $bz = IO::Uncompress::Bunzip2->new( $self->archive ) or
# return $self->_error(loc("Unable to open '%1': %2",
# $self->archive,
# $IO::Uncompress::Bunzip2::Bunzip2Error));
-#
+#
# my $fh = FileHandle->new('>'. $self->_gunzip_to) or
# return $self->_error(loc("Could not open '%1' for writing: %2",
# $self->_gunzip_to, $! ));
-#
+#
# my $buffer;
# $fh->print($buffer) while $bz->read($buffer) > 0;
# $fh->close;
-#
+#
# ### set what files where extract, and where they went ###
# $self->files( [$self->_gunzip_to] );
# $self->extract_path( File::Spec->rel2abs(cwd()) );
-#
+#
# return 1;
# }
@@ -1304,7 +1304,7 @@ sub _bunzip2_bz2 {
$self->_error(loc("You do not have '%1' installed - Please " .
"install it as soon as possible.",
'IO::Uncompress::Bunzip2'));
- return METHOD_NA;
+ return METHOD_NA;
}
IO::Uncompress::Bunzip2::bunzip2($self->archive => $self->_gunzip_to)
@@ -1373,7 +1373,7 @@ sub _unxz_cz {
$self->_error(loc("You do not have '%1' installed - Please " .
"install it as soon as possible.",
'IO::Uncompress::UnXz'));
- return METHOD_NA;
+ return METHOD_NA;
}
IO::Uncompress::UnXz::unxz($self->archive => $self->_gunzip_to)
@@ -1402,7 +1402,7 @@ sub _unlzma_bin {