summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-08-20 16:40:02 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-08-20 16:40:02 +0000
commit0fca5662e7d4f0a8e2a9436ea860acde4b94ed05 (patch)
tree4e5c5fa03a910e6ef75bbbc8f6609273c28d891e /urpm
parent56b5c01b78529f01cbdabb6b55759d26d54895d0 (diff)
downloadurpmi-0fca5662e7d4f0a8e2a9436ea860acde4b94ed05.tar
urpmi-0fca5662e7d4f0a8e2a9436ea860acde4b94ed05.tar.gz
urpmi-0fca5662e7d4f0a8e2a9436ea860acde4b94ed05.tar.bz2
urpmi-0fca5662e7d4f0a8e2a9436ea860acde4b94ed05.tar.xz
urpmi-0fca5662e7d4f0a8e2a9436ea860acde4b94ed05.zip
add formatList() (taken from MDK::Common)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/util.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/urpm/util.pm b/urpm/util.pm
index 4c51d2ff..65fb5f77 100644
--- a/urpm/util.pm
+++ b/urpm/util.pm
@@ -146,6 +146,10 @@ sub begins_with {
my ($s, $prefix) = @_;
index($s, $prefix) == 0;
}
+sub formatList {
+ my $nb = shift;
+ join(", ", @_ <= $nb ? @_ : (@_[0..$nb-1], '...'));
+}
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{$_} } @_ }