diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-10-26 12:44:00 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-10-26 12:44:00 +0000 |
commit | 20b7df2511b967a33448c3ff95c8e69cb27e7921 (patch) | |
tree | 3642dca1d74afef1b199a983e7ebcb496ab614d5 | |
parent | 18fe5ca41bcc0b0524b66214a2649785e93b33c5 (diff) | |
download | urpmi-20b7df2511b967a33448c3ff95c8e69cb27e7921.tar urpmi-20b7df2511b967a33448c3ff95c8e69cb27e7921.tar.gz urpmi-20b7df2511b967a33448c3ff95c8e69cb27e7921.tar.bz2 urpmi-20b7df2511b967a33448c3ff95c8e69cb27e7921.tar.xz urpmi-20b7df2511b967a33448c3ff95c8e69cb27e7921.zip |
Expand .urpmi arguments to gurpmi
-rw-r--r-- | gurpmi.pm | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -39,7 +39,18 @@ sub fatal { my $s = $_[0]; print STDERR "$s\n"; exit 1 } sub parse_command_line { my @all_rpms; our %options; - foreach (@ARGV) { + # Expand *.urpmi arguments + my @ARGV_expanded; + foreach my $a (@ARGV) { + if ($a =~ /\.urpmi$/) { + open my $fh, '<', $a or do { warn "Can't open $a: $!\n"; next }; + push @ARGV_expanded, map { chomp; $_ } <$fh>; + close $fh; + } else { + push @ARGV_expanded, $a; + } + } + foreach (@ARGV_expanded) { if (/^-/) { $_ eq '--no-verify-rpm' and $options{'no-verify-rpm'} = 1; /^--?[hv?]/ and usage(); |