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 77800018c8ee6560cec9f98dd947eeb824f007d3
Author: Damyan Ivanov <d...@debian.org>
Date:   Mon Jun 30 14:04:09 2014 +0000

    the locate command now accepts multiple arguments
---
 dh-make-perl                     |  8 ++++----
 lib/DhMakePerl/Command/locate.pm | 32 +++++++++++++++++---------------
 2 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/dh-make-perl b/dh-make-perl
index 8adfc5a..f9b2f9e 100755
--- a/dh-make-perl
+++ b/dh-make-perl
@@ -23,7 +23,7 @@ dh-make-perl - Create debian source packages from Perl modules
 
 =item dh-make-perl refresh {I<--only ...>} [directory]
 
-=item dh-make-perl locate Foo::Bar
+=item dh-make-perl locate Foo::Bar ...
 
 =item dh-make-perl refresh-cache
 
@@ -115,13 +115,13 @@ directory when B<dh-make-perl> is run in L</refresh> 
mode. Filenames are
 separated by a comma. The option can be given multiple times, accumulating
 arguments.
 
-=item locate I<MODULE>
+=item locate I<MODULE> ...
 
-Tries to locate the package that conains the given Perl I<MODULE>.
+Tries to locate the package that conains the given Perl I<MODULE>s.
 
 Example:
 
-    dh-make-perl locate IPC::Run3
+    dh-make-perl locate IPC::Run3 XML::Tidy
 
 =item refresh-cache
 
diff --git a/lib/DhMakePerl/Command/locate.pm b/lib/DhMakePerl/Command/locate.pm
index dc48f0b..fbd0d41 100644
--- a/lib/DhMakePerl/Command/locate.pm
+++ b/lib/DhMakePerl/Command/locate.pm
@@ -12,7 +12,7 @@ This module implements the I<locate> command of 
L<dh-make-perl(1)>.
 
 use strict; use warnings;
 
-our $VERSION = '0.66';
+our $VERSION = '0.81';
 
 use base 'DhMakePerl';
 
@@ -31,8 +31,8 @@ Provides I<locate> command implementation.
 sub execute {
     my $self = shift;
 
-    @ARGV == 1
-        or die "locate command requires exactly one non-option argument\n";
+    @ARGV >= 1
+        or die "locate command requires at least one non-option argument\n";
 
     my $apt_contents = $self->get_apt_contents;
 
@@ -45,21 +45,23 @@ Install the 'apt-file' package, run 'apt-file update' as 
root
 and retry.
 EOF
     }
-    my $mod = $ARGV[0];
 
-    if ( defined( my $core_since = is_core_module($mod) ) ) {
-        print "$mod is in Perl core (package perl)";
-        print $core_since ? " since $core_since\n" : "\n";
-        return 0;
+    my $result = 0;
+    for my $mod (@ARGV) {
+        if ( defined( my $core_since = is_core_module($mod) ) ) {
+            print "$mod is in Perl core (package perl)";
+            print $core_since ? " since $core_since\n" : "\n";
+        }
+        elsif ( my $pkg = $apt_contents->find_perl_module_package($mod) ) {
+            print "$mod is in $pkg package\n";
+        }
+        else {
+            print "$mod is not found in any Debian package\n";
+            $result = 1;
+        }
     }
 
-    if ( my $pkg = $apt_contents->find_perl_module_package($mod) ) {
-        print "$mod is in $pkg package\n";
-        return 0;
-    }
-
-    print "$mod is not found in any Debian package\n";
-    return 1;
+    return $result;
 }
 
 =back

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/dh-make-perl.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to