From 8c6c3610ab5d9fa60c2e38cbcba71d9517cfd6f6 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 13 Apr 2004 14:53:18 +0000 Subject: Factorize the code to handle command-line options for the urpm* tools in a module urpm::args. --- urpm/args.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'urpm') 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' => { -- cgit v1.2.1