summaryrefslogtreecommitdiffstats
path: root/urpm/args.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-04-13 14:53:18 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-04-13 14:53:18 +0000
commit8c6c3610ab5d9fa60c2e38cbcba71d9517cfd6f6 (patch)
tree55a953a0177cfc168c02e8fa78f9747fd3956fb2 /urpm/args.pm
parent8b6622357e08f5ea263c9ffd1f59506b8a259535 (diff)
downloadurpmi-8c6c3610ab5d9fa60c2e38cbcba71d9517cfd6f6.tar
urpmi-8c6c3610ab5d9fa60c2e38cbcba71d9517cfd6f6.tar.gz
urpmi-8c6c3610ab5d9fa60c2e38cbcba71d9517cfd6f6.tar.bz2
urpmi-8c6c3610ab5d9fa60c2e38cbcba71d9517cfd6f6.tar.xz
urpmi-8c6c3610ab5d9fa60c2e38cbcba71d9517cfd6f6.zip
Factorize the code to handle command-line options for the urpm* tools
in a module urpm::args.
Diffstat (limited to 'urpm/args.pm')
-rw-r--r--urpm/args.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index 7ce058c8..5b4c9764 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -187,6 +187,20 @@ my %options_spec = (
f => sub {
$::query->{version} = $::query->{release} = $::query->{arch} = 1;
},
+ '<>' => sub {
+ my $x = $_[0];
+ if ($x =~ /\.rpm$/) {
+ if (-r $x) { push @::files, $x }
+ else { print STDERR N("urpmq: cannot read rpm file \"%s\"\n", $x) }
+ } else {
+ if ($::query->{src}) {
+ push @::src_names, $x;
+ } else {
+ push @::names, $x;
+ }
+ $::query->{src} = 0; #- reset switch for next package.
+ }
+ },
},
'urpmi.update' => {