[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-changes
Subject:    Change 33615: Integrate:
From:       Nicholas Clark <nwc10+p5p4 () colon ! colondot ! net>
Date:       2008-03-31 18:15:05
Message-ID: 20080331181505.40EFA50179 () mx ! activestate ! com
[Download RAW message or body]

Change 33615 by nicholas@mouse-mill on 2008/03/31 18:01:17

	Integrate:
	[ 33244]
	corelist changes:
	- Add a new -d option to find first perl version by date
	  and not by version number
	- Better handling of perl versions that end with a 0
	- use version.pm only for version numbers that have multiple dots
	
	[ 33503]
	Regexp::DESTROY was only added in 5.8.1

Affected files ...

... //depot/maint-5.10/perl/ext/Opcode/Safe.pm#5 integrate
... //depot/maint-5.10/perl/lib/Module/CoreList.pm#3 integrate
... //depot/maint-5.10/perl/lib/Module/CoreList/bin/corelist#2 integrate

Differences ...

==== //depot/maint-5.10/perl/ext/Opcode/Safe.pm#5 (text) ====
Index: perl/ext/Opcode/Safe.pm
--- perl/ext/Opcode/Safe.pm#4~33171~	2008-02-01 10:17:03.000000000 -0800
+++ perl/ext/Opcode/Safe.pm	2008-03-31 11:01:17.000000000 -0700
@@ -3,7 +3,7 @@
 use 5.003_11;
 use strict;
 
-$Safe::VERSION = "2.15";
+$Safe::VERSION = "2.16";
 
 # *** Don't declare any lexicals above this point ***
 #
@@ -46,7 +46,6 @@
 my $default_share = [qw[
     *_
     &PerlIO::get_layers
-    &Regexp::DESTROY
     &UNIVERSAL::isa
     &UNIVERSAL::can
     &UNIVERSAL::VERSION
@@ -58,7 +57,9 @@
     &utf8::downgrade
     &utf8::native_to_unicode
     &utf8::unicode_to_native
-], ($] >= 5.010 && qw[
+], ($] >= 5.008001 && qw[
+    &Regexp::DESTROY
+]), ($] >= 5.010 && qw[
     &re::is_regexp
     &re::regname
     &re::regnames

==== //depot/maint-5.10/perl/lib/Module/CoreList.pm#3 (text) ====
Index: perl/lib/Module/CoreList.pm
--- perl/lib/Module/CoreList.pm#2~33140~	2008-01-30 15:41:49.000000000 -0800
+++ perl/lib/Module/CoreList.pm	2008-03-31 11:01:17.000000000 -0700
@@ -1,7 +1,7 @@
 package Module::CoreList;
 use strict;
 use vars qw/$VERSION %released %patchlevel %version %families/;
-$VERSION = '2.13';
+$VERSION = '2.14';
 
 =head1 NAME
 
@@ -138,6 +138,11 @@
     return sort keys %mods
 }
 
+sub find_version {
+    my ($class, $v) = @_;
+    return $version{$v} if defined $version{$v};
+    return undef;
+}
 
 # when things escaped
 %released = (

==== //depot/maint-5.10/perl/lib/Module/CoreList/bin/corelist#2 (text) ====
Index: perl/lib/Module/CoreList/bin/corelist
--- perl/lib/Module/CoreList/bin/corelist#1~32694~	2007-12-22 01:23:09.000000000 -0800
+++ perl/lib/Module/CoreList/bin/corelist	2008-03-31 11:01:17.000000000 -0700
@@ -11,14 +11,14 @@
 =head1 SYNOPSIS
 
     corelist -v
-    corelist [-a] <ModuleName> | /<ModuleRegex>/ [<ModuleVersion>] ...
+    corelist [-a|-d] <ModuleName> | /<ModuleRegex>/ [<ModuleVersion>] ...
     corelist [-v <PerlVersion>] [ <ModuleName> | /<ModuleRegex>/ ] ...
 
 =head1 OPTIONS
 
 =over
 
-=item -a modulename
+=item -a
 
 lists all versions of the given module (or the matching modules, in case you
 used a module regexp) in the perls Module::CoreList knows about.
@@ -44,6 +44,11 @@
       5.009002   1.04
       5.009003   1.06
 
+=item -d
+
+finds the first perl version where a module has been released by
+date, and not by version number (as is the default).
+
 =item -? or -help
 
 help! help! help! to see more help, try --man.
@@ -79,7 +84,7 @@
 
 my %Opts;
 
-GetOptions(\%Opts, qw[ help|?! man! v|version:f a! ] );
+GetOptions(\%Opts, qw[ help|?! man! v|version:f a! d ] );
 
 pod2usage(1) if $Opts{help};
 pod2usage(-verbose=>2) if $Opts{man};
@@ -93,15 +98,16 @@
     }
 
     $Opts{v} = numify_version( $Opts{v} );
-    if( !exists $Module::CoreList::version{$Opts{v}} ) {
+    my $version_hash = Module::CoreList->find_version($Opts{v});
+    if( !$version_hash ) {
         print "\nModule::CoreList has no info on perl v$Opts{v}\n\n";
         exit 1;
     }
 
     if ( !@ARGV ) {
 	print "\nThe following modules were in perl v$Opts{v} CORE\n";
-	print "$_ ", $Module::CoreList::version{$Opts{v}}{$_} || " ","\n"
-	for sort keys %{$Module::CoreList::version{$Opts{v}}};
+	print "$_ ", $version_hash->{$_} || " ","\n"
+	for sort keys %$version_hash;
 	print "\n";
 	exit 0;
     }
@@ -149,12 +155,17 @@
     my($mod,$ver) = @_;
 
     if ( $Opts{v} ) {
-        return printf "  %-24s %-10s\n",
-            $mod,
-            $Module::CoreList::version{$Opts{v}}{$mod} || 'undef';
+	my $version_hash = Module::CoreList->find_version($Opts{v});
+	if ($version_hash) {
+	    print $mod, " ", $version_hash->{$mod} || 'undef', "\n";
+	    return;
+	}
+	else { die "Shouldn't happen" }
     }
 
-    my $ret = Module::CoreList->first_release(@_);
+    my $ret = $Opts{d}
+	? Module::CoreList->first_release_by_date(@_)
+	: Module::CoreList->first_release(@_);
     my $msg = $mod;
     $msg .= " $ver" if $ver;
 
@@ -184,13 +195,12 @@
 
 sub numify_version {
     my $ver = shift;
-    if ( index( $ver, q{.}, index( $ver, q{.} ) ) >= 0 ) {
-	eval { require version };
-	if ($@) {
-	    die "You need to install version.pm to use dotted version numbers\n";
-	}
+    if ($ver =~ /\..+\./) {
+	eval { require version ; 1 }
+	    or die "You need to install version.pm to use dotted version numbers\n";
         $ver = version->new($ver)->numify;
     }
+    $ver += 0;
     return $ver;
 }
 
End of Patch.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic