From 57573a55ce93cb59d88c04aae1c34d045a1589b5 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Wed, 29 Sep 2004 06:42:39 +0000 Subject: Add a new option -m to urpmf to get the media in which a package has been found. --- urpmf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'urpmf') diff --git a/urpmf b/urpmf index 2a88ff90..6130720f 100755 --- a/urpmf +++ b/urpmf @@ -66,6 +66,7 @@ usage: ") . N(" ( - left parenthesis to open group expression. ") . N(" ) - right parenthesis to close group expression. "); +#") . N(" -m - print the media in which the package was found. exit(0); } @@ -100,14 +101,17 @@ foreach (scalar(grep { defined $_ } values %params)) { #- build the callback matching the expression. my $callback = 'sub { my ($urpm, $pkg) = @_; '; #- it is a good start for a sub, no ;-) foreach (qw(filename group size epoch summary description sourcerpm packager buildhost url - provides requires files conflicts obsoletes)) { - $params{$_} and $callback .= ' - foreach my $e ($pkg->'.$_.') { + provides requires files conflicts obsoletes media)) { + if ($params{$_}) { + my $fi = $_ eq 'media' ? '$urpm::currentmedia->{name}' : '$pkg->'.$_; + $callback .= ' + foreach my $e ('.$fi.') { local $_ = $pkg->'.$full.'name."'.(!$quiet && ":$_").':$e"; '.$expr.' or next; '.($uniq && 'exists $uniq{$_} and next; $uniq{$_} = undef; ').'print "$_\n"; }'; + } } $callback .= ' 1; -- cgit v1.2.1