summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rwxr-xr-xurpmi.update43
2 files changed, 22 insertions, 24 deletions
diff --git a/NEWS b/NEWS
index 3b4ee828..cd6b73ec 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@
o allow setting aria2-options in urpmi.cfg
- urpmi
o in --auto, do display an error message when rpms are missing
+- urpmi.update
+ o updated "ignore"d medium should not become non "ignore"d (#45457)
+ (regression introduced in 6.14.9)
Version 6.14.11 - 28 October 2008
diff --git a/urpmi.update b/urpmi.update
index 87ef1ebb..abc6e530 100755
--- a/urpmi.update
+++ b/urpmi.update
@@ -73,37 +73,32 @@ urpm::media::read_config($urpm, $options{nocheck});
my @chosen_media;
-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.