From e288867b461c26c3d9de1f258d50cb7cf72a26d7 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 14 Nov 2008 07:54:27 +0000 Subject: r249409 | pixel | 2008-11-13 14:55:28 +0100 (Thu, 13 Nov 2008) | 10 lines - urpmi.update o updated "ignore"d medium should not become non "ignore"d (#45457) (regression introduced in 6.18) the fix is to use update_those_media() which doesn't filter on {ignore} media, and so we don't need to unset {ignore} to allow updating a media setting {modified} is hopefully unneeded when using update_those_media(), but who knows :-/ --- NEWS | 3 +++ urpmi.update | 43 +++++++++++++++++++------------------------ 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/NEWS b/NEWS index 8c77bcd9..4a6800d4 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ o in --auto, do display an error message when rpms are missing o revert --auto-update behaviour in case of media update failures (#45417) o ensure download when updating media (with --auto-update) is quiet +- urpmi.update + o updated "ignore"d medium should not become non "ignore"d (#45457) + (regression introduced in 6.18) Version 6.18 - 28 October 2008 diff --git a/urpmi.update b/urpmi.update index 229820b9..7fe5357f 100755 --- a/urpmi.update +++ b/urpmi.update @@ -77,37 +77,32 @@ if ($options{all} || $options{update}) { $options{allow_failures} = 1; } -if ($options{all} && !defined $options{ignore}) { - @chosen_media = @{$urpm->{media}} - or die N("nothing to update (use urpmi.addmedia to add a media)\n"); -} else { - if ($options{all}) { - @chosen_media = @{$urpm->{media}}; - } elsif ($options{update}) { - @chosen_media = grep { $_->{update} } @{$urpm->{media}}; - } - push @chosen_media, urpm::media::select_media_by_name($urpm, \@cmdline); +if ($options{all} || $options{update}) { + @chosen_media = urpm::media::all_media_to_update($urpm, $options{update}); +} +push @chosen_media, urpm::media::select_media_by_name($urpm, \@cmdline); - @chosen_media or die N("the entry to update is missing\n(one of %s)\n", join(", ", map { $_->{name} } @{$urpm->{media}})); - - foreach (@chosen_media) { - $_->{modified} = 1; +@chosen_media or die $options{all} ? + N("nothing to update (use urpmi.addmedia to add a media)\n") + : N("the entry to update is missing\n(one of %s)\n", join(", ", map { $_->{name} } @{$urpm->{media}})); - if ($options{ignore}) { - $_->{ignore} = 1; - } else { - #- force ignored media to be returned alive. - delete $_->{ignore}; - } +if (defined $options{ignore}) { + foreach (@chosen_media) { + if ($options{ignore}) { + $_->{ignore} = 1; + } else { + #- force ignored media to be returned alive. + delete $_->{ignore}; + } } -} - -if (defined $options{ignore}) { my $str = join(", ", map { N("\"%s\"", $_->{name}) } @chosen_media); $urpm->{log}($options{ignore} ? N("ignoring media %s", $str) : N("enabling media %s", $str)); urpm::media::write_config($urpm); } else { - my $ok = urpm::media::update_media($urpm, %options, + # this is unneeded afaik, keeping just in case it helps + $_->{modified} = 1 foreach @chosen_media; + + my $ok = urpm::media::update_those_media($urpm, \@chosen_media, %options, quiet => $options{verbose} < 0, callback => \&urpm::download::sync_logger); #- try to umount removable device which may have been mounted. -- cgit v1.2.1