diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-09-29 06:42:39 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-09-29 06:42:39 +0000 |
commit | 57573a55ce93cb59d88c04aae1c34d045a1589b5 (patch) | |
tree | d776ac8298d8ef00062444446eb24cfadae8d638 /urpmf | |
parent | 0c582bbec80dc26b77975fba01f0dd87e775d062 (diff) | |
download | urpmi-57573a55ce93cb59d88c04aae1c34d045a1589b5.tar urpmi-57573a55ce93cb59d88c04aae1c34d045a1589b5.tar.gz urpmi-57573a55ce93cb59d88c04aae1c34d045a1589b5.tar.bz2 urpmi-57573a55ce93cb59d88c04aae1c34d045a1589b5.tar.xz urpmi-57573a55ce93cb59d88c04aae1c34d045a1589b5.zip |
Add a new option -m to urpmf to get the media in which a package has been
found.
Diffstat (limited to 'urpmf')
-rwxr-xr-x | urpmf | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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; |