summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/CPANPLUS
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-04-23 21:46:20 +0000
committerKarl Berry <karl@freefriends.org>2014-04-23 21:46:20 +0000
commit300c1eb6d37d46078d448d6d58938d5a80cd68ff (patch)
tree23a0a8b9f8f5460b405119c4d3c163d2d488ca5e /Master/tlpkg/tlperl/lib/CPANPLUS
parented55d86b7c5e18f6eccce80a1fb1423ca40a23b5 (diff)
(tl)perl 5.18.2 for windows from siep
git-svn-id: svn://tug.org/texlive/trunk@33648 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CPANPLUS')
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Backend.pm3
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Backend/RV.pm5
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Config.pm18
-rwxr-xr-xMaster/tlpkg/tlperl/lib/CPANPLUS/Config/HomeEnv.pm63
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm21
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Configure/Setup.pm5
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Dist.pm10
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Autobundle.pm3
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Base.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Build.pm13
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Build/Constants.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Dist/MM.pm31
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Sample.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Error.pm3
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals.pm49
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Constants.pm7
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Constants/Report.pm6
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Extract.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Fetch.pm3
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Search.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source.pm87
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/Memory.pm39
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/SQLite.pm13
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/SQLite/Tie.pm8
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Utils.pm13
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Utils/Autoflush.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Module.pm17
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Module/Author.pm3
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Module/Author/Fake.pm5
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Module/Checksums.pm14
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Module/Fake.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Module/Signature.pm5
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Selfupdate.pm10
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Shell.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Classic.pm35
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default.pm34
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/CustomSource.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/Remote.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/Source.pm4
40 files changed, 450 insertions, 121 deletions
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Backend.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Backend.pm
index bb11f473618..85559dc04ff 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Backend.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Backend.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Backend;
+use deprecate;
use strict;
@@ -23,7 +24,7 @@ $Params::Check::VERBOSE = 1;
use vars qw[@ISA $VERSION];
@ISA = qw[CPANPLUS::Internals];
-$VERSION = $CPANPLUS::Internals::VERSION;
+$VERSION = "0.9135";
### mark that we're running under CPANPLUS to spawned processes
$ENV{'PERL5_CPANPLUS_IS_RUNNING'} = $$;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Backend/RV.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Backend/RV.pm
index 4a7dec12f0d..e7310ee418c 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Backend/RV.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Backend/RV.pm
@@ -1,8 +1,9 @@
package CPANPLUS::Backend::RV;
+use deprecate;
use strict;
-use vars qw[$STRUCT];
-
+use vars qw[$STRUCT $VERSION];
+$VERSION = "0.9135";
use CPANPLUS::Error;
use CPANPLUS::Internals::Constants;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Config.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Config.pm
index e148b8fca75..26a056fe035 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Config.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Config.pm
@@ -1,10 +1,10 @@
package CPANPLUS::Config;
+use deprecate;
use strict;
use warnings;
use base 'Object::Accessor';
-
use base 'CPANPLUS::Internals::Utils';
use Config;
@@ -20,6 +20,8 @@ use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
use Module::Load::Conditional qw[check_install];
use version;
+use vars qw[$VERSION];
+$VERSION = "0.9135";
=pod
@@ -166,7 +168,10 @@ Defaults to C<true>.
=item base
The directory CPANPLUS keeps all its build and state information in.
-Defaults to ~/.cpanplus.
+Defaults to ~/.cpanplus. If L<File::HomeDir> is available, that will
+be used to work out your C<HOME> directory. This may be overriden by
+setting the C<PERL5_CPANPLUS_HOME> environment variable, see
+L<CPANPLUS::Config::HomeEnv> for more details.
=cut
@@ -282,6 +287,15 @@ etc. Defaults to 'false'.
$Conf->{'conf'}->{'force'} = 0;
+=item histfile
+
+A string containing the history filename of the CPANPLUS readline instance.
+
+=cut
+
+ $Conf->{'conf'}->{'histfile'} = File::Spec->catdir(
+ __PACKAGE__->_home_dir, DOT_CPANPLUS, 'history' );
+
=item lib
An array ref holding directories to be added to C<@INC> when CPANPLUS
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Config/HomeEnv.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Config/HomeEnv.pm
new file mode 100755
index 00000000000..90703a066de
--- /dev/null
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Config/HomeEnv.pm
@@ -0,0 +1,63 @@
+package CPANPLUS::Config::HomeEnv;
+use deprecate;
+
+use strict;
+use File::Spec;
+use vars qw($VERSION);
+
+$VERSION = "0.9135";
+
+sub setup {
+ my $conf = shift;
+ $conf->set_conf( base => File::Spec->catdir( $ENV{PERL5_CPANPLUS_HOME}, '.cpanplus' ) )
+ if $ENV{PERL5_CPANPLUS_HOME};
+ return 1;
+}
+
+qq'Wherever I hang my hat is home';
+
+__END__
+
+=head1 NAME
+
+CPANPLUS::Config::HomeEnv - Set the environment for the CPANPLUS base dir
+
+=head1 SYNOPSIS
+
+ export PERL5_CPANPLUS_HOME=/home/moo/perls/conf/perl-5.8.9/
+
+=head1 DESCRIPTION
+
+CPANPLUS::Config::HomeEnv is a L<CPANPLUS::Config> file that allows the CPANPLUS user to
+specify where L<CPANPLUS> gets its configuration from.
+
+Setting the environment variable C<PERL5_CPANPLUS_HOME> to a path location, determines
+where the C<.cpanplus> directory will be located.
+
+=head1 METHODS
+
+=over
+
+=item C<setup>
+
+Called by L<CPANPLUS::Configure>.
+
+=back
+
+=head1 AUTHOR
+
+Chris C<BinGOs> Williams <chris@bingosnet.co.uk>
+
+Contributions and patience from Jos Boumans the L<CPANPLUS> guy!
+
+=head1 LICENSE
+
+Copyright E<copy> Chris Williams and Jos Boumans.
+
+This module may be used, modified, and distributed under the same terms as Perl itself. Please see the license that came with your Perl distribution for details.
+
+=head1 SEE ALSO
+
+L<CPANPLUS>
+
+=cut
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm
index 04a08753d55..1abf759ef74 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Configure;
+use deprecate;
use strict;
@@ -20,7 +21,7 @@ local $Params::Check::VERBOSE = 1;
### require, avoid circular use ###
require CPANPLUS::Internals;
-$VERSION = $CPANPLUS::Internals::VERSION = $CPANPLUS::Internals::VERSION;
+$VERSION = "0.9135";
### can't use O::A as we're using our own AUTOLOAD to get to
### the config options.
@@ -523,10 +524,12 @@ sub AUTOLOAD {
$type .= '_' if $private;
$type .= $field if $field;
- unless ( $conf->can($type) ) {
+ my $type_code = $conf->can($type);
+ unless ( $type_code ) {
error( loc("Invalid method type: '%1'", $name) );
return;
}
+ my $type_obj = $type_code->();
unless( scalar @_ ) {
error( loc("No arguments provided!") );
@@ -539,8 +542,8 @@ sub AUTOLOAD {
my @list = ();
### get it from the user config first
- if( $conf->can($type) and $conf->$type->can($key) ) {
- push @list, $conf->$type->$key;
+ if( my $code = $type_obj->can($key) ) {
+ push @list, $code->();
### XXX EU::AI compatibility hack to provide lookups like in
### cpanplus 0.04x; we renamed ->_get_build('base') to
@@ -562,8 +565,8 @@ sub AUTOLOAD {
while( my($key,$val) = each %args ) {
- if( $conf->can($type) and $conf->$type->can($key) ) {
- $conf->$type->$key( $val );
+ if( my $code = $type_obj->can($key) ) {
+ $code->( $val );
} else {
error( loc(q[No such key '%1' in field '%2'], $key, $type) );
@@ -579,13 +582,13 @@ sub AUTOLOAD {
while( my($key,$val) = each %args ) {
- if( $conf->$type->can($key) ) {
+ if( $type_obj->can($key) ) {
error( loc( q[Key '%1' already exists for field '%2'],
$key, $type));
return;
} else {
- $conf->$type->mk_accessors( $key );
- $conf->$type->$key( $val );
+ $type_obj->mk_accessors( $key );
+ $type_obj->$key( $val );
}
}
return 1;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Configure/Setup.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Configure/Setup.pm
index 7720d853083..8ac565a70ec 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Configure/Setup.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Configure/Setup.pm
@@ -1,7 +1,9 @@
package CPANPLUS::Configure::Setup;
+use deprecate;
use strict;
-use vars qw(@ISA);
+use vars qw[@ISA $VERSION];
+$VERSION = "0.9135";
use base qw[CPANPLUS::Internals::Utils];
use base qw[Object::Accessor];
@@ -11,7 +13,6 @@ use Term::UI;
use Module::Load;
use Term::ReadLine;
-
use CPANPLUS::Internals::Utils;
use CPANPLUS::Internals::Constants;
use CPANPLUS::Error;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist.pm
index 5df2ef0c64f..51ee5fb9caa 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Dist;
+use deprecate;
use strict;
@@ -14,6 +15,9 @@ use Params::Check qw[check];
use Module::Load::Conditional qw[can_load check_install];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
use base 'Object::Accessor';
local $Params::Check::VERBOSE = 1;
@@ -610,11 +614,7 @@ sub _resolve_prereqs {
### 'perl' is a special case, there's no mod object for it
if( $mod eq PERL_CORE ) {
- ### run a CLI invocation to see if the perl you specified is
- ### uptodate
- my $ok = run( command => "$^X -M$version -e1", verbose => 0 );
-
- unless( $ok ) {
+ unless( $cb->_vcmp( sprintf('v%vd',$^V), $version ) >= 0 ) {
error(loc( "Module '%1' needs perl version '%2', but you ".
"only have version '%3' -- can not proceed",
$self->module, $version,
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Autobundle.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Autobundle.pm
index 546f1ba6382..d5e45f3eca0 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Autobundle.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Autobundle.pm
@@ -1,10 +1,13 @@
package CPANPLUS::Dist::Autobundle;
+use deprecate;
use strict;
use warnings;
use CPANPLUS::Error qw[error msg];
use Params::Check qw[check];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
use base qw[CPANPLUS::Dist::Base];
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Base.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Base.pm
index 8e4e02f1f50..73736d9e4da 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Base.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Base.pm
@@ -1,11 +1,11 @@
package CPANPLUS::Dist::Base;
+use deprecate;
use strict;
use base qw[CPANPLUS::Dist];
use vars qw[$VERSION];
-$VERSION = $CPANPLUS::Internals::VERSION = $CPANPLUS::Internals::VERSION;
-
+$VERSION = "0.9135";
=head1 NAME
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Build.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Build.pm
index 702d606115b..d938749c825 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Build.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Build.pm
@@ -1,5 +1,7 @@
package CPANPLUS::Dist::Build;
+use if $] > 5.017, 'deprecate';
+
use strict;
use warnings;
use vars qw[@ISA $STATUS $VERSION];
@@ -30,7 +32,7 @@ use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
local $Params::Check::VERBOSE = 1;
-$VERSION = '0.62';
+$VERSION = '0.70';
=pod
@@ -327,6 +329,15 @@ sub prepare {
$fail++; last RUN;
}
+ unless ( BUILD->( $dir ) ) {
+ error( loc( "Build.PL failed to generate a Build script: %1", $prep_output ) );
+ if ( $conf->get_conf('cpantest') ) {
+ $status->{stage} = 'prepare';
+ $status->{capture} = $prep_output;
+ }
+ $fail++; last RUN;
+ }
+
msg( $prep_output, 0 );
my $prereqs = $self->status->prereqs;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Build/Constants.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Build/Constants.pm
index c0fa040ffc5..f020093c9c7 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Build/Constants.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Build/Constants.pm
@@ -1,5 +1,7 @@
package CPANPLUS::Dist::Build::Constants;
+use if $] > 5.017, 'deprecate';
+
use strict;
use warnings;
use File::Spec;
@@ -9,7 +11,7 @@ BEGIN {
require Exporter;
use vars qw[$VERSION @ISA @EXPORT];
- $VERSION = '0.62';
+ $VERSION = '0.70';
@ISA = qw[Exporter];
@EXPORT = qw[ BUILD_DIR BUILD CPDB_PERL_WRAPPER];
}
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/MM.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/MM.pm
index cd428691bcf..35f31b7b089 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/MM.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/MM.pm
@@ -1,9 +1,11 @@
package CPANPLUS::Dist::MM;
+use deprecate;
-use warnings;
use strict;
-use vars qw[@ISA $STATUS];
+use warnings;
+use vars qw[@ISA $STATUS $VERSION];
use base 'CPANPLUS::Dist::Base';
+$VERSION = "0.9135";
use CPANPLUS::Internals::Constants;
use CPANPLUS::Internals::Constants::Report;
@@ -221,14 +223,14 @@ sub prepare {
}
my $args;
- my( $force, $verbose, $perl, @mmflags, $prereq_target, $prereq_format,
+ my( $force, $verbose, $perl, $mmflags, $prereq_target, $prereq_format,
$prereq_build );
{ local $Params::Check::ALLOW_UNKNOWN = 1;
my $tmpl = {
perl => { default => $^X, store => \$perl },
makemakerflags => { default =>
$conf->get_conf('makemakerflags') || '',
- store => \$mmflags[0] },
+ store => \$mmflags },
force => { default => $conf->get_conf('force'),
store => \$force },
verbose => { default => $conf->get_conf('verbose'),
@@ -242,6 +244,7 @@ sub prepare {
$args = check( $tmpl, \%hash ) or return;
}
+ my @mmflags = $dist->_split_like_shell( $mmflags );
### maybe we already ran a create on this object? ###
return 1 if $dist->status->prepared && !$force;
@@ -578,6 +581,8 @@ sub create {
$args = check( $tmpl, \%hash ) or return;
}
+ my @makeflags = $dist->_split_like_shell( $makeflags );
+
### maybe we already ran a create on this object?
### make sure we add to include path again, just in case we came from
### ->save_state, at which point we need to restore @INC/$PERL5LIB
@@ -641,7 +646,7 @@ sub create {
"not running again unless you force",
$make, $self->module ), $verbose );
} else {
- unless(scalar run( command => [$make, $makeflags],
+ unless(scalar run( command => [$make, @makeflags],
buffer => \$captured,
verbose => $verbose )
) {
@@ -687,7 +692,7 @@ sub create {
### XXX need to add makeflags here too?
### yes, but they should really be split out -- see bug #4143
if( scalar run(
- command => [$make, 'test', $makeflags],
+ command => [$make, 'test', @makeflags],
buffer => \$captured,
verbose => $run_verbose,
) ) {
@@ -815,6 +820,7 @@ sub install {
return;
}
+ my @makeflags = $dist->_split_like_shell( $makeflags );
$dist->status->_install_args( $args );
@@ -829,7 +835,7 @@ sub install {
### 'make install' section ###
### XXX need makeflags here too?
### yes, but they should really be split out.. see bug #4143
- my $cmd = [$make, 'install', $makeflags];
+ my $cmd = [$make, 'install', @makeflags];
my $sudo = $conf->get_program('sudo');
unshift @$cmd, $sudo if $sudo and $>;
@@ -1016,6 +1022,17 @@ sub dist_dir {
return $distdir;
}
+sub _split_like_shell {
+ my ($self, $string) = @_;
+
+ return () unless defined($string);
+ return @$string if ref $string eq 'ARRAY';
+ $string =~ s/^\s+|\s+$//g;
+ return () unless length($string);
+
+ require Text::ParseWords;
+ return Text::ParseWords::shellwords($string);
+}
1;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Sample.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Sample.pm
index 0b0939208ff..e03d66f9836 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Sample.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Dist/Sample.pm
@@ -1,4 +1,8 @@
package CPANPLUS::Dist::Sample;
+use deprecate;
+
+use vars qw[$VERSION];
+$VERSION = "0.9135";
=pod
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Error.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Error.pm
index 968cead5605..0df6f334689 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Error.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Error.pm
@@ -1,6 +1,9 @@
package CPANPLUS::Error;
+use deprecate;
use strict;
+use vars qw[$VERSION];
+$VERSION = "0.9135";
use Log::Message private => 0;;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals.pm
index e9f97bfa2a1..5c53e67e74a 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals;
+use deprecate;
### we /need/ perl5.6.1 or higher -- we use coderefs in @INC,
### and 5.6.0 is just too buggy
@@ -7,7 +8,6 @@ use 5.006001;
use strict;
use Config;
-
use CPANPLUS::Error;
use CPANPLUS::Selfupdate;
@@ -19,7 +19,6 @@ use CPANPLUS::Internals::Constants;
use CPANPLUS::Internals::Search;
use CPANPLUS::Internals::Report;
-
require base;
use Cwd qw[cwd];
use Module::Load qw[load];
@@ -29,7 +28,6 @@ use Module::Load::Conditional qw[can_load];
use Object::Accessor;
-
local $Params::Check::VERBOSE = 1;
use vars qw[@ISA $VERSION];
@@ -42,7 +40,7 @@ use vars qw[@ISA $VERSION];
CPANPLUS::Internals::Report
];
-$VERSION = "0.9121";
+$VERSION = "0.9135";
=pod
@@ -79,7 +77,7 @@ Get/set the id
=cut
### autogenerate accessors ###
-for my $key ( qw[_conf _id _modules _hosts _methods _status
+for my $key ( qw[_conf _id _modules _hosts _methods _status _path
_callbacks _selfupdate _mtree _atree]
) {
no strict 'refs';
@@ -139,6 +137,7 @@ Returns the object on success, or dies on failure.
_methods => { default => {}, no_override => 1 },
_status => { default => '<empty>', no_override => 1 },
_callbacks => { default => '<empty>', no_override => 1 },
+ _path => { default => $ENV{PATH} || '', no_override => 1 },
};
sub _init {
@@ -254,6 +253,7 @@ be flushed.
if( $what eq 'lib' ) {
$ENV{PERL5LIB} = $conf->_perl5lib || '';
@INC = @{$conf->_lib};
+ $ENV{PATH} = $self->_path || '';
### give all modules a new status object -- this is slightly
### costly, but the best way to make sure all statuses are
@@ -440,6 +440,45 @@ sub _add_to_includepath {
=pod
+=head2 $bool = $internals->_add_to_path( directories => \@dirs )
+
+Adds a list of directories to the PATH, but only if they actually
+contain anything.
+
+Returns true on success, false on failure.
+
+=cut
+
+sub _add_to_path {
+ my $self = shift;
+ my %hash = @_;
+
+ my $dirs;
+ my $tmpl = {
+ directories => { required => 1, default => [], store => \$dirs,
+ strict_type => 1 },
+ };
+
+ check( $tmpl, \%hash ) or return;
+
+ my $s = $Config{'path_sep'};
+
+ require File::Glob;
+
+ ### only add if it's not added yet
+ for my $dir (@$dirs) {
+ $dir =~ s![\\/]*$!!g;
+ next if $ENV{PATH} =~ qr|\Q$dir\E|;
+ next unless -d $dir;
+ next unless File::Glob::bsd_glob( $dir . q{/*} );
+ $ENV{PATH} = join $s, $dir, $ENV{PATH};
+ }
+
+ return 1;
+}
+
+=pod
+
=head2 $id = CPANPLUS::Internals->_last_id
Return the id of the last object stored.
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Constants.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Constants.pm
index bd48a1db8c6..09501c78e84 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Constants.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Constants.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Constants;
+use deprecate;
use strict;
@@ -13,10 +14,10 @@ use vars qw[$VERSION @ISA @EXPORT];
use Package::Constants;
+$VERSION = "0.9135";
@ISA = qw[Exporter];
@EXPORT = Package::Constants->list( __PACKAGE__ );
-
sub constants { @EXPORT };
use constant INSTALLER_BUILD
@@ -195,6 +196,10 @@ use constant BLIB_LIBDIR => sub { return @_
: File::Spec->catdir( BLIB->(), LIB );
};
+use constant BIN => 'bin';
+
+use constant SCRIPT => 'script';
+
use constant CONFIG_USER_LIB_DIR => sub {
require CPANPLUS::Internals::Utils;
LIB_DIR->(
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Constants/Report.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Constants/Report.pm
index 294de692369..dc92ec6c31d 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Constants/Report.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Constants/Report.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Constants::Report;
+use deprecate;
use strict;
use CPANPLUS::Error;
@@ -14,11 +15,10 @@ use Package::Constants;
### for the version
require CPANPLUS::Internals;
-$VERSION = $CPANPLUS::Internals::VERSION = $CPANPLUS::Internals::VERSION;
+$VERSION = "0.9135";
@ISA = qw[Exporter];
@EXPORT = Package::Constants->list( __PACKAGE__ );
-
### OS to regex map ###
my %OS = (
Amiga => 'amigaos',
@@ -347,6 +347,8 @@ use constant REPORT_TOOLCHAIN_VERSIONS
ExtUtils::ParseXS
File::Spec
Module::Build
+ Pod::Parser
+ Pod::Simple
Test::Harness
Test::More
version
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Extract.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Extract.pm
index 2f8b730ca54..4028aacfa70 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Extract.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Extract.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Extract;
+use deprecate;
use strict;
@@ -13,6 +14,9 @@ use Params::Check qw[check];
use Module::Load::Conditional qw[can_load check_install];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
local $Params::Check::VERBOSE = 1;
=pod
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Fetch.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Fetch.pm
index f8a232e1f8e..098d1e3761f 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Fetch.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Fetch.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Fetch;
+use deprecate;
use strict;
@@ -12,6 +13,8 @@ use IPC::Cmd qw[run];
use Params::Check qw[check];
use Module::Load::Conditional qw[can_load];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
$Params::Check::VERBOSE = 1;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm
index 6e3cd5641dc..c5892f93bb6 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Report;
+use deprecate;
use strict;
@@ -13,6 +14,9 @@ use Module::Load::Conditional qw[can_load];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
use version;
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
$Params::Check::VERBOSE = 1;
### for the version ###
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Search.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Search.pm
index 6a5a6cf9a48..2a99dbfde30 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Search.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Search.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Search;
+use deprecate;
use strict;
@@ -13,6 +14,9 @@ use File::Spec;
use Params::Check qw[check allow];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
$Params::Check::VERBOSE = 1;
=pod
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source.pm
index 1f75535fa65..8f8ad7bd4c7 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Source;
+use deprecate;
use strict;
@@ -18,6 +19,9 @@ use Params::Check qw[check];
use Module::Load::Conditional qw[can_load];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
$Params::Check::VERBOSE = 1;
### list of methods the parent class must implement
@@ -551,13 +555,12 @@ sub __create_author_tree {
my ($tot,$prce,$prc,$idx);
- $args->{verbose}
- and local $|=1,
- $tot = scalar(split /\n/, $cont),
- ($prce, $prc, $idx) = (int $tot / 25, 0, 0);
-
- $args->{verbose}
- and print "\t0%";
+ if ( $args->{verbose} and local $|=1 ) {
+ no warnings;
+ $tot = scalar(split /\n/, $cont);
+ ($prce, $prc, $idx) = (int $tot / 25, 0, 0);
+ print "\t0%";
+ }
for ( split /\n/, $cont ) {
my($id, $name, $email) = m/^alias \s+
@@ -630,7 +633,7 @@ sub _create_mod_tree {
my $self = shift;
my %hash = @_;
my $conf = $self->configure_object;
-
+ my $base = $conf->_get_mirror('base');
my $tmpl = {
path => { default => $conf->get_conf('base') },
@@ -647,6 +650,8 @@ sub _create_mod_tree {
my $dslip_tree = $self->__create_dslip_tree( %$args );
+ my $author_tree = $self->author_tree;
+
### extract the file ###
my $ae = Archive::Extract->new( archive => $file ) or return;
my $out = STRIP_GZ_SUFFIX->($file);
@@ -664,48 +669,47 @@ sub _create_mod_tree {
my($past_header, $count, $tot, $prce, $prc, $idx);
- $args->{verbose}
- and local $|=1,
- $tot = scalar(split /\n/, $content),
- ($prce, $prc, $idx) = (int $tot / 25, 0, 0);
-
- $args->{verbose}
- and print "\t0%";
+ if ( $args->{verbose} and local $|=1 ) {
+ no warnings;
+ $tot = scalar(split /\n/, $content);
+ ($prce, $prc, $idx) = (int $tot / 25, 0, 0);
+ print "\t0%";
+ }
for ( split /\n/, $content ) {
- ### quick hack to read past the header of the file ###
- ### this is still rather evil... fix some time - Kane
- if( m|^\s*$| ) {
- unless( $count ) {
- error(loc("Could not determine line count from %1", $file));
- return;
- }
- $past_header = 1;
- }
### we're still in the header -- find the amount of lines we expect
unless( $past_header ) {
+ ### header has ended -- did we get the line count?
+ if( m|^\s*$| ) {
+ unless( $count ) {
+ error(loc("Could not determine line count from %1", $file));
+ return;
+ }
+ $past_header = 1;
+
### if the line count doesn't match what we expect, bail out
### this should address: #45644: detect broken index
- $count = $1 if /^Line-Count:\s+(\d+)/;
- if( $count ) {
- if( $lines < $count ) {
- error(loc("Expected to read at least %1 lines, but %2 ".
- "contains only %3 lines!",
- $count, $file, $lines ));
- return;
+ } else {
+ $count = $1 if /^Line-Count:\s+(\d+)/;
+ if( $count ) {
+ if( $lines < $count ) {
+ error(loc("Expected to read at least %1 lines, but %2 ".
+ "contains only %3 lines!",
+ $count, $file, $lines ));
+ return;
+ }
}
}
+
### still in the header, keep moving
next;
}
- ### skip empty lines ###
- next unless /\S/;
- chomp;
-
my @data = split /\s+/;
+ ### three fields expected on each line
+ next unless @data == 3;
### filter out the author and filename as well ###
### authors can apparently have digits in their names,
@@ -720,7 +724,7 @@ sub _create_mod_tree {
### remove file name from the path
$data[2] =~ s|/[^/]+$||;
- my $aobj = $self->author_tree($author);
+ my $aobj = $author_tree->{$author};
unless( $aobj ) {
error( loc( "No such author '%1' -- can't make module object " .
"'%2' that is supposed to belong to this author",
@@ -728,15 +732,14 @@ sub _create_mod_tree {
next;
}
+ my $dslip_mod = $dslip_tree->{ $data[0] };
+
### adding the dslip info
- ### probably can use some optimization
my $dslip;
for my $item ( qw[ statd stats statl stati statp ] ) {
### checking if there's an entry in the dslip info before
### catting it on. appeasing warnings this way
- $dslip .= $dslip_tree->{ $data[0] }->{$item}
- ? $dslip_tree->{ $data[0] }->{$item}
- : ' ';
+ $dslip .= $dslip_mod->{$item} || ' ';
}
### XXX this could be sped up if we used author names, not author
@@ -751,7 +754,7 @@ sub _create_mod_tree {
? '0.0'
: $data[1]),
path => File::Spec::Unix->catfile(
- $conf->_get_mirror('base'),
+ $base,
$data[2],
), # extended path on the cpan mirror,
# like /A/AB/ABIGAIL
@@ -759,7 +762,7 @@ sub _create_mod_tree {
author => $aobj,
package => $package, # package name, like
# 'foo-bar-baz-1.03.tar.gz'
- description => $dslip_tree->{ $data[0] }->{'description'},
+ description => $dslip_mod->{'description'},
dslip => $dslip,
mtime => '',
) or error( loc( "Could not add module '%1'", $data[0] ) );
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/Memory.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/Memory.pm
index d589bbd1d8b..a28532e02cd 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/Memory.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/Memory.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Source::Memory;
+use deprecate;
use base 'CPANPLUS::Internals::Source';
@@ -20,6 +21,9 @@ use Params::Check qw[allow check];
use Module::Load::Conditional qw[can_load];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
$Params::Check::VERBOSE = 1;
=head1 NAME
@@ -122,28 +126,31 @@ sub _add_author_object {
return $obj;
}
-sub _add_module_object {
- my $self = shift;
- my %hash = @_;
-
- my $class;
+{
my $tmpl = {
- class => { default => 'CPANPLUS::Module', store => \$class },
- map { $_ => { required => 1 } }
- qw[ module version path comment author package description dslip mtime ]
+ class => { default => 'CPANPLUS::Module' },
+ map { $_ => { required => 1 } } qw[
+ module version path comment author package description dslip mtime
+ ],
};
- my $href = do {
- local $Params::Check::NO_DUPLICATES = 1;
- check( $tmpl, \%hash ) or return;
- };
+ sub _add_module_object {
+ my $self = shift;
+ my %hash = @_;
- my $obj = $class->new( %$href, _id => $self->_id );
+ my $href = do {
+ local $Params::Check::SANITY_CHECK_TEMPLATE = 0;
+ check( $tmpl, \%hash ) or return;
+ };
+ my $class = delete $href->{class};
- ### Every module get's stored as a module object ###
- $self->module_tree->{ $href->{module} } = $obj or return;
+ my $obj = $class->new( %$href, _id => $self->_id );
- return $obj;
+ ### Every module get's stored as a module object ###
+ $self->module_tree->{ $href->{module} } = $obj or return;
+
+ return $obj;
+ }
}
{ my %map = (
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/SQLite.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/SQLite.pm
index 47bdbebfd77..50f82f485c9 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/SQLite.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/SQLite.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Source::SQLite;
+use deprecate;
use strict;
use warnings;
@@ -16,6 +17,9 @@ use DBD::SQLite;
use Params::Check qw[allow check];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
use constant TXN_COMMIT => 1000;
=head1 NAME
@@ -240,7 +244,6 @@ CPANPLUS::Internals::Source::SQLite - SQLite implementation
*$sub = sub {
my $self = shift;
my %hash = @_;
- my $dbh = $self->__sqlite_dbh;
my($list,$type);
my $tmpl = {
@@ -256,9 +259,15 @@ CPANPLUS::Internals::Source::SQLite - SQLite implementation
### we aliased 'module' to 'name', so change that here too
$type = 'module' if $type eq 'name';
+ my $meth = $table .'_tree';
+
+ {
+ my $throw = $self->$meth;
+ }
+
+ my $dbh = $self->__sqlite_dbh;
my $res = $dbh->query( "SELECT * from $table" );
- my $meth = $table .'_tree';
my @rv = map { $self->$meth( $_->{$key} ) }
grep { allow( $_->{$type} => $list ) } $res->hashes;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/SQLite/Tie.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/SQLite/Tie.pm
index 7208e00ee11..b44b04bd58e 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/SQLite/Tie.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Source/SQLite/Tie.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Source::SQLite::Tie;
+use deprecate;
use strict;
use warnings;
@@ -9,17 +10,14 @@ use CPANPLUS::Module::Fake;
use CPANPLUS::Module::Author::Fake;
use CPANPLUS::Internals::Constants;
-
use Params::Check qw[check];
use Module::Load::Conditional qw[can_load];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
-
-use Data::Dumper;
-$Data::Dumper::Indent = 1;
+use vars qw[@ISA $VERSION];
+$VERSION = "0.9135";
require Tie::Hash;
-use vars qw[@ISA];
push @ISA, 'Tie::StdHash';
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Utils.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Utils.pm
index e9651ed45fd..58ece81ee6a 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Utils.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Utils.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Internals::Utils;
+use deprecate;
use strict;
@@ -12,6 +13,9 @@ use Module::Load::Conditional qw[can_load];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
use version;
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
local $Params::Check::VERBOSE = 1;
=pod
@@ -392,6 +396,15 @@ Returns the user's homedir, or C<cwd> if it could not be found
=cut
sub _home_dir {
+
+ if ( can_load( modules => { 'File::HomeDir' => 0.0 } ) ) {
+ if ( defined $ENV{APPDATA} && length $ENV{APPDATA} && !ON_WIN32 ) {
+ msg("'APPDATA' env var is set and not on MSWin32, " .
+ "please use 'PERL5_CPANPLUS_HOME' instead to change .cpanplus location", 1 );
+ }
+ return File::HomeDir->my_home if -d File::HomeDir->my_home;
+ }
+
my @os_home_envs = qw( APPDATA HOME USERPROFILE WINDIR SYS$LOGIN );
for my $env ( @os_home_envs ) {
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Utils/Autoflush.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Utils/Autoflush.pm
index 56566436a14..8aa9030dfa3 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Utils/Autoflush.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Utils/Autoflush.pm
@@ -1,4 +1,8 @@
package CPANPLUS::Internals::Utils::Autoflush;
+use deprecate;
+
+use vars qw[$VERSION];
+$VERSION = "0.9135";
BEGIN { $|++ };
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Module.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Module.pm
index 4d470c6a71c..4eda894629a 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Module.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Module.pm
@@ -1,8 +1,9 @@
package CPANPLUS::Module;
+use deprecate;
use strict;
-use vars qw[@ISA];
-
+use vars qw[@ISA $VERSION];
+$VERSION = "0.9135";
use CPANPLUS::Dist;
use CPANPLUS::Error;
@@ -1697,7 +1698,10 @@ sub _extutils_installed {
Adds the current modules path to C<@INC> and C<$PERL5LIB>. This allows
you to add the module from its build dir to your path.
-You can reset C<@INC> and C<$PERL5LIB> to its original state when you
+It also adds the current modules C<bin> and/or C<script> paths to
+the PATH.
+
+You can reset C<$PATH>, C<@INC> and C<$PERL5LIB> to their original state when you
started the program, by calling:
$self->parent->flush('lib');
@@ -1718,6 +1722,13 @@ sub add_to_includepath {
]
) or return;
+ $cb->_add_to_path(
+ directories => [
+ File::Spec->catdir(BLIB->($dir), SCRIPT),
+ File::Spec->catdir(BLIB->($dir), BIN),
+ ]
+ ) or return;
+
} else {
error(loc( "No extract dir registered for '%1' -- can not add ".
"add builddir to search path!", $self->module ));
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Author.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Author.pm
index 9ce12ebfde2..c95de4064cb 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Author.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Author.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Module::Author;
+use deprecate;
use strict;
@@ -6,6 +7,8 @@ use CPANPLUS::Error;
use CPANPLUS::Internals::Constants;
use Params::Check qw[check];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
local $Params::Check::VERBOSE = 1;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Author/Fake.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Author/Fake.pm
index 0c844714981..15de66b0dc5 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Author/Fake.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Author/Fake.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Module::Author::Fake;
+use deprecate;
use CPANPLUS::Module::Author;
@@ -6,9 +7,11 @@ use CPANPLUS::Internals;
use CPANPLUS::Error;
use strict;
-use vars qw[@ISA];
+use vars qw[@ISA $VERSION];
use Params::Check qw[check];
+$VERSION = "0.9135";
+
@ISA = qw[CPANPLUS::Module::Author];
$Params::Check::VERBOSE = 1;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Checksums.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Checksums.pm
index 8dde1cc0554..51263b4d252 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Checksums.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Checksums.pm
@@ -1,8 +1,8 @@
package CPANPLUS::Module::Checksums;
+use deprecate;
use strict;
-use vars qw[@ISA];
-
+use vars qw[@ISA $VERSION];
use CPANPLUS::Error;
use CPANPLUS::Internals::Constants;
@@ -16,6 +16,7 @@ use Module::Load::Conditional qw[can_load];
$Params::Check::VERBOSE = 1;
@ISA = qw[ CPANPLUS::Module::Signature ];
+$VERSION = "0.9135";
=head1 NAME
@@ -142,7 +143,14 @@ sub _get_checksums_file {
my $clone = $self->clone;
$clone->package( CHECKSUMS );
- my $file = $clone->fetch( ttl => 3600, %hash ) or return;
+ # If the user specified a fetchdir, then every CHECKSUMS file will always
+ # be stored there, not in an author-specific subdir. Thus, in this case,
+ # we need to always re-fetch the CHECKSUMS file and hence need to set the
+ # TTL to something small.
+ my $have_fetchdir =
+ $self->parent->configure_object->get_conf('fetchdir') ne '';
+ my $ttl = $have_fetchdir ? 0.001 : 3600;
+ my $file = $clone->fetch( ttl => $ttl, %hash ) or return;
return $file;
}
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Fake.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Fake.pm
index b0db1dae109..d6c94a50e01 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Fake.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Fake.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Module::Fake;
+use deprecate;
use CPANPLUS::Error;
@@ -7,9 +8,10 @@ use CPANPLUS::Module::Author::Fake;
use CPANPLUS::Internals;
use strict;
-use vars qw[@ISA];
+use vars qw[@ISA $VERSION];
use Params::Check qw[check];
+$VERSION = "0.9135";
@ISA = qw[CPANPLUS::Module];
$Params::Check::VERBOSE = 1;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Signature.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Signature.pm
index cec6f2906b0..802d8cc2a60 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Signature.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Module/Signature.pm
@@ -1,13 +1,14 @@
package CPANPLUS::Module::Signature;
+use deprecate;
use strict;
-
use Cwd;
use CPANPLUS::Error;
use Params::Check qw[check];
use Module::Load::Conditional qw[can_load];
-
+use vars qw[$VERSION];
+$VERSION = "0.9135";
### detached sig, not actually used afaik --kane ###
#sub get_signature {
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Selfupdate.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Selfupdate.pm
index 26d3dc81f5b..89157121792 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Selfupdate.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Selfupdate.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Selfupdate;
+use deprecate;
use strict;
use Params::Check qw[check];
@@ -9,6 +10,9 @@ use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
use CPANPLUS::Internals::Constants;
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
$Params::Check::VERBOSE = 1;
=head1 NAME
@@ -47,13 +51,13 @@ CPANPLUS::Selfupdate - self-updating for CPANPLUS
'Locale::Maketext::Simple' => '0.01',
'Log::Message' => '0.01',
'Module::Load' => '0.10',
- 'Module::Load::Conditional' => '0.38', # returns dir for loaded
+ 'Module::Load::Conditional' => '0.50', # returns dir for loaded
# modules
'version' => '0.77', # needed for M::L::C
# addresses #24630 and
# #24675
# Address ~0 overflow issue
- 'Params::Check' => '0.22',
+ 'Params::Check' => '0.36',
'Package::Constants' => '0.01',
'Term::UI' => '0.18', # option parsing
'Test::Harness' => '2.62', # due to bug #19505
@@ -62,7 +66,7 @@ CPANPLUS::Selfupdate - self-updating for CPANPLUS
'Archive::Extract' => '0.16', # ./Dir bug fix
'Archive::Tar' => '1.23',
'IO::Zlib' => '1.04', # needed for Archive::Tar
- 'Object::Accessor' => '0.34', # mk_aliases support
+ 'Object::Accessor' => '0.44', # mk_aliases support
'Module::CoreList' => '2.22', # deprecated core modules
'Module::Pluggable' => '2.4',
'Module::Loaded' => '0.01',
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell.pm
index 04735275121..bf7482d3da1 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Shell;
+use deprecate;
use strict;
@@ -12,8 +13,9 @@ use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
$Params::Check::VERBOSE = 1;
-use vars qw[@ISA $SHELL $DEFAULT];
+use vars qw[@ISA $SHELL $DEFAULT $VERSION];
+$VERSION = "0.9135";
$DEFAULT = SHELL_DEFAULT;
=pod
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Classic.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Classic.pm
index 089d3de16bd..6cdc6f69cca 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Classic.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Classic.pm
@@ -5,6 +5,7 @@
##################################################
package CPANPLUS::Shell::Classic;
+use deprecate;
use strict;
@@ -30,7 +31,7 @@ $Params::Check::ALLOW_UNKNOWN = 1;
BEGIN {
use vars qw[ $VERSION @ISA ];
@ISA = qw[ CPANPLUS::Shell::_Base::ReadLine ];
- $VERSION = '0.0562';
+ $VERSION = "0.9135";
}
load CPANPLUS::Shell;
@@ -97,6 +98,20 @@ sub new {
code => \&__ask_about_test_report,
);
+ if (my $histfile = $self->configure_object->get_conf( 'histfile' )) {
+ my $term = $self->term;
+ if ($term->can('AddHistory')) {
+ if (open my $fh, '<', $histfile) {
+ local $/ = "\n";
+ while (my $line = <$fh>) {
+ chomp($line);
+ $term->AddHistory($line);
+ }
+ close($fh);
+ }
+ }
+ }
+
return $self;
}
@@ -194,6 +209,24 @@ sub _dispatch_on_input {
### displays quit message
sub _quit {
+ my $self = shift;
+ my $term = $self->term;
+
+ if ($term->can('GetHistory')) {
+ my @history = $term->GetHistory;
+
+ my $histfile = $self->configure_object->get_conf('histfile');
+
+ if (open my $fh, '>', $histfile) {
+ foreach my $line (@history) {
+ print {$fh} "$line\n";
+ }
+ close($fh);
+ }
+ else {
+ warn "Cannot open history file '$histfile' - $!";
+ }
+ }
### well, that's what CPAN.pm says...
print "Lockfile removed\n";
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default.pm
index 56dce061ae3..4c9991d529b 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Shell::Default;
+use deprecate;
use strict;
@@ -26,7 +27,7 @@ local $Data::Dumper::Indent = 1; # for dumpering from !
BEGIN {
use vars qw[ $VERSION @ISA ];
@ISA = qw[ CPANPLUS::Shell::_Base::ReadLine ];
- $VERSION = "0.9121";
+ $VERSION = "0.9135";
}
load CPANPLUS::Shell;
@@ -213,6 +214,20 @@ sub new {
### load all the plugins
$self->_plugins_init;
+ if (my $histfile = $cb->configure_object->get_conf( 'histfile' )) {
+ my $term = $self->term;
+ if ($term->can('AddHistory')) {
+ if (open my $fh, '<', $histfile) {
+ local $/ = "\n";
+ while (my $line = <$fh>) {
+ chomp($line);
+ $term->AddHistory($line);
+ }
+ close($fh);
+ }
+ }
+ }
+
return $self;
}
@@ -511,10 +526,27 @@ sub __display_results {
sub _quit {
my $self = shift;
+ my $term = $self->term;
$self->dispatch_on_input( input => $rc->{'logout'} )
if defined $rc->{'logout'};
+ if ($term->can('GetHistory')) {
+ my @history = $term->GetHistory;
+
+ my $histfile = $self->backend->configure_object->get_conf('histfile');
+
+ if (open my $fh, '>', $histfile) {
+ foreach my $line (@history) {
+ print {$fh} "$line\n";
+ }
+ close($fh);
+ }
+ else {
+ warn "Cannot open history file '$histfile' - $!";
+ }
+ }
+
$self->__print( loc("Exiting CPANPLUS shell"), "\n" );
return 1;
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/CustomSource.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/CustomSource.pm
index b602a547ac3..1c77ae24f58 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/CustomSource.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/CustomSource.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Shell::Default::Plugins::CustomSource;
+use deprecate;
use strict;
use CPANPLUS::Error qw[error msg];
@@ -7,6 +8,9 @@ use CPANPLUS::Internals::Constants;
use Data::Dumper;
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
=head1 NAME
CPANPLUS::Shell::Default::Plugins::CustomSource - add custom sources to CPANPLUS
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/Remote.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/Remote.pm
index 9d14a5976dc..0e749646c81 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/Remote.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/Remote.pm
@@ -1,4 +1,5 @@
package CPANPLUS::Shell::Default::Plugins::Remote;
+use deprecate;
use strict;
@@ -7,6 +8,9 @@ use Params::Check qw[check];
use CPANPLUS::Error qw[error msg];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
=head1 NAME
CPANPLUS::Shell::Default::Plugins::Remote - connect to a remote CPANPLUS
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/Source.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/Source.pm
index 74c3582ffb4..30383398eb8 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/Source.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Shell/Default/Plugins/Source.pm
@@ -1,9 +1,13 @@
package CPANPLUS::Shell::Default::Plugins::Source;
+use deprecate;
use strict;
use CPANPLUS::Error qw[error msg];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
+use vars qw[$VERSION];
+$VERSION = "0.9135";
+
=head1 NAME
CPANPLUS::Shell::Default::Plugins::Source - read in CPANPLUS commands