The following commit has been merged in the master branch:
commit 638b42441d3b0b6edc70b8743cd7ba5f79d2ff76
Author: Guillem Jover <[email protected]>
Date:   Mon Oct 29 07:42:39 2012 +0100

    Dpkg::Deps: Add new deps_concat function

diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm
index 21b8e9c..c4ad92a 100644
--- a/scripts/Dpkg/Deps.pm
+++ b/scripts/Dpkg/Deps.pm
@@ -1,4 +1,5 @@
 # Copyright © 2007-2009 Raphaël Hertzog <[email protected]>
+# Copyright © 2012 Guillem Jover <[email protected]>
 #
 # This program is free software; you may redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -48,7 +49,7 @@ All the deps_* functions are exported by default.
 use strict;
 use warnings;
 
-our $VERSION = "1.01";
+our $VERSION = "1.02";
 
 use Dpkg::Version;
 use Dpkg::Arch qw(get_host_arch get_build_arch);
@@ -56,7 +57,7 @@ use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
 
 use base qw(Exporter);
-our @EXPORT = qw(deps_parse deps_eval_implication deps_compare);
+our @EXPORT = qw(deps_concat deps_parse deps_eval_implication deps_compare);
 
 # Some factorized function
 
@@ -241,6 +242,19 @@ sub deps_eval_implication {
     return undef;
 }
 
+=item my $dep = deps_concat(@dep_list)
+
+This function concatenates multiple dependency lines into a single line,
+joining them with ", " if appropriate, and always returning a valid string.
+
+=cut
+
+sub deps_concat {
+    my (@dep_list) = @_;
+
+    return join(', ', grep { defined $_ } @dep_list);
+}
+
 =item my $dep = deps_parse($line, %options)
 
 This function parses the dependency line and returns an object, either a
@@ -1316,6 +1330,14 @@ sub _evaluate_simple_dep {
 
 =head1 CHANGES
 
+=head2 Version 1.02
+
+=over
+
+=item * Add new Dpkg::deps_concat() function.
+
+=back
+
 =head2 Version 1.01
 
 =over

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to