[dh-make-perl] 02/03: replace looking for perl[-base] and perl-modules[-x.y] with is_core_perl_package()
Damyan Ivanov
dmn at moszumanska.debian.org
Tue Mar 21 20:50:46 UTC 2017
This is an automated email from the git hooks/post-receive script.
dmn pushed a commit to branch master
in repository dh-make-perl.
commit 1ef2bcfa298667d77f675be8bfada7e28d100bad
Author: Damyan Ivanov <dmn at debian.org>
Date: Tue Mar 21 20:23:08 2017 +0000
replace looking for perl[-base] and perl-modules[-x.y] with is_core_perl_package()
this adds libperlx.y to the list of the packages belonging to the core
set
---
lib/Debian/AptContents.pm | 12 ++++--------
lib/Debian/Control/FromCPAN.pm | 17 ++++++++---------
2 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/lib/Debian/AptContents.pm b/lib/Debian/AptContents.pm
index 39847e6..93664f2 100644
--- a/lib/Debian/AptContents.pm
+++ b/lib/Debian/AptContents.pm
@@ -34,7 +34,7 @@ __PACKAGE__->mk_accessors(
use Config;
use Debian::Dependency;
-use DhMakePerl::Utils qw(find_core_perl_dependency);
+use DhMakePerl::Utils qw(find_core_perl_dependency is_core_perl_package);
use File::Spec::Functions qw( catfile catdir splitpath );
use IO::Uncompress::Gunzip;
use List::MoreUtils qw(uniq);
@@ -315,11 +315,7 @@ sub find_file_packages {
# usr/share/perl5/Config/Any.pm universe/perl/libconfig-any-perl
# in-core dependencies are given by find_core_perl_dependency
- @packages = grep {
- ( $_ ne 'perl-base' )
- and ( $_ ne 'perl' )
- and ( $_ !~ /^perl-modules(?:-[\d.]+)?/ )
- } @packages;
+ @packages = grep { !is_core_perl_package($_) } @packages;
return uniq @packages;
}
@@ -358,8 +354,8 @@ sub find_perl_module_package {
else { return $a cmp $b; } # or 0?
} @matches;
- # we don't want perl, perl-base and perl-modules here
- @matches = grep { !/^perl(?:-(?:base|modules(?:-[\d.]+)?))?$/ } @matches;
+ # we don't want perl packages here
+ @matches = grep { !is_core_perl_package($_) } @matches;
my $direct_dep;
$direct_dep = Debian::Dependency->new(
diff --git a/lib/Debian/Control/FromCPAN.pm b/lib/Debian/Control/FromCPAN.pm
index a402693..2cd9681 100644
--- a/lib/Debian/Control/FromCPAN.pm
+++ b/lib/Debian/Control/FromCPAN.pm
@@ -23,7 +23,8 @@ use Carp qw(croak);
use base 'Debian::Control';
use CPAN ();
-use DhMakePerl::Utils qw( is_core_module find_cpan_module nice_perl_ver split_version_relation apt_cache );
+use DhMakePerl::Utils qw( is_core_module find_cpan_module nice_perl_ver
+ split_version_relation apt_cache is_core_perl_package );
use File::Spec qw( catfile );
use Module::Depends ();
@@ -403,11 +404,7 @@ sub find_debs_for_modules {
my $alt_dep;
if ( my @pkgs = Debian::DpkgLists->scan_perl_mod($module) ) {
- @pkgs = grep {
- ( $_ !~ /^perl-modules(?:-[\d.]+)?$/ )
- and ( $_ ne 'perl-base' )
- and ( $_ ne 'perl' )
- } @pkgs;
+ @pkgs = grep { !is_core_perl_package($_) } @pkgs;
$alt_dep = Debian::Dependency->new(
( @pkgs > 1 )
@@ -511,10 +508,11 @@ sub prune_simple_perl_dep {
croak "No alternative dependencies can be given"
if $dep->alternatives;
- return $dep unless $dep->pkg =~ /^(?:perl|perl-base|perl-modules(?:-[\d.]+)?)$/;
+ return $dep unless is_core_perl_package( $dep->pkg );
# perl-modules is replaced with perl
- $dep->pkg('perl') if $dep->pkg =~ /^perl-modules(?:-[\d.]+)?$/;
+ $dep->pkg('perl')
+ if $dep->pkg =~ /^(?:perl-modules(?:-[\d.]+)?|libperl[\d.]+)$/;
my $unversioned = (
not $dep->ver
@@ -574,7 +572,8 @@ sub prune_perl_dep {
=item prune_perl_deps
-Remove redundant (build-)dependencies on perl, perl-modules and perl-base.
+Remove redundant (build-)dependencies on perl, libperl, perl-modules and
+perl-base.
=cut
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/dh-make-perl.git
More information about the Pkg-perl-cvs-commits
mailing list