r55640 - /trunk/dh-make-perl/lib/Debian/Dependencies.pm

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Wed Apr 7 20:52:15 UTC 2010


Author: dmn
Date: Wed Apr  7 20:51:59 2010
New Revision: 55640

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=55640
Log:
Dependencies->add now takes a list

now matches the usage in Control::FromCPAN and is similar
to remove()

Modified:
    trunk/dh-make-perl/lib/Debian/Dependencies.pm

Modified: trunk/dh-make-perl/lib/Debian/Dependencies.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/Debian/Dependencies.pm?rev=55640&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/Debian/Dependencies.pm (original)
+++ trunk/dh-make-perl/lib/Debian/Dependencies.pm Wed Apr  7 20:51:59 2010
@@ -136,9 +136,11 @@
 
 =over 4
 
-=item add( I<dependency> )
-
-Adds I<dependency> to the list of dependencies. If the new dependency is a subset of or overlaps some of the old dependencies, it is not duplicated.
+=item add( I<dependency>[, ... ] )
+
+Adds I<dependency> (or a list of) to the list of dependencies. If the new
+dependency is a subset of or overlaps some of the old dependencies, it is not
+duplicated.
 
     my $d = Debian::Dependencies('foo, bar (<=4)');
     $d->add('foo (>= 4), bar');
@@ -151,12 +153,14 @@
 =cut
 
 sub add {
-    my( $self, $dep ) = @_;
-
-    $dep = Debian::Dependencies->new($dep)
-        unless ref($dep);
-
-    $self += $dep;
+    my $self = shift;
+
+    while ( defined(my $dep = shift) ) {
+        $dep = Debian::Dependencies->new($dep)
+            unless ref($dep);
+
+        $self += $dep;
+    }
 }
 
 =item remove( I<dependency>, ... )




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