summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--urpm/media.pm28
2 files changed, 20 insertions, 10 deletions
diff --git a/NEWS b/NEWS
index c6d9f2fb..50076203 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
- use "versioned" media_info files
(needed for aria2 to handle mirrors not having some media_info/*)
- urpmi.addmedia, urpmi.update:
+ o for remote media, instead of first checking reconfig.urpmi, try MD5SUM.
+ If it fails try reconfig.urpmi
o only look for "descriptions" in media_info/
o do not get "descriptions" on non update media since it's useless and
potentially slow
diff --git a/urpm/media.pm b/urpm/media.pm
index 9619717b..c8c3428b 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1021,10 +1021,9 @@ sub may_reconfig_urpmi {
$f = urpm::download::sync_rel_one($urpm, $medium, 'reconfig.urpmi',
quiet => 1, preclean => 1) or return;
}
- if (-s $f) {
- reconfig_urpmi($urpm, $f, $medium);
- }
+ my $reconfigured = -s $f && reconfig_urpmi($urpm, $f, $medium);
unlink $f if !is_local_medium($medium);
+ $reconfigured;
}
#- read a reconfiguration file for urpmi, and reconfigure media accordingly
@@ -1045,7 +1044,7 @@ sub reconfig_urpmi {
#- the first line of reconfig.urpmi must be magic, to be sure it's not an error file
$magic =~ /^# this is an urpmi reconfiguration file/ or return undef;
- $urpm->{log}(N("reconfiguring urpmi for media \"%s\"", $medium->{name}));
+ $urpm->{info}(N("reconfiguring urpmi for media \"%s\"", $medium->{name}));
my @replacements;
foreach (@lines) {
@@ -1358,6 +1357,11 @@ sub _update_medium__parse_if_unmodified__local {
urpm::removable::try_mounting_medium($urpm, $medium) or return;
}
+ #- check for a reconfig.urpmi file (if not already reconfigured)
+ if (!$medium->{noreconfigure}) {
+ may_reconfig_urpmi($urpm, $medium);
+ }
+
#- try to probe for possible with_synthesis parameter, unless
#- it is already defined (and valid).
if (!_valid_synthesis_dir($medium) && $options->{probe_with} ne 'rpms') {
@@ -1449,7 +1453,16 @@ sub _update_medium__parse_if_unmodified__remote {
#- examine if a distant MD5SUM file is available.
if (!$options->{nomd5sum}) {
- my $new_MD5SUM = _download_MD5SUM_and_check($urpm, $medium, !$updating) or return;
+ my $new_MD5SUM = _download_MD5SUM_and_check($urpm, $medium, !$updating);
+
+ if (!$new_MD5SUM) {
+ #- check for a reconfig.urpmi file (if not already reconfigured)
+ if (!$medium->{noreconfigure}) {
+ may_reconfig_urpmi($urpm, $medium)
+ and goto &_update_medium__parse_if_unmodified__remote;
+ }
+ return;
+ }
if ($options->{force} < 2 && _is_statedir_MD5SUM_uptodate($urpm, $medium, $new_MD5SUM)) {
_medium_is_up_to_date($urpm, $medium);
return 'unmodified';
@@ -1548,11 +1561,6 @@ sub _update_medium_ {
_pick_mirror_if_needed($urpm, $medium, 'allow-cache-update');
- #- check for a reconfig.urpmi file (if not already reconfigured)
- if (!$medium->{noreconfigure}) {
- may_reconfig_urpmi($urpm, $medium);
- }
-
{
my $rc =
is_local_medium($medium)