# -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*-
use strict;
package CPAN;
-$CPAN::VERSION = '1.88_52';
+$CPAN::VERSION = '1.88_53';
$CPAN::VERSION = eval $CPAN::VERSION;
use CPAN::HandleConfig;
$CPAN::Defaultrecent ||= "http://search.cpan.org/recent";
-use vars qw($VERSION @EXPORT $AUTOLOAD $DEBUG $META $HAS_USABLE $term
+use vars qw($VERSION @EXPORT $AUTOLOAD
+ $DEBUG $META $HAS_USABLE $term
+ $GOTOSHELL
$Signal $Suppress_readline $Frontend
@Defaultsites $Have_warned $Defaultdocs $Defaultrecent
$Be_Silent
$prompt = $oprompt;
} elsif (/./) {
my(@line);
- if ($] < 5.00322) { # parsewords had a bug until recently
- @line = split;
- } else {
- eval { @line = Text::ParseWords::shellwords($_) };
- warn($@), next SHELLCOMMAND if $@;
- warn("Text::Parsewords could not parse the line [$_]"),
- next SHELLCOMMAND unless @line;
- }
+ eval { @line = Text::ParseWords::shellwords($_) };
+ warn($@), next SHELLCOMMAND if $@;
+ warn("Text::Parsewords could not parse the line [$_]"),
+ next SHELLCOMMAND unless @line;
$CPAN::META->debug("line[".join("|",@line)."]") if $CPAN::DEBUG;
my $command = shift @line;
eval { CPAN::Shell->$command(@line) };
require Term::ReadLine;
$CPAN::Frontend->myprint("\n$redef subroutines in ".
"Term::ReadLine redefined\n");
- @_ = ($oprompt,"");
- goto &shell;
+ $GOTOSHELL = 1;
}
}
if ($term and $term->can("ornaments")) {
}
}
}
+ if ($CPAN::DEBUG && $CPAN::DEBUG & $CPAN::DEBUG{CPAN}) {
+ # debugging 'incommandcolor': should always be off at the end of a command
+ # (incommandcolor is used to detect recursive dependencies)
+ for my $class (qw(Module Distribution)) {
+ for my $dm (keys %{$CPAN::META->{readwrite}{"CPAN::$class"}}) {
+ next unless $CPAN::META->{readwrite}{"CPAN::$class"}{$dm}{incommandcolor};
+ CPAN->debug("BUG: $class '$dm' was in command state, resetting");
+ delete $CPAN::META->{readwrite}{"CPAN::$class"}{$dm}{incommandcolor};
+ }
+ }
+ }
+ if ($GOTOSHELL) {
+ $GOTOSHELL = 0; # not too often
+ $META->savehist if $CPAN::term && $CPAN::term->can("GetHistory");
+ @_ = ($oprompt,"");
+ goto &shell;
+ }
}
soft_chdir_with_alternatives(\@cwd);
}
package CPAN::Shell;
use strict;
-use vars qw($AUTOLOAD @ISA $COLOR_REGISTERED $ADVANCED_QUERY
+use vars qw(
+ $ADVANCED_QUERY
+ $AUTOLOAD
+ $COLOR_REGISTERED
$autoload_recursion
+ $reload
+ @ISA
);
@CPAN::Shell::ISA = qw(CPAN::Debug);
$COLOR_REGISTERED ||= 0;
# it tries again. The second require is only a NOOP returning
# 1 if we had success, otherwise it's retrying
- $CPAN::Frontend->myprint("CPAN: $mod loaded ok\n");
+ my $v = eval "\$$mod\::VERSION";
+ $v = $v ? " (v$v)" : "";
+ $CPAN::Frontend->myprint("CPAN: $mod loaded ok$v\n");
if ($mod eq "CPAN::WAIT") {
push @CPAN::Shell::ISA, 'CPAN::WAIT';
}
}
}
+# CPAN::Shell::paintdots_onreload
sub paintdots_onreload {
my($ref) = shift;
sub {
local($|) = 1;
# $CPAN::Frontend->myprint(".($subr)");
$CPAN::Frontend->myprint(".");
+ if ($subr =~ /\bshell\b/i) {
+ # warn "debug[$_[0]]";
+
+ # It would be nice if we could detect that a
+ # subroutine has actually changed, but for now we
+ # practically always set the GOTOSHELL global
+
+ $CPAN::GOTOSHELL=1;
+ }
return;
}
warn @_;
$CPAN::Frontend->myprint("v$v)");
}
$CPAN::Frontend->myprint("\n$redef subroutines redefined\n");
- $failed++ unless $redef;
if ($failed) {
my $errors = $failed == 1 ? "error" : "errors";
$CPAN::Frontend->mywarn("\n$failed $errors during reload. You better quit ".
# reload means only load again what we have loaded before
#-> sub CPAN::Shell::reload_this ;
sub reload_this {
- my($self,$f) = @_;
+ my($self,$f,$args) = @_;
CPAN->debug("f[$f]") if $CPAN::DEBUG;
return 1 unless $INC{$f}; # we never loaded this, so we do not
# reload but say OK
$CPAN::Frontend->mywarn("Found no file to reload for '$f'\n");
return;
}
- my $fh = FileHandle->new($file) or
- $CPAN::Frontend->mydie("Could not open $file: $!");
- local($/);
- local $^W = 1;
- my $content = <$fh>;
- CPAN->debug(sprintf("reload file[%s] content[%s...]",$file,substr($content,0,128)))
- if $CPAN::DEBUG;
- delete $INC{$f};
- local @INC = @inc;
- eval "require '$f'";
- if ($@){
- warn $@;
- return;
+ my $mtime = (stat $file)[9];
+ $reload->{$f} ||= $^T;
+ my $must_reload = $mtime > $reload->{$f};
+ $args ||= {};
+ $must_reload ||= $args->{force};
+ if ($must_reload) {
+ my $fh = FileHandle->new($file) or
+ $CPAN::Frontend->mydie("Could not open $file: $!");
+ local($/);
+ local $^W = 1;
+ my $content = <$fh>;
+ CPAN->debug(sprintf("reload file[%s] content[%s...]",$file,substr($content,0,128)))
+ if $CPAN::DEBUG;
+ delete $INC{$f};
+ local @INC = @inc;
+ eval "require '$f'";
+ if ($@){
+ warn $@;
+ return;
+ }
+ $reload->{$f} = time;
+ } else {
+ $CPAN::Frontend->myprint("__unchanged__");
}
return 1;
}
} elsif ($s =~ m|[\$\@\%]|) { # looks like a perl variable
} elsif ($s =~ m|^/|) { # looks like a regexp
$CPAN::Frontend->mywarn("Sorry, $meth with a regular expression is ".
- "not supported. Rejecting argument '$s'\n");
+ "not supported.\nRejecting argument '$s'\n");
$CPAN::Frontend->mysleep(2);
next;
} elsif ($meth eq "ls") {
CPAN->debug(qq{pragma[@pragma]meth[$meth]}.
qq{ID[$obj->{ID}]}) if $CPAN::DEBUG;
+ push @qcopy, $obj;
if ($obj->$meth()){
CPAN::Queue->delete($s);
} else {
sub make {
my($self) = @_;
my $make = $self->{modulebuild} ? "Build" : "make";
- $CPAN::Frontend->myprint(sprintf "Running %s for %s\n", $make, $self->id);
# Emergency brake if they said install Pippi and get newest perl
if ($self->isa_perl) {
if (
! $self->{force_update}
) {
# if we die here, we break bundles
- $CPAN::Frontend->mywarn(sprintf qq{
-The most recent version "%s" of the module "%s"
-comes with the current version of perl (%s).
-I\'ll build that only if you ask for something like
- force install %s
-or
- install %s
+ $CPAN::Frontend
+ ->mywarn(sprintf(
+ qq{The most recent version "%s" of the module "%s"
+is part of the perl-%s distribution. To install that, you need to run
+ force install %s --or--
+ install %s
},
- $CPAN::META->instance(
- 'CPAN::Module',
- $self->called_for
- )->cpan_version,
- $self->called_for,
- $self->isa_perl,
- $self->called_for,
- $self->id);
+ $CPAN::META->instance(
+ 'CPAN::Module',
+ $self->called_for
+ )->cpan_version,
+ $self->called_for,
+ $self->isa_perl,
+ $self->called_for,
+ $self->id,
+ ));
$self->{make} = CPAN::Distrostatus->new("NO isa perl");
$CPAN::Frontend->mysleep(1);
return;
}
}
+ $CPAN::Frontend->myprint(sprintf "Running %s for %s\n", $make, $self->id);
$self->get;
if ($CPAN::Signal){
delete $self->{force_update};
c => "commandline",
);
$CPAN::Frontend->
- myprint("---- Unsatisfied dependencies detected ".
- "during [$id] -----\n".
+ myprint("---- Unsatisfied dependencies detected during\n".
+ "---- $id\n".
join("", map {" $_->[0] \[$map{$_->[1]}]\n"} @prereq_tuples),
);
my $follow = 0;
}
} elsif (-f "Build") {
if ($CPAN::META->has_inst("Module::Build")) {
- $req = Module::Build->current->requires();
- $breq = Module::Build->current->build_requires();
+ eval {
+ $req = Module::Build->current->requires();
+ $breq = Module::Build->current->build_requires();
+ };
+ if ($@) {
+ # HTML::Mason prompted for this with bleadperl@28900 or so
+ $CPAN::Frontend
+ ->mywarn(
+ sprintf("Warning: while trying to determine ".
+ "prerequisites for %s with the help of ".
+ "Module::Build the following error ".
+ "occurred: '%s'\n\nCannot care for prerequisites\n",
+ $self->id,
+ $@
+ ));
+ $self->{prereq_pm_detected}++;
+ return $self->{prereq_pm} = {requires=>{},build_requires=>{}};
+ }
}
}
}
$self->{make} =~ /^NO/
) and push @e, "Can't test without successful make";
- exists $self->{build_dir} or push @e, "Has no own directory";
$self->{badtestcnt} ||= 0;
$self->{badtestcnt} > 0 and
push @e, "Won't repeat unsuccessful test during this command";
exists $self->{later} and length($self->{later}) and
push @e, $self->{later};
- if ($CPAN::META->{is_tested}{$self->{build_dir}}
- &&
- exists $self->{make_test}
- &&
- !(
- $self->{make_test}->can("failed") ?
- $self->{make_test}->failed :
- $self->{make_test} =~ /^NO/
- )
- ) {
- push @e, "Already tested successfully";
+ if (exists $self->{build_dir}) {
+ if ($CPAN::META->{is_tested}{$self->{build_dir}}
+ &&
+ exists $self->{make_test}
+ &&
+ !(
+ $self->{make_test}->can("failed") ?
+ $self->{make_test}->failed :
+ $self->{make_test} =~ /^NO/
+ )
+ ) {
+ push @e, "Already tested successfully";
+ }
+ } elsif (!@e) {
+ push @e, "Has no own directory";
}
$CPAN::Frontend->myprint(join "", map {" $_\n"} @e) and return if @e;
my $tests_ok;
if ( $CPAN::Config->{test_report} &&
$CPAN::META->has_inst("CPAN::Reporter") ) {
- $tests_ok = CPAN::Reporter::test($self, $system);
+ $tests_ok = CPAN::Reporter::test($self, $system);
} else {
- $tests_ok = system($system) == 0;
+ $tests_ok = system($system) == 0;
}
if ( $tests_ok ) {
- $CPAN::Frontend->myprint(" $system -- OK\n");
- $CPAN::META->is_tested($self->{'build_dir'});
- $self->{make_test} = CPAN::Distrostatus->new("YES");
+ {
+ my @prereq;
+ for my $m (keys %{$self->{sponsored_mods}}) {
+ my $m_obj = CPAN::Shell->expand("Module",$m);
+ if (!$m_obj->distribution->{make_test}
+ ||
+ $m_obj->distribution->{make_test}->failed){
+ #$m_obj->dump;
+ push @prereq, $m;
+ }
+ }
+ if (@prereq){
+ my $cnt = @prereq;
+ my $which = join ",", @prereq;
+ my $verb = $cnt == 1 ? "one dependency not OK ($which)" :
+ "$cnt dependencies missing ($which)";
+ $CPAN::Frontend->mywarn("Tests succeeded but $verb\n");
+ $self->{make_test} = CPAN::Distrostatus->new("NO -- $verb");
+ return;
+ }
+ }
+
+ $CPAN::Frontend->myprint(" $system -- OK\n");
+ $CPAN::META->is_tested($self->{'build_dir'});
+ $self->{make_test} = CPAN::Distrostatus->new("YES");
} else {
- $self->{make_test} = CPAN::Distrostatus->new("NO");
- $self->{badtestcnt}++;
- $CPAN::Frontend->mywarn(" $system -- NOT OK\n");
+ $self->{make_test} = CPAN::Distrostatus->new("NO");
+ $self->{badtestcnt}++;
+ $CPAN::Frontend->mywarn(" $system -- NOT OK\n");
}
}
$CPAN::Frontend->myprint("Running $make install\n");
EXCUSE: {
my @e;
- exists $self->{build_dir} or push @e, "Has no own directory";
-
unless (exists $self->{make} or exists $self->{later}) {
push @e,
"Make had some problems, won't install";
$self->{make}->failed :
$self->{make} =~ /^NO/
) and
- push @e, "make had returned bad status, install seems impossible";
+ push @e, "Make had returned bad status, install seems impossible";
+
+ if (exists $self->{build_dir}) {
+ } elsif (!@e) {
+ push @e, "Has no own directory";
+ }
if (exists $self->{make_test} and
(
my($stderr) = $^O eq "MSWin32" ? "" : " 2>&1 ";
$CPAN::Config->{build_requires_install_policy}||="ask/yes";
my $id = $self->id;
- my $reqtype = $self->{reqtype};
- unless ($reqtype) {
- $CPAN::Frontend->mywarn("Unknown require type for '$id', setting to 'r'. ".
- "This should not happen and is construed a bug.\n");
- $reqtype = "r";
- }
+ my $reqtype = $self->{reqtype} ||= "c"; # in doubt it was a command
my $want_install = "yes";
if ($reqtype eq "b") {
if ($CPAN::Config->{build_requires_install_policy} eq "no") {
#-> sub CPAN::Module::rematein ;
sub rematein {
my($self,$meth) = @_;
- $CPAN::Frontend->myprint(sprintf("Running %s for module %s\n",
+ $CPAN::Frontend->myprint(sprintf("Running %s for module '%s'\n",
$meth,
$self->id));
my $cpan_file = $self->cpan_file;
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 6b31a7d5e222880c5d1f3b52758d46ed186e9784 ChangeLog
+SHA1 615a0770e25c66c7ea0ab28d856f68fd44a804e5 ChangeLog
SHA1 9b97524a7a91c815e46b19302a33829d3c26bbbf ChangeLog.old
-SHA1 d07abcd12ef7ee717592607dadd79fc64ab0cd15 Changes
+SHA1 dedf79cf37a65e0cf39c868baab61345fafe3009 Changes
SHA1 a029ffa2f2252bb8914eb658666244710994d256 Changes.old
-SHA1 bcac708d887442591ac400c72a6be0629f416434 MANIFEST
-SHA1 159c257eb8d294fa6e0612fda7edcad948ab0362 MANIFEST.SKIP
-SHA1 41f58cb5008281bb0d6954a4131e1301f084d980 META.yml
-SHA1 f428cf9c8f7206fe115a1f42e13da5999452d075 Makefile.PL
+SHA1 ee8bd2cd2dfb8c4c6d22356e75fa4bc142818888 MANIFEST
+SHA1 fb3d28505ba410871467e5c86024ee96658b99d8 MANIFEST.SKIP
+SHA1 9bcd203e50b0279420b9074cb63a558f93ea928a META.yml
+SHA1 78ba89cb99753ada11899f82021c8dd0769baeb4 Makefile.PL
SHA1 37e858c51409a297ef5d3fb35dc57cd3b57f9a4d PAUSE2003.pub
SHA1 af016003ad503ed078c5f8254521d13a3e0c494f PAUSE2005.pub
SHA1 07fc8068a27f362219008d279729e96eb5fe9d89 README
-SHA1 76a7fd2eaec46c78f269da06766dc76b974b7339 Todo
+SHA1 c049ef27c30df077fb0292fb523a430716daa1c3 Todo
SHA1 efbe8e6882a2caa0d741b113959a706830ab5882 inc/Test/Builder.pm
SHA1 ae1d68262bedc2475e2c6fd478d99b259b4fb109 inc/Test/More.pm
-SHA1 a6a24e27778fcc9dfb12c190e6369cfbd001f25b lib/CPAN.pm
+SHA1 d9c63de192370f85c40b557375086a9566099d20 lib/CPAN.pm
SHA1 e093af1fcd72420fe4bdc85a5bec2b92a301ab97 lib/CPAN/Admin.pm
SHA1 aa9e4d9384c88c55f9f457e2c2123242d7989406 lib/CPAN/Debug.pm
SHA1 9af992904cb4445c306ecf8f7675478865f66c1e lib/CPAN/FirstTime.pm
-SHA1 c1170925e60ffcc14025b975997930a5f3eb6f7b lib/CPAN/HandleConfig.pm
+SHA1 b9aee0537dfde5bf86f01535adcfd5bed6f78cbf lib/CPAN/HandleConfig.pm
SHA1 17a1ad839531642ace9bf198bf52964c252f3318 lib/CPAN/Nox.pm
-SHA1 4992722f9e21d4c8f450cf96887b1e82f628b66c lib/CPAN/Queue.pm
+SHA1 caeaa439558a19b64119321aa9105980928862f5 lib/CPAN/Queue.pm
SHA1 fc6de4175a275a4c6791091f2ffcee2636a4a0f2 lib/CPAN/Tarzip.pm
SHA1 9498e9ed9da55227715a049692677b75e825adca lib/CPAN/Version.pm
SHA1 fb08e07d8740ef36e8ab719c6a9b7e89c4fe674a scripts/cpan
SHA1 325d8a2f72d59c4cd2400c72403c05cd614c3abc t/11mirroredby.t
SHA1 7696ade95e8c4943a3e3e6a13c03c450cec8d030 t/12cpan.t
SHA1 fa075e989a5923e73684d13d5e94baa0711bb360 t/30shell.coverage
-SHA1 3d2f626c0a5c86bd0c3fa61aece5ee2700554758 t/30shell.t
+SHA1 417e435c2deca1aa33142b4f45c135a1f61855dd t/30shell.t
SHA1 6a79f15a10337bd3450604abf39d4462df2a550b t/50pod.t
SHA1 6c194eb30cce245737fe5e1a35118ed78abae0d1 t/51pod.t
SHA1 c98f4c2aa680bb0e88569f6ab4a9ca4e8deb5c1e t/52podcover.t
SHA1 310b5562df76ff28ab05d741e144d84fb5b5369b t/CPAN/TestConfig.pm
SHA1 081ed556ae14a75c43ca31e67cfc99d180c9ef41 t/CPAN/TestMirroredBy
SHA1 b4fd27234696da334ac6a1716222c70610a98c3a t/CPAN/authors/01mailrc.txt
-SHA1 fa94efff2de87bf316ff21c2f972355d2d966b0c t/CPAN/authors/id/A/AN/ANDK/CHECKSUMS
+SHA1 957c072e4be15cf3853789558de72f45fd36c2dd t/CPAN/authors/id/A/AN/ANDK/CHECKSUMS
SHA1 d1a101f24d2d0719c9991df28ede729d58005bb4 t/CPAN/authors/id/A/AN/ANDK/CHECKSUMS@588
-SHA1 f02f801c427f4efa21a7a86433aa0d4a8a45e35d t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Build-1.02.tar.gz
-SHA1 11f35aa730e452797f5d7371a393e24e40ea8d21 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Build-Fails-1.01.tar.gz
+SHA1 34cf1bf9c95007fe02a4b4f4977eb017516b0cdc t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Build-1.03.tar.gz
+SHA1 7b340bac6eab5d3cf00054185f7b69cca600a76b t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Build-DepeFails-1.01.tar.gz
+SHA1 ec68bb3a9f0993b301e25fb04b0e03f67474fb7e t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Build-Fails-1.02.tar.gz
SHA1 c0587c6180bd979acfa2b2396688208793366ff5 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-BuildOrMake-1.01.tar.gz
-SHA1 ab7949c878bee53584fcaa280ce7e173bcccd55e t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-1.03.tar.gz
+SHA1 312bcda6aa730093c45bcc08ef8595652b6e179e t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-1.04.tar.gz
SHA1 3dc672ec2542810513b26e306a6545bfee069654 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-Failearly-1.01.tar.gz
SHA1 ebf211b8f5907f9f008abbc756cb0b5a962b9395 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-Zip-1.02.zip
SHA1 541ac9311d4dbabe9bb99d770b221456798be688 t/CPAN/authors/id/A/AN/ANDK/NotInChecksums-0.000.tar.gz
SHA1 1aee1bed21f0e9755d693419e810ec75543eb0b7 t/CPAN/authors/id/A/AN/CHECKSUMS
SHA1 1f3304f219bf0da4db6a60f638e11b61c2c2f4c0 t/CPAN/authors/id/A/CHECKSUMS
SHA1 dfc900f5bfbc9683fa91977a1c7198222fbd4452 t/CPAN/authors/id/CHECKSUMS
-SHA1 f73a986b44f38e126e4c8a50289d5537d80581e8 t/CPAN/modules/02packages.details.txt
+SHA1 b0d72edf855ecb3a47c4e73a3b62dd8100f23114 t/CPAN/modules/02packages.details.txt
SHA1 f4c1a524de16347b37df6427ca01f98dd27f3c81 t/CPAN/modules/03modlist.data
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
-iD8DBQFFIjIj7IA58KMXwV0RAidhAJ9x6UiFYhaKWBORJxsSvnMc6Jno/ACcClyR
-tkNXFaGx9iPcX6f2Xfh4D7A=
-=zuVm
+iD8DBQFFKqKl7IA58KMXwV0RAqwhAKCJEIYlsGcacWTw3yZmgxQPiD/nUwCg1qeg
+JCQO0aOgrEQv5H0Fo9uk//g=
+=ZJnm
-----END PGP SIGNATURE-----