diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-08-20 16:40:02 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-08-20 16:40:02 +0000 |
commit | 0fca5662e7d4f0a8e2a9436ea860acde4b94ed05 (patch) | |
tree | 4e5c5fa03a910e6ef75bbbc8f6609273c28d891e | |
parent | 56b5c01b78529f01cbdabb6b55759d26d54895d0 (diff) | |
download | urpmi-0fca5662e7d4f0a8e2a9436ea860acde4b94ed05.tar urpmi-0fca5662e7d4f0a8e2a9436ea860acde4b94ed05.tar.gz urpmi-0fca5662e7d4f0a8e2a9436ea860acde4b94ed05.tar.bz2 urpmi-0fca5662e7d4f0a8e2a9436ea860acde4b94ed05.tar.xz urpmi-0fca5662e7d4f0a8e2a9436ea860acde4b94ed05.zip |
add formatList() (taken from MDK::Common)
-rw-r--r-- | urpm/util.pm | 4 |
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{$_} } @_ } |