[dpkg] 42/192: Test::Dpkg: Add new all_perl_modules function

Ximin Luo infinity0 at debian.org
Tue Oct 17 11:03:56 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 983c1bc74c8e036bc5ae6d9646474d8acbc9a112
Author: Guillem Jover <guillem at debian.org>
Date:   Thu May 18 00:12:01 2017 +0200

    Test::Dpkg: Add new all_perl_modules function
---
 debian/changelog     |  1 +
 scripts/Test/Dpkg.pm | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 9ece8fa..5dc0bde 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,7 @@ dpkg (1.19.0) UNRELEASED; urgency=medium
     - Enable perlcritic Documentation::RequirePodSections and
       Miscellanea::ProhibitTies.
     - Disable perlcritic ValuesAndExpressions::ProhibitEscapedCharacter.
+    - Add a new all_perl_modules function to Test::Dpkg.
 
  -- Guillem Jover <guillem at debian.org>  Thu, 18 May 2017 05:27:31 +0200
 
diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm
index ba0f539..1b1a5d6 100644
--- a/scripts/Test/Dpkg.pm
+++ b/scripts/Test/Dpkg.pm
@@ -21,6 +21,7 @@ use warnings;
 our $VERSION = '0.00';
 our @EXPORT_OK = qw(
     all_perl_files
+    all_perl_modules
     test_get_perl_dirs
     test_get_data_path
     test_needs_author
@@ -38,6 +39,7 @@ our %EXPORT_TAGS = (
     ) ],
     paths => [ qw(
         all_perl_files
+        all_perl_modules
         test_get_perl_dirs
         test_get_data_path
     ) ],
@@ -63,9 +65,10 @@ sub test_get_perl_dirs
 
 sub all_perl_files
 {
+    my $filter = shift // qr/\.(?:pl|pm|t)$/;
     my @files;
     my $scan_perl_files = sub {
-        push @files, $File::Find::name if m/\.(pl|pm|t)$/;
+        push @files, $File::Find::name if m/$filter/;
     };
 
     find($scan_perl_files, test_get_perl_dirs());
@@ -73,6 +76,11 @@ sub all_perl_files
     return @files;
 }
 
+sub all_perl_modules
+{
+    return all_perl_files(qr/\.pm$/);
+}
+
 sub test_needs_author
 {
     if (not $ENV{DPKG_DEVEL_MODE} and not $ENV{AUTHOR_TESTING}) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list