summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-26 12:44:00 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-26 12:44:00 +0000
commit20b7df2511b967a33448c3ff95c8e69cb27e7921 (patch)
tree3642dca1d74afef1b199a983e7ebcb496ab614d5
parent18fe5ca41bcc0b0524b66214a2649785e93b33c5 (diff)
downloadurpmi-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.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/gurpmi.pm b/gurpmi.pm
index 1f58ba2f..4b972410 100644
--- a/gurpmi.pm
+++ b/gurpmi.pm
@@ -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();