summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm')
-rw-r--r--urpm/args.pm1
-rw-r--r--urpm/util.pm9
2 files changed, 9 insertions, 1 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index b2542bd7..42422de8 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -234,6 +234,7 @@ my %options_spec = (
keep => \$options{keep},
list => \$options{list},
changelog => \$options{changelog},
+ provides => \$options{provides},
sourcerpm => \$options{sourcerpm},
'summary|S' => \$options{summary},
'list-media:s' => sub { $options{list_media} = $_[1] || 'all' },
diff --git a/urpm/util.pm b/urpm/util.pm
index 19209a3a..81534aa8 100644
--- a/urpm/util.pm
+++ b/urpm/util.pm
@@ -11,7 +11,7 @@ our @EXPORT = qw(min max quotespace unquotespace
untaint
copy_and_own
same_size_and_mtime
- partition put_in_hash uniq
+ partition put_in_hash uniq uniq_
difference2 member file_size cat_ cat_utf8 output_safe dirname basename
);
@@ -135,6 +135,13 @@ sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 }
sub cat_ { my @l = map { my $F; open($F, '<', $_) ? <$F> : () } @_; wantarray() ? @l : join '', @l }
sub cat_utf8 { my @l = map { my $F; open($F, '<:utf8', $_) ? <$F> : () } @_; wantarray() ? @l : join '', @l }
+sub uniq_(&@) {
+ my $f = shift;
+ my %l;
+ $l{$f->($_)} = 1 foreach @_;
+ grep { delete $l{$f->($_)} } @_;
+}
+
sub output_safe {
my ($file, $content) = @_;