r27264 - in /trunk/dh-make-perl: debian/control dh-make-perl

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Tue Nov 25 22:30:23 UTC 2008


Author: dmn
Date: Tue Nov 25 22:30:20 2008
New Revision: 27264

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=27264
Log:
Updated get_stdmodules to use Module::CoreList.

Previously get_stdmodules() would manually root around in the directories
listed in @INC.  This could potentially have strange results if @INC
was modified (eg, due to setting PERL5LIB).

Modified:
    trunk/dh-make-perl/debian/control
    trunk/dh-make-perl/dh-make-perl

Modified: trunk/dh-make-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/control?rev=27264&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/control (original)
+++ trunk/dh-make-perl/debian/control Tue Nov 25 22:30:20 2008
@@ -17,7 +17,7 @@
 Architecture: all
 Depends: debhelper (>= 4.0.2), libpod-parser-perl, ${perl:Depends}, make,
  dpkg-dev, fakeroot, ${misc:Depends}, libyaml-perl,  libmodule-depends-perl,
- libwww-mechanize-perl, libemail-date-format-perl
+ libwww-mechanize-perl, libemail-date-format-perl, libmodule-corelist-perl
 Recommends: apt-file (>= 2.1.0), libmodule-build-perl
 Description: Create Debian packages from perl modules
  dh-make-perl will create the files required to build a Debian source

Modified: trunk/dh-make-perl/dh-make-perl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/dh-make-perl?rev=27264&op=diff
==============================================================================
--- trunk/dh-make-perl/dh-make-perl (original)
+++ trunk/dh-make-perl/dh-make-perl Tue Nov 25 22:30:20 2008
@@ -13,6 +13,7 @@
 use Module::Depends::Intrusive;
 use Email::Date::Format qw(email_date);
 use Text::Wrap;
+use Module::CoreList ();
 use AptPkg::Config;
 use strict;
 
@@ -312,24 +313,17 @@
 }
 
 sub get_stdmodules {
-    my ( $base_packages, @modules, $paths );
-    $base_packages = $opts{basepkgs} || 'perl,perl-base,perl-modules';
-
-   # We will check on all the base Perl packages for the modules they provide.
-   # To know which files we care for, we look at @INC - In a format easy to
-   # integrate into a regex
-    $paths = join( '|', @INC );
-
-    for my $pkg ( split( /,/, $base_packages ) ) {
-        for my $file ( map { chomp; $_ } `dpkg -L $pkg` ) {
-            next unless $file =~ s!^(?:$paths)[\d\.]*/(.*).pm$!$1!x;
-
-            $file =~ s!/!::!g;
-            push @modules, $file;
-        }
-    }
-
-    return sort @modules;
+
+    # Module::CoreList already knows our core modules, so we ask it.
+    # $] is our perl version.
+
+    my @modules = keys %{ $Module::CoreList::version{ $] } };
+
+    @modules
+        or die "Internal error: \$Module::CoreList::version{ $] } is empty";
+
+    return @modules;
+
 }
 
 sub setup_dir {




More information about the Pkg-perl-cvs-commits mailing list