From 4db08b3d13a35be4d7627c1160c47381202ff551 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 6 Mar 2006 11:18:42 +0000 Subject: Patch by Titi for gurpmi, to avoid asking confirmation when the new option --auto is given --- gurpmi | 2 +- gurpmi.pm | 6 ++++-- gurpmi2 | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gurpmi b/gurpmi index 0b92b3ac..72003a1f 100644 --- a/gurpmi +++ b/gurpmi @@ -58,7 +58,7 @@ sub proceed { #- Ask question: save or install ? #- change depending on the number of rpms, and on the presence of srpms -if (@all_rpms + @gurpmi::names) { +if (!$gurpmi::options{auto} && @all_rpms + @gurpmi::names) { my $msg = ( @$srpms > 0 ? N("You have selected a source package: diff --git a/gurpmi.pm b/gurpmi.pm index 0590412a..6c670e87 100644 --- a/gurpmi.pm +++ b/gurpmi.pm @@ -30,6 +30,7 @@ gurpmi version $urpm::VERSION Usage : gurpmi [ ... ] Options : + --auto --auto-select --no-verify-rpm --media media1,... @@ -63,7 +64,7 @@ sub parse_command_line { foreach (@ARGV_expanded) { if ($nextopt) { $options{$nextopt} = $_; undef $nextopt; next } if (/^-/) { - if (/^--(no-verify-rpm|auto-select)$/) { + if (/^--(no-verify-rpm|auto-select|auto)$/) { $options{$1} = 1; next; } @@ -80,7 +81,8 @@ sub parse_command_line { push @all_rpms, $_; } } - $options{'auto-select'} || @all_rpms + @names or fatal(N("No packages specified")); + $options{'auto-select'} || @all_rpms + @names + or fatal(N("No packages specified")); return @all_rpms; } diff --git a/gurpmi2 b/gurpmi2 index dd37ca27..325de304 100755 --- a/gurpmi2 +++ b/gurpmi2 @@ -180,7 +180,7 @@ sub do_install_2 () { $pkg->arch ne 'src' and push @to_install, scalar $pkg->fullname; } $urpm->{nb_install} = @to_install; - @to_install > 1 + (@to_install > 1 && !$gurpmi::options{auto}) ? ask_continue(N( "To satisfy dependencies, the following %d packages are going to be installed:\n%s\n", scalar(@to_install), join "\n", @to_install -- cgit v1.2.1