diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-08-20 14:06:41 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-08-20 14:06:41 +0000 |
commit | 249248c51cc2045ee51acd90e0c5ec7cfe5fb5d2 (patch) | |
tree | c2e0a7e988550959f753f469b5a66f0ca238730d | |
parent | ab7fd8391ba5ba3210a76e69b3f038546b059b68 (diff) | |
download | urpmi-249248c51cc2045ee51acd90e0c5ec7cfe5fb5d2.tar urpmi-249248c51cc2045ee51acd90e0c5ec7cfe5fb5d2.tar.gz urpmi-249248c51cc2045ee51acd90e0c5ec7cfe5fb5d2.tar.bz2 urpmi-249248c51cc2045ee51acd90e0c5ec7cfe5fb5d2.tar.xz urpmi-249248c51cc2045ee51acd90e0c5ec7cfe5fb5d2.zip |
(add2hash_) copy it from MDK::Common (needed for next commit)
-rw-r--r-- | urpm/util.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/urpm/util.pm b/urpm/util.pm index 65fb5f77..bad6ce8b 100644 --- a/urpm/util.pm +++ b/urpm/util.pm @@ -6,6 +6,7 @@ use strict; use Exporter; our @ISA = 'Exporter'; our @EXPORT = qw(min max quotespace unquotespace + add2hash_ remove_internal_name reduce_pathname offset_pathname untaint @@ -151,6 +152,7 @@ sub formatList { join(", ", @_ <= $nb ? @_ : (@_[0..$nb-1], '...')); } +sub add2hash_ { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { exists $a->{$k} or $a->{$k} = $v } $a } sub put_in_hash { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { $a->{$k} = $v } $a } sub uniq { my %l; $l{$_} = 1 foreach @_; grep { delete $l{$_} } @_ } sub difference2 { my %l; @l{@{$_[1]}} = (); grep { !exists $l{$_} } @{$_[0]} } |