summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2006-09-16 20:19:08 +0000
committerSteve Peters <steve@fisharerojo.org>2006-09-16 20:19:08 +0000
commit26844e2782d7192ed739172c5303bb52947596dc (patch)
tree0f9d3609ef25fc9391c60929fb924f45df68ec29 /lib
parent5331dc36ff75dd675f9cf557881282295fb8c2c6 (diff)
downloadperl-26844e2782d7192ed739172c5303bb52947596dc.tar.gz
Upgrade to CPAN-CPAN-1.87_64
p4raw-id: //depot/perl@28857
Diffstat (limited to 'lib')
-rw-r--r--lib/CPAN/Debug.pm10
-rw-r--r--lib/CPAN/FirstTime.pm58
-rw-r--r--lib/CPAN/HandleConfig.pm27
-rw-r--r--lib/CPAN/Nox.pm7
-rw-r--r--lib/CPAN/SIGNATURE41
-rw-r--r--lib/CPAN/Tarzip.pm10
-rw-r--r--lib/CPAN/Version.pm75
7 files changed, 150 insertions, 78 deletions
diff --git a/lib/CPAN/Debug.pm b/lib/CPAN/Debug.pm
index 489c53fe56..47c9a207ff 100644
--- a/lib/CPAN/Debug.pm
+++ b/lib/CPAN/Debug.pm
@@ -2,7 +2,7 @@ package CPAN::Debug;
use strict;
use vars qw($VERSION);
-$VERSION = sprintf "%.6f", substr(q$Rev: 561 $,4)/1000000 + 5.4;
+$VERSION = sprintf "%.6f", substr(q$Rev: 844 $,4)/1000000 + 5.4;
# module is internal to CPAN.pm
%CPAN::DEBUG = qw[
@@ -53,3 +53,11 @@ sub debug {
}
1;
+
+__END__
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
diff --git a/lib/CPAN/FirstTime.pm b/lib/CPAN/FirstTime.pm
index e12f5e79a5..4ec7afc8d8 100644
--- a/lib/CPAN/FirstTime.pm
+++ b/lib/CPAN/FirstTime.pm
@@ -2,7 +2,7 @@
package CPAN::Mirrored::By;
use strict;
use vars qw($VERSION);
-$VERSION = sprintf "%.6f", substr(q$Rev: 825 $,4)/1000000 + 5.4;
+$VERSION = sprintf "%.6f", substr(q$Rev: 848 $,4)/1000000 + 5.4;
sub new {
my($self,@arg) = @_;
@@ -21,7 +21,7 @@ use File::Basename ();
use File::Path ();
use File::Spec;
use vars qw($VERSION $urllist);
-$VERSION = sprintf "%.6f", substr(q$Rev: 825 $,4)/1000000 + 5.4;
+$VERSION = sprintf "%.6f", substr(q$Rev: 848 $,4)/1000000 + 5.4;
=head1 NAME
@@ -36,6 +36,10 @@ CPAN::FirstTime::init()
The init routine asks a few questions and writes a CPAN/Config.pm or
CPAN/MyConfig.pm file (depending on what it is currently using).
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
=cut
@@ -44,17 +48,27 @@ use vars qw( %prompts );
sub init {
my($configpm, %args) = @_;
use Config;
- # extra arg in 'o conf init make' selects only $item =~ /make/
+ # extra args after 'o conf init'
my $matcher = $args{args} && @{$args{args}} ? $args{args}[0] : '';
- if ($matcher =~ /^\w+$/) {
- if (
- exists $CPAN::HandleConfig::keys{$matcher}
- ) {
- $matcher = "\\b$matcher\\b";
- } else {
- $CPAN::Frontend->myprint("'$matcher' is not a valid configuration variable");
- return;
+ if ($matcher =~ /^\/(.*)\/$/) {
+ # case /regex/ => take the first, ignore the rest
+ $matcher = $1;
+ shift @{$args{args}};
+ if (@{$args{args}}) {
+ local $" = " ";
+ $CPAN::Frontend->mywarn("Ignoring excessive arguments '@{$args{args}}'");
+ $CPAN::Frontend->mysleep(2);
+ }
+ } elsif (0 == length $matcher) {
+ } else {
+ # case WORD... => all arguments must be valid
+ for my $arg (@{$args{args}}) {
+ unless (exists $CPAN::HandleConfig::keys{$arg}) {
+ $CPAN::Frontend->mywarn("'$arg' is not a valid configuration variable");
+ return;
+ }
}
+ $matcher = "\\b(".join("|",@{$args{args}}).")\\b";
}
CPAN->debug("matcher[$matcher]") if $CPAN::DEBUG;
@@ -679,10 +693,11 @@ sub picklist {
@nums = grep { !$seen{$_}++ } @nums;
}
my $i = scalar @$items;
+ unrangify(\@nums);
if (grep (/\D/ || $_ < 1 || $_ > $i, @nums)){
$CPAN::Frontend->mywarn("invalid items entered, try again\n");
if ("@nums" =~ /\D/) {
- $CPAN::Frontend->mywarn("(we are expecting at least one number between 1 and $i)\n");
+ $CPAN::Frontend->mywarn("(we are expecting only numbers between 1 and $i)\n");
}
next SELECTION;
}
@@ -699,6 +714,22 @@ sub picklist {
@{$items}[@nums];
}
+sub unrangify ($) {
+ my($nums) = $_[0];
+ my @nums2 = ();
+ while (@{$nums||[]}) {
+ my $n = shift @$nums;
+ if ($n =~ /^(\d+)-(\d+)$/) {
+ my @range = $1 .. $2;
+ # warn "range[@range]";
+ push @nums2, @range;
+ } else {
+ push @nums2, $n;
+ }
+ }
+ push @$nums, @nums2;
+}
+
sub display_some {
my ($items, $limit, $pos, $default) = @_;
$pos ||= 0;
@@ -790,7 +821,8 @@ sub read_mirrored_by {
}
push (@urls, map ("$_ (previous pick)", @previous_urls));
my $prompt = "Select as many URLs as you like (by number),
-put them on one line, separated by blanks, e.g. '1 4 5'";
+put them on one line, separated by blanks, hyphenated ranges allowed
+ e.g. '1 4 5' or '7 1-4 8'";
if (@previous_urls) {
$default = join (' ', ((scalar @urls) - (scalar @previous_urls) + 1) ..
(scalar @urls));
diff --git a/lib/CPAN/HandleConfig.pm b/lib/CPAN/HandleConfig.pm
index 7c20fb88bf..f97bb702ac 100644
--- a/lib/CPAN/HandleConfig.pm
+++ b/lib/CPAN/HandleConfig.pm
@@ -2,7 +2,7 @@ package CPAN::HandleConfig;
use strict;
use vars qw(%can %keys $VERSION);
-$VERSION = sprintf "%.6f", substr(q$Rev: 826 $,4)/1000000 + 5.4;
+$VERSION = sprintf "%.6f", substr(q$Rev: 847 $,4)/1000000 + 5.4;
%can = (
commit => "Commit changes to disk",
@@ -22,6 +22,7 @@ $VERSION = sprintf "%.6f", substr(q$Rev: 826 $,4)/1000000 + 5.4;
"colorize_print",
"colorize_warn",
"commandnumber_in_prompt",
+ "commands_quote",
"cpan_home",
"curl",
"dontload_hash", # deprecated after 1.83_68 (rev. 581)
@@ -278,9 +279,11 @@ sub defaults {
my($self) = @_;
my $done;
for my $config (qw(CPAN/MyConfig.pm CPAN/Config.pm)) {
- CPAN::Shell->reload_this($config) and $done++;
- $CPAN::Frontend->myprint("'$config' reread\n");
- last if $done;
+ if ($INC{$config}) {
+ CPAN::Shell->reload_this($config);
+ $CPAN::Frontend->myprint("'$INC{$config}' reread\n");
+ last;
+ }
}
1;
}
@@ -460,7 +463,7 @@ the following indispensable but missing parameters:
@miss
END
- $args{args} = ["\\b".join("|",@miss)."\\b"];
+ $args{args} = \@miss;
}
if (0) {
# where do we need this?
@@ -512,7 +515,7 @@ Known options:
commit commit session changes to disk
defaults reload default config values from disk
help this help
- init go through a dialog to set all parameters
+ init enter a dialog to set all or a set of parameters
Edit key values as in the following (the "o" is a literal letter o):
o conf build_cache 15
@@ -549,7 +552,7 @@ sub cpl {
(
@words == 3
||
- @words == 4 && length($word)
+ @words >= 4 && length($word)
)) {
return sort grep /^\Q$word\E/, keys %keys;
} elsif (@words >= 4) {
@@ -576,7 +579,7 @@ package
use strict;
use vars qw($AUTOLOAD $VERSION);
-$VERSION = sprintf "%.2f", substr(q$Rev: 826 $,4)/100;
+$VERSION = sprintf "%.2f", substr(q$Rev: 847 $,4)/100;
# formerly CPAN::HandleConfig was known as CPAN::Config
sub AUTOLOAD {
@@ -589,6 +592,14 @@ sub AUTOLOAD {
1;
__END__
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
diff --git a/lib/CPAN/Nox.pm b/lib/CPAN/Nox.pm
index 41bedf36f8..a0abf1649f 100644
--- a/lib/CPAN/Nox.pm
+++ b/lib/CPAN/Nox.pm
@@ -9,7 +9,7 @@ BEGIN{
use base 'Exporter';
use CPAN;
-$VERSION = sprintf "%.6f", substr(q$Rev: 561 $,4)/1000000 + 5.4;
+$VERSION = sprintf "%.6f", substr(q$Rev: 844 $,4)/1000000 + 5.4;
$CPAN::META->has_inst('Digest::MD5','no');
$CPAN::META->has_inst('LWP','no');
$CPAN::META->has_inst('Compress::Zlib','no');
@@ -38,6 +38,11 @@ prevent the usage of compiled extensions during its own
execution. Its primary purpose is a rescue in case you upgraded perl
and broke binary compatibility somehow.
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
=head1 SEE ALSO
CPAN(3)
diff --git a/lib/CPAN/SIGNATURE b/lib/CPAN/SIGNATURE
index 5f7eb1cedf..66583bec92 100644
--- a/lib/CPAN/SIGNATURE
+++ b/lib/CPAN/SIGNATURE
@@ -14,28 +14,28 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 c1f086c9206f4729fe7ef7d493505d07bed4fa7a ChangeLog
+SHA1 53572d7d908d436595023a605cb71a7cef4a4d3b ChangeLog
SHA1 9b97524a7a91c815e46b19302a33829d3c26bbbf ChangeLog.old
-SHA1 545b6909636d6adf90bfd162f9bb9732aaf2a0e1 Changes
+SHA1 6317b96f33296dc730e29c6dfd31f3bac9892dae Changes
SHA1 a029ffa2f2252bb8914eb658666244710994d256 Changes.old
-SHA1 4532f91d1cd45d5b948accca01ad7bbf85e84655 MANIFEST
+SHA1 da26a42af413fe2a87b6023ff03e800a399ae306 MANIFEST
SHA1 d6facfb968686d74e249cc1e45463e61ff18d026 MANIFEST.SKIP
-SHA1 719358543d1bf6a168089c5bb24acf703dc1ae6f META.yml
-SHA1 984a2dfcaff9e737b974a011e29923bcb43d7181 Makefile.PL
+SHA1 679b0f527622b11b762bd33943a7caa4cf170da3 META.yml
+SHA1 64ba3f2a3bd7fba22ff64028805e1ef7452b8a19 Makefile.PL
SHA1 37e858c51409a297ef5d3fb35dc57cd3b57f9a4d PAUSE2003.pub
SHA1 af016003ad503ed078c5f8254521d13a3e0c494f PAUSE2005.pub
-SHA1 aab32a4021a35d0a293b30477ad83490e3c5c623 README
-SHA1 014ca984524ca8966f847551fbf6191407b680da Todo
+SHA1 97f6ee57e6176480d86684b3edf7211dad9db822 README
+SHA1 6193cb7204ce1853d414ba3703521332dadce8bd Todo
SHA1 efbe8e6882a2caa0d741b113959a706830ab5882 inc/Test/Builder.pm
SHA1 ae1d68262bedc2475e2c6fd478d99b259b4fb109 inc/Test/More.pm
-SHA1 d9de09fb815c7edf6358e627c710024e29088c82 lib/CPAN.pm
-SHA1 94c4656fdae231c673719978e6e9a460f2dfc794 lib/CPAN/Admin.pm
-SHA1 8884e4b1932555e7d2f52d1df62097e8c78bb548 lib/CPAN/Debug.pm
-SHA1 bb7654424b4fe6739f3abc1d10a10bbd848d0476 lib/CPAN/FirstTime.pm
-SHA1 19694adf9394a3462516973d2c77bd2bdff93343 lib/CPAN/HandleConfig.pm
-SHA1 f7b20d828c197710b4eac3029a30266242fb782b lib/CPAN/Nox.pm
-SHA1 e7fe16eb17c3a987a7f504deca3f6cca4d5ea4ae lib/CPAN/Tarzip.pm
-SHA1 4d60b4782a851767c40dc27825057e584014cfc5 lib/CPAN/Version.pm
+SHA1 f8d74d9fde300434f06dc4e765f52321ad502f59 lib/CPAN.pm
+SHA1 e093af1fcd72420fe4bdc85a5bec2b92a301ab97 lib/CPAN/Admin.pm
+SHA1 32e2db285ecb303ed825193d9273fd306d801482 lib/CPAN/Debug.pm
+SHA1 b898f54ac98dcc712e052551e8c8dbd912cd2e91 lib/CPAN/FirstTime.pm
+SHA1 898d6e7a18dc24db32b8b3c38248fd673349089d lib/CPAN/HandleConfig.pm
+SHA1 17a1ad839531642ace9bf198bf52964c252f3318 lib/CPAN/Nox.pm
+SHA1 c606ab2b7e18287c9e23fc4dbfbf224734e984ba lib/CPAN/Tarzip.pm
+SHA1 04a0f916787adc090aa4c1423419629370e9357f lib/CPAN/Version.pm
SHA1 fb08e07d8740ef36e8ab719c6a9b7e89c4fe674a scripts/cpan
SHA1 2a3adebb8252dc893681d17460082c2e08aa144a t/00signature.t
SHA1 215dace24b507de20011d36cbe2d16ddea78bcf3 t/01loadme.t
@@ -45,11 +45,14 @@ SHA1 ebdb653877d5c5e5a071fe9933b18f018cde3250 t/10version.t
SHA1 325d8a2f72d59c4cd2400c72403c05cd614c3abc t/11mirroredby.t
SHA1 7696ade95e8c4943a3e3e6a13c03c450cec8d030 t/12cpan.t
SHA1 fa075e989a5923e73684d13d5e94baa0711bb360 t/30shell.pod
-SHA1 bcab03a2c450d4bf3dd104607dc8ed32ff55aa2d t/30shell.t
+SHA1 0e473540c2770599b6d29b447f8dfc4654fe2be1 t/30shell.t
SHA1 6a79f15a10337bd3450604abf39d4462df2a550b t/50pod.t
+SHA1 15571553f41c5a709ab0901c17a713f8792c1e59 t/51pod.t
+SHA1 0890cfccb8d1d026a7f142df290ac5b4e64f5e56 t/52podcover.t
SHA1 413dd29cf8968e69292a2d652e0e0496a8137a01 t/60credentials.t
SHA1 7efe930efd0a07d8101679ed15d4700dcf208137 t/CPAN/CpanTestDummies-1.55.pm
SHA1 310b5562df76ff28ab05d741e144d84fb5b5369b t/CPAN/TestConfig.pm
+SHA1 081ed556ae14a75c43ca31e67cfc99d180c9ef41 t/CPAN/TestMirroredBy
SHA1 b4fd27234696da334ac6a1716222c70610a98c3a t/CPAN/authors/01mailrc.txt
SHA1 61f6dbc7e5616028952b07a0451e029d41993bb6 t/CPAN/authors/id/A/AN/ANDK/CHECKSUMS
SHA1 d1a101f24d2d0719c9991df28ede729d58005bb4 t/CPAN/authors/id/A/AN/ANDK/CHECKSUMS@588
@@ -69,7 +72,7 @@ SHA1 7336c3b0b4cd33505e02a11c5a09c3c35fe7bc32 t/README.shell.txt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
-iD8DBQFFB5o67IA58KMXwV0RAtSbAKClbKV81vLX1EMW4jB3SmUCP9gcdQCg2t9F
-JhIJtTJHV3mhebX2cwJ37gQ=
-=3GM3
+iD8DBQFFC9lV7IA58KMXwV0RArjxAJ4p06+APj/p8NKzkPJ4J2ZoJyxrmwCbBxy8
+k8M2zkICjnWa0aAd0Dzmjv0=
+=7ggs
-----END PGP SIGNATURE-----
diff --git a/lib/CPAN/Tarzip.pm b/lib/CPAN/Tarzip.pm
index b5005dd8fd..860faf0b5c 100644
--- a/lib/CPAN/Tarzip.pm
+++ b/lib/CPAN/Tarzip.pm
@@ -4,7 +4,7 @@ use strict;
use vars qw($VERSION @ISA $BUGHUNTING);
use CPAN::Debug;
use File::Basename ();
-$VERSION = sprintf "%.6f", substr(q$Rev: 714 $,4)/1000000 + 5.4;
+$VERSION = sprintf "%.6f", substr(q$Rev: 844 $,4)/1000000 + 5.4;
# module is internal to CPAN.pm
@ISA = qw(CPAN::Debug);
@@ -331,3 +331,11 @@ sub unzip {
1;
+__END__
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
diff --git a/lib/CPAN/Version.pm b/lib/CPAN/Version.pm
index 1de82493b4..04f3780926 100644
--- a/lib/CPAN/Version.pm
+++ b/lib/CPAN/Version.pm
@@ -1,42 +1,8 @@
-=head1 NAME
-
-CPAN::Version - utility functions to compare CPAN versions
-
-=head1 SYNOPSIS
-
- use CPAN::Version;
-
- CPAN::Version->vgt("1.1","1.1.1"); # 1 bc. 1.1 > 1.001001
-
- CPAN::Version->vlt("1.1","1.1"); # 0 bc. 1.1 not < 1.1
-
- CPAN::Version->vcmp("1.1","1.1.1"); # 1 bc. first is larger
-
- CPAN::Version->vcmp("1.1.1","1.1"); # -1 bc. first is smaller
-
- CPAN::Version->readable(v1.2.3); # "v1.2.3"
-
- CPAN::Version->vstring("v1.2.3"); # v1.2.3
-
- CPAN::Version->float2vv(1.002003); # "v1.2.3"
-
-=head1 DESCRIPTION
-
-This module mediates between some version that perl sees in a package
-and the version that is published by the CPAN indexer.
-
-It's only written as a helper module for both CPAN.pm and CPANPLUS.pm.
-
-As it stands it predates version.pm but has the same goal: make
-version strings visible and comparable.
-
-=cut
-
package CPAN::Version;
use strict;
use vars qw($VERSION);
-$VERSION = sprintf "%.6f", substr(q$Rev: 561 $,4)/1000000 + 5.4;
+$VERSION = sprintf "%.6f", substr(q$Rev: 844 $,4)/1000000 + 5.4;
# CPAN::Version::vcmp courtesy Jost Krieger
sub vcmp {
@@ -138,6 +104,45 @@ sub readable {
__END__
+=head1 NAME
+
+CPAN::Version - utility functions to compare CPAN versions
+
+=head1 SYNOPSIS
+
+ use CPAN::Version;
+
+ CPAN::Version->vgt("1.1","1.1.1"); # 1 bc. 1.1 > 1.001001
+
+ CPAN::Version->vlt("1.1","1.1"); # 0 bc. 1.1 not < 1.1
+
+ CPAN::Version->vcmp("1.1","1.1.1"); # 1 bc. first is larger
+
+ CPAN::Version->vcmp("1.1.1","1.1"); # -1 bc. first is smaller
+
+ CPAN::Version->readable(v1.2.3); # "v1.2.3"
+
+ CPAN::Version->vstring("v1.2.3"); # v1.2.3
+
+ CPAN::Version->float2vv(1.002003); # "v1.2.3"
+
+=head1 DESCRIPTION
+
+This module mediates between some version that perl sees in a package
+and the version that is published by the CPAN indexer.
+
+It's only written as a helper module for both CPAN.pm and CPANPLUS.pm.
+
+As it stands it predates version.pm but has the same goal: make
+version strings visible and comparable.
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 2