diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-11-14 07:54:27 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-11-14 07:54:27 +0000 |
commit | e288867b461c26c3d9de1f258d50cb7cf72a26d7 (patch) | |
tree | 2e89def3a9e62c84528aef166ec9015e98682bcd | |
parent | 0ffa5337c668d8b0ba91dc14d238dce2073e63af (diff) | |
download | urpmi-e288867b461c26c3d9de1f258d50cb7cf72a26d7.tar urpmi-e288867b461c26c3d9de1f258d50cb7cf72a26d7.tar.gz urpmi-e288867b461c26c3d9de1f258d50cb7cf72a26d7.tar.bz2 urpmi-e288867b461c26c3d9de1f258d50cb7cf72a26d7.tar.xz urpmi-e288867b461c26c3d9de1f258d50cb7cf72a26d7.zip |
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 :-/
-rw-r--r-- | NEWS | 3 | ||||
-rwxr-xr-x | urpmi.update | 43 |
2 files changed, 22 insertions, 24 deletions
@@ -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. |