diff options
author | Francois Pons <fpons@mandriva.com> | 2002-08-12 14:10:06 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-08-12 14:10:06 +0000 |
commit | 68603df6ecd265d985936b1f496d5980651bc02f (patch) | |
tree | 9b197928a6ed17db24709ce1f6d44a621547dbad | |
parent | 18299ef1f321929d2a5e9d42a235c598a501f968 (diff) | |
download | urpmi-68603df6ecd265d985936b1f496d5980651bc02f.tar urpmi-68603df6ecd265d985936b1f496d5980651bc02f.tar.gz urpmi-68603df6ecd265d985936b1f496d5980651bc02f.tar.bz2 urpmi-68603df6ecd265d985936b1f496d5980651bc02f.tar.xz urpmi-68603df6ecd265d985936b1f496d5980651bc02f.zip |
3.9-7mdk
-rw-r--r-- | urpm.pm | 2 | ||||
-rwxr-xr-x | urpmi | 84 | ||||
-rw-r--r-- | urpmi.spec | 9 |
3 files changed, 68 insertions, 27 deletions
@@ -332,7 +332,7 @@ sub read_config { /^update\s*$/ and $medium->{update} = 1, next; /^ignore\s*$/ and $medium->{ignore} = 1, next; /^synthesis\s*$/ and $medium->{synthesis} = 1, next; - /^modified\s*$/ and $medium->{modified} = 1, next; + /^modified\s*$/ and next; # IGNORED TO AVOID EXCESIVE REMOVE $medium->{modified} = 1, next; $_ eq '}' and last; $_ and $urpm->{error}(_("syntax error in config file at line %s", $.)); } @@ -31,7 +31,6 @@ my $auto_select = 0; my $force = 0; my $allow_nodeps = 0; my $allow_force = 0; -my $force = 0; my $sync = undef; my $X = 0; my $WID = 0; @@ -46,6 +45,7 @@ my $root = ''; my $bug = ''; my $env = ''; my $log = ''; +my $verify_rpm = ''; my $uid; my @files; @@ -87,6 +87,7 @@ usage: ") . _(" --X - use X interface. ") . _(" --best-output - choose best interface according to the environment: X or text mode. +") . _(" --verify-rpm - verify rpm signature before installation. ") . _(" -a - select all matches on command line. ") . _(" -p - allow search in provides to find package. ") . _(" -P - do not search in provides to find package. @@ -141,6 +142,7 @@ while (defined($_ = shift @ARGV)) { /^--WID$/ and do { push @nextargv, \$WID; next }; /^--best-output$/ and do { $X ||= $ENV{DISPLAY} && -x "/usr/sbin/grpmi" && system('/usr/X11R6/bin/xtest', '') == 0; next }; + /^--verify-rpm$/ and do { $verify_rpm = 1; next }; /^--comment$/ and do { push @nextargv, undef; next }; /^--root$/ and do { push @nextargv, \$root; next }; /^-(.*)$/ and do { foreach (split //, $1) { @@ -366,32 +368,36 @@ sub ask_choice { } if (%{$state->{ask_unselect} || {}}) { - my $list = join "\n", map { scalar $urpm->{depslist}[$_]->fullname } keys %{$state->{ask_unselect}}; - my $msg = _("Some package requested cannot be installed:\n%s\ndo you agree ?", $list); - if ($X) { - my $ok = _("Ok"); - my $cancel = _("Cancel"); - `gmessage -default $ok -buttons "$ok:0,$cancel:2" "$msg"`; - $? and exit 0; - } else { - $noexpr = _("Nn"); - $yesexpr = _("Yy"); - message_input($msg . _(" (Y/n) ")) =~ /[$noexpr]/ and exit 0; - delete @{$state->{selected}}{keys %{$state->{ask_unselect}}}; + unless ($auto) { + my $list = join "\n", map { scalar $urpm->{depslist}[$_]->fullname } keys %{$state->{ask_unselect}}; + my $msg = _("Some package requested cannot be installed:\n%s\ndo you agree ?", $list); + if ($X) { + my $ok = _("Ok"); + my $cancel = _("Cancel"); + `gmessage -default $ok -buttons "$ok:0,$cancel:2" "$msg"`; + $? and exit 0; + } else { + $noexpr = _("Nn"); + $yesexpr = _("Yy"); + message_input($msg . _(" (Y/n) ")) =~ /[$noexpr]/ and exit 0; + } } + delete @{$state->{selected}}{keys %{$state->{ask_unselect}}}; } if (%{$state->{ask_remove} || {}}) { - my $list = join "\n", sort { $a cmp $b } keys %{$state->{ask_remove}}; - my $msg = _("The following packages have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list); - if ($X) { - my $ok = _("Ok"); - my $cancel = _("Cancel"); - `gmessage -default $ok -buttons "$ok:0,$cancel:2" "$msg"`; - $? and exit 0; - } else { - $noexpr = _("Nn"); - $yesexpr = _("Yy"); - message_input($msg . _(" (Y/n) ")) =~ /[$noexpr]/ and exit 0; + unless ($auto) { + my $list = join "\n", sort { $a cmp $b } keys %{$state->{ask_remove}}; + my $msg = _("The following packages have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list); + if ($X) { + my $ok = _("Ok"); + my $cancel = _("Cancel"); + `gmessage -default $ok -buttons "$ok:0,$cancel:2" "$msg"`; + $? and exit 0; + } else { + $noexpr = _("Nn"); + $yesexpr = _("Yy"); + message_input($msg . _(" (Y/n) ")) =~ /[$noexpr]/ and exit 0; + } } } @@ -471,8 +477,36 @@ my %sources = $urpm->download_source_packages($local_sources, $list, ($X ? '' : }); my %sources_install = %{$urpm->extract_packages_to_install(\%sources) || {}}; - if (%sources_install || %sources) { + if ($verify_rpm) { + my @invalid_sources; + + foreach (values %sources_install, values %sources) { + URPM::verify_rpm($_) =~ /NOT OK/ and push @invalid_sources, $_; + } + + if (@invalid_sources) { + my $msg = _("The following packages have bad signatures"); + my $msg2 = _("Do you want to continue installation ?"); + my $p = join "\n", @invalid_sources; + if ($auto) { + message("$msg:\n$p\n", 'noX'); + exit 1; + } else { + if ($X) { + my $ok = _("Ok"); + my $cancel = _("Cancel"); + `gmessage -default $cancel -buttons "$ok:0,$cancel:2" "$msg:\n$p\n\n$msg2"`; + $? and exit 1; + } else { + $noexpr = _("Nn"); + $yesexpr = _("Yy"); + message_input("$msg:\n$p\n$msg2" . _(" (y/N) ")) =~ /[$yesexpr]/ or exit 1; + } + } + } + } + message(_("installing %s\n", join(' ', values %sources_install, values %sources))); log_it(scalar localtime, " ", join(' ', values %sources_install, values %sources), "\n"); #- check for local files. @@ -2,7 +2,7 @@ Name: urpmi Version: 3.9 -Release: 6mdk +Release: 7mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate @@ -144,6 +144,13 @@ fi %changelog +* Mon Aug 12 2002 François Pons <fpons@mandrakesoft.com> 3.9-7mdk +- fixed --auto not taken into account for removing or unselecting + packages in urpmi. +- fixed modified flag ignored in urpmi.cfg (may cause side effects + as remove media not asked next time urpmi.removemedia is called). +- added --verify-rpm to urpmi in order to check rpm signature. + * Tue Aug 6 2002 François Pons <fpons@mandrakesoft.com> 3.9-6mdk - added --allow-nodeps and --allow-force option to urpmi. - globing multiple media name select them all instead of error. |