diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-09-23 16:38:56 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-09-23 16:38:56 +0000 |
commit | 5f0ec80af00591a5479ff11f12470e5ebb02db58 (patch) | |
tree | f1faba32be41ae1afd8cd57f83bb1f043fb8d615 /urpm/media.pm | |
parent | 42f4c5c2e972306ab7040353eb916337d1cda51b (diff) | |
download | urpmi-5f0ec80af00591a5479ff11f12470e5ebb02db58.tar urpmi-5f0ec80af00591a5479ff11f12470e5ebb02db58.tar.gz urpmi-5f0ec80af00591a5479ff11f12470e5ebb02db58.tar.bz2 urpmi-5f0ec80af00591a5479ff11f12470e5ebb02db58.tar.xz urpmi-5f0ec80af00591a5479ff11f12470e5ebb02db58.zip |
- urpmi.addmedia, urpmi.update:
o for remote media, instead of first checking reconfig.urpmi, try MD5SUM.
If it fails try reconfig.urpmi
Diffstat (limited to 'urpm/media.pm')
-rw-r--r-- | urpm/media.pm | 28 |
1 files changed, 18 insertions, 10 deletions
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) |