summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-08 14:29:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-08 14:29:16 +0000
commite70af9c6aff2c57bd822415a1e3fd2b8cb994567 (patch)
treeb7bda12519a8683575b15549e8dbc51e8955c1ba
parent8fe06c99a46de3284e2aba96a5c9016b49ac8cb2 (diff)
downloadurpmi-e70af9c6aff2c57bd822415a1e3fd2b8cb994567.tar
urpmi-e70af9c6aff2c57bd822415a1e3fd2b8cb994567.tar.gz
urpmi-e70af9c6aff2c57bd822415a1e3fd2b8cb994567.tar.bz2
urpmi-e70af9c6aff2c57bd822415a1e3fd2b8cb994567.tar.xz
urpmi-e70af9c6aff2c57bd822415a1e3fd2b8cb994567.zip
when doing urpmi.addmedia on a remote medium, we first look for
synthesis.hdlist.cz, but we should also download MD5SUM and check synthesis.hdlist.cz (the checking was only done on urpmi.update)
-rw-r--r--NEWS3
-rw-r--r--urpm/media.pm19
2 files changed, 15 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index dddcfef9..72ace196 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,9 @@
- urpmi.update, urpmi.addmedia, urpmi.removemedia:
o drop option "-c" which used to clean /var/cache/urpmi/headers
o enhancement: only parse updated synthesis
+- urpmi.addmedia
+ o do check md5sum of downloaded synthesis
+ (the check was only done on urpmi.update)
- urpmi:
o do remove __db* on priority-upgrade
(fix regression introduced in 4.10.15)
diff --git a/urpm/media.pm b/urpm/media.pm
index bdb43e33..5a807226 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1171,6 +1171,7 @@ sub _update_medium__parse_if_unmodified__remote {
unlink cachedir_with_synthesis($urpm, $medium);
$options->{callback} and $options->{callback}('failed', $medium->{name});
};
+ my $ok = 1;
if (!_synthesis_dir($medium)) {
my $err;
_probe_with_try_list($urpm, $medium, sub {
@@ -1190,6 +1191,9 @@ sub _update_medium__parse_if_unmodified__remote {
$urpm->{error}(N("...retrieving failed: %s", $err));
return;
};
+
+ $options->{nomd5sum} || _download_MD5SUM($urpm, $medium);
+
} else {
if ($options->{force}) {
unlink cachedir_with_synthesis($urpm, $medium);
@@ -1203,15 +1207,16 @@ sub _update_medium__parse_if_unmodified__remote {
) or $error->(N("...copying failed")), return;
}
}
- my $ok = get_synthesis__remote($urpm, $medium, $options->{callback}, $options->{quiet});
- $ok &&= !$options->{force} || check_synthesis_md5sum($urpm, $medium);
+ $ok = get_synthesis__remote($urpm, $medium, $options->{callback}, $options->{quiet});
+ }
- $options->{callback} and $options->{callback}('done', $medium->{name});
+ $ok &&= !$options->{force} || check_synthesis_md5sum($urpm, $medium);
- if (!$ok) {
- _ignore_medium_on_parse_error($urpm, $medium);
- return;
- }
+ $options->{callback} and $options->{callback}('done', $medium->{name});
+
+ if (!$ok) {
+ _ignore_medium_on_parse_error($urpm, $medium);
+ return;
}
1;
}