r3138 - in
/packages/libmodule-corelist-perl/branches/upstream/current:
Changes MANIFEST META.yml corelist lib/Module/CoreList.pm t/find_modules.t
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Tue Jun 20 09:38:22 UTC 2006
Author: eloy
Date: Tue Jun 20 09:38:19 2006
New Revision: 3138
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=3138
Log:
Load /tmp/tmp.vojOl18563/libmodule-corelist-perl-2.05 into
packages/libmodule-corelist-perl/branches/upstream/current.
Added:
packages/libmodule-corelist-perl/branches/upstream/current/t/find_modules.t
Modified:
packages/libmodule-corelist-perl/branches/upstream/current/Changes
packages/libmodule-corelist-perl/branches/upstream/current/MANIFEST
packages/libmodule-corelist-perl/branches/upstream/current/META.yml
packages/libmodule-corelist-perl/branches/upstream/current/corelist
packages/libmodule-corelist-perl/branches/upstream/current/lib/Module/CoreList.pm
Modified: packages/libmodule-corelist-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-corelist-perl/branches/upstream/current/Changes?rev=3138&op=diff
==============================================================================
--- packages/libmodule-corelist-perl/branches/upstream/current/Changes (original)
+++ packages/libmodule-corelist-perl/branches/upstream/current/Changes Tue Jun 20 09:38:19 2006
@@ -1,3 +1,8 @@
+2.05 Tue Jun 6 2006
+ Patches by Adriano Ferreira :
+ - corelist utility accepts regexes as arguments, eg. /IPC::Open/
+ - Errors when building regexes are trapped and warning is generated
+
2.04 Thursday 2nd February, 2006
Fix patchlevel for 5.8.8 (Gisle Aas)
Silence warnings in corelist utility
Modified: packages/libmodule-corelist-perl/branches/upstream/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-corelist-perl/branches/upstream/current/MANIFEST?rev=3138&op=diff
==============================================================================
--- packages/libmodule-corelist-perl/branches/upstream/current/MANIFEST (original)
+++ packages/libmodule-corelist-perl/branches/upstream/current/MANIFEST Tue Jun 20 09:38:19 2006
@@ -7,4 +7,5 @@
Makefile.PL
META.yml
t/corelist.t
+t/find_modules.t
t/pod.t
Modified: packages/libmodule-corelist-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-corelist-perl/branches/upstream/current/META.yml?rev=3138&op=diff
==============================================================================
--- packages/libmodule-corelist-perl/branches/upstream/current/META.yml (original)
+++ packages/libmodule-corelist-perl/branches/upstream/current/META.yml Tue Jun 20 09:38:19 2006
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Module-CoreList
-version: 2.04
+version: 2.05
version_from: lib/Module/CoreList.pm
installdirs: site
requires:
Modified: packages/libmodule-corelist-perl/branches/upstream/current/corelist
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-corelist-perl/branches/upstream/current/corelist?rev=3138&op=diff
==============================================================================
--- packages/libmodule-corelist-perl/branches/upstream/current/corelist (original)
+++ packages/libmodule-corelist-perl/branches/upstream/current/corelist Tue Jun 20 09:38:19 2006
@@ -10,7 +10,7 @@
=head1 SYNOPSIS
- corelist [-a] [ Modulename [ version ]] ...
+ corelist [-a] [ Modulename [ version ]] [ /Modulenameregex/ [ version ] ] ...
corelist [-v [ version ]]
=head1 OPTIONS
@@ -96,7 +96,29 @@
$mod = shift @ARGV;
$ver = (@ARGV && $ARGV[0] =~ /^\d/) ? shift @ARGV : "";
}
- module_version($mod,$ver);
+
+ if ($mod !~ m|^/(.*)/([imosx]*)$|) { # not a regex
+ module_version($mod,$ver);
+ } else {
+ my $re;
+ eval { $re = $2 ? qr/(?$2)($1)/ : qr/$1/; }; # trap exceptions while building regex
+ if ($@) {
+ # regex errors are usually like 'Quantifier follow nothing in regex; marked by ...'
+ # then we drop text after ';' to shorten message
+ my $errmsg = $@ =~ /(.*);/ ? $1 : $@;
+ warn "\n$mod is a bad regex: $errmsg\n";
+ next;
+ }
+ my @mod = Module::CoreList->find_modules($re);
+ if (@mod) {
+ module_version($_, $ver) for @mod;
+ } else {
+ $ver |= '';
+ print "\n$mod $ver has no match in CORE (or so I think)\n";
+ }
+
+ }
+
}
} else {
pod2usage(0);
@@ -155,6 +177,21 @@
File::Spec::Aliens was not in CORE (or so I think)
+ $ corelist /IPC::Open/
+
+ IPC::Open2 was first released with perl 5
+
+ IPC::Open3 was first released with perl 5
+
+ $ corelist /MANIFEST/i
+
+ ExtUtils::Manifest was first released with perl 5.001
+
+ $ corelist /Template/
+
+ /Template/ has no match in CORE (or so I think)
+
+
=head1 COPYRIGHT
Copyright (c) 2002-2006 by D.H. aka PodMaster
Modified: packages/libmodule-corelist-perl/branches/upstream/current/lib/Module/CoreList.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-corelist-perl/branches/upstream/current/lib/Module/CoreList.pm?rev=3138&op=diff
==============================================================================
--- packages/libmodule-corelist-perl/branches/upstream/current/lib/Module/CoreList.pm (original)
+++ packages/libmodule-corelist-perl/branches/upstream/current/lib/Module/CoreList.pm Tue Jun 20 09:38:19 2006
@@ -1,7 +1,7 @@
package Module::CoreList;
use strict;
use vars qw/$VERSION %released %patchlevel %version %families/;
-$VERSION = '2.04';
+$VERSION = '2.05';
=head1 NAME
@@ -15,6 +15,11 @@
print Module::CoreList->first_release('File::Spec'); # prints 5.00503
print Module::CoreList->first_release('File::Spec', 0.82); # prints 5.006001
+
+ print join ', ', Module::CoreList->find_modules(qr/Data/);
+ # prints 'Data::Dumper'
+ print join ', ', Module::CoreList->find_modules(qr/test::h.*::.*s/i, 5.008008);
+ # prints 'Test::Harness::Assert, Test::Harness::Straps'
print join ", ", @{ $Module::CoreList::families{5.005} };
# prints "5.005, 5.00503, 5.00504"
@@ -97,6 +102,21 @@
return unless @perls;
return (sort { $released{$a} cmp $released{$b} } @perls)[0];
+}
+
+sub find_modules {
+ my $discard = shift;
+ my $regex = shift;
+ my @perls = @_;
+ @perls = keys %version unless @perls;
+
+ my %mods;
+ foreach (@perls) {
+ while (my ($k, $v) = each %{$version{$_}}) {
+ $mods{$k}++ if $k =~ $regex;
+ }
+ }
+ return sort keys %mods
}
Added: packages/libmodule-corelist-perl/branches/upstream/current/t/find_modules.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-corelist-perl/branches/upstream/current/t/find_modules.t?rev=3138&op=file
==============================================================================
--- packages/libmodule-corelist-perl/branches/upstream/current/t/find_modules.t (added)
+++ packages/libmodule-corelist-perl/branches/upstream/current/t/find_modules.t Tue Jun 20 09:38:19 2006
@@ -1,0 +1,20 @@
+#!perl -w
+use strict;
+use Module::CoreList;
+use Test::More tests => 5;
+
+BEGIN { require_ok('Module::CoreList'); }
+
+is_deeply([ Module::CoreList->find_modules(qr/warnings/) ],
+ [ qw(encoding::warnings warnings warnings::register) ],
+ 'qr/warnings/');
+
+is_deeply([ Module::CoreList->find_modules(qr/IPC::Open/) ],
+ [ qw(IPC::Open2 IPC::Open3) ],
+ 'qr/IPC::Open/');
+
+is_deeply([ Module::CoreList->find_modules(qr/Module::/, 5.008008) ], [], 'qr/Module::/ at 5.008008');
+
+is_deeply([ Module::CoreList->find_modules(qr/Test::H.*::.*s/, 5.006001, 5.007003) ],
+ [ qw(Test::Harness::Assert Test::Harness::Straps) ],
+ 'qr/Test::H.*::.*s/ at 5.006001 and 5.007003');
More information about the Pkg-perl-cvs-commits
mailing list