From e57338e203aa54d4f2dbab901783c755f97dc5c9 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 3 Mar 2006 17:32:55 +0000 Subject: Add --media and --searchmedia options to gurpmi --- gurpmi.pm | 12 ++++++++---- gurpmi2 | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gurpmi.pm b/gurpmi.pm index b00bb600..0590412a 100644 --- a/gurpmi.pm +++ b/gurpmi.pm @@ -32,6 +32,8 @@ Usage : Options : --auto-select --no-verify-rpm + --media media1,... + --searchmedia media1,... USAGE exit 0; } @@ -57,14 +59,16 @@ sub parse_command_line { push @ARGV_expanded, $a; } } + my $nextopt; foreach (@ARGV_expanded) { + if ($nextopt) { $options{$nextopt} = $_; undef $nextopt; next } if (/^-/) { - if ($_ eq '--no-verify-rpm') { - $options{'no-verify-rpm'} = 1; + if (/^--(no-verify-rpm|auto-select)$/) { + $options{$1} = 1; next; } - if ($_ eq '--auto-select') { - $options{'auto-select'} = 1; + if (/^--(media|searchmedia)$/) { + $nextopt = $1; next; } /^--?[hv?]/ and usage(); diff --git a/gurpmi2 b/gurpmi2 index 4177179a..c5d91a42 100755 --- a/gurpmi2 +++ b/gurpmi2 @@ -101,7 +101,10 @@ sub configure_urpm { }; $urpm->exlock_rpm_db; $urpm->shlock_urpmi_db; - $urpm->configure; + $urpm->configure( + media => $gurpmi::options{media}, + searchmedia => $gurpmi::options{searchmedia}, + ); $urpm->{options}{'verify-rpm'} = 0 if $gurpmi::options{'no-verify-rpm'}; #- default options values exists $urpm->{options}{$_} or $urpm->{options}{$_} = 1 foreach qw(post-clean verify-rpm split-length); -- cgit v1.2.1