summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-01-03 18:54:17 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-01-03 18:54:17 +0000
commit69fb2a40b53e18b47ba58ef7cae596aa77ddb24e (patch)
treed4cd6c3903a775d446ce241f5f5ecbb4bdcdbc79 /urpm.pm
parenta1c8899efa1620762ef9ac0fc8728bf8482c5f5c (diff)
downloadurpmi-69fb2a40b53e18b47ba58ef7cae596aa77ddb24e.tar
urpmi-69fb2a40b53e18b47ba58ef7cae596aa77ddb24e.tar.gz
urpmi-69fb2a40b53e18b47ba58ef7cae596aa77ddb24e.tar.bz2
urpmi-69fb2a40b53e18b47ba58ef7cae596aa77ddb24e.tar.xz
urpmi-69fb2a40b53e18b47ba58ef7cae596aa77ddb24e.zip
There's no point in scanning all media for a matching MD5SUM, just directly
look at the media we're updating. In case of multiple enabled media using the same hdlist, only one used to be correctly marked modified, so the changes of md5sum for others were silently ignored, and breakage ensued.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm84
1 files changed, 36 insertions, 48 deletions
diff --git a/urpm.pm b/urpm.pm
index ca34b86c..9250f8dc 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1235,31 +1235,25 @@ this could happen if you mounted manually the directory when creating the medium
#- the files are the same.
#- If the local md5sum is the same as the distant md5sum, this means
#- that there is no need to download the hdlist or synthesis file again.
- if (defined $retrieved_md5sum) {
- foreach (@{$urpm->{media}}) {
- if ($_->{md5sum} && $_->{md5sum} eq $retrieved_md5sum) {
- unlink "$urpm->{cachedir}/partial/$basename";
- #- the medium is now considered not modified.
- $medium->{modified} = 0;
- #- XXX we could link the new hdlist to the old one.
- #- (However links need to be managed. see bug #12391.)
- #- as previously done, just read synthesis file here, this is enough.
- $urpm->{log}(N("examining synthesis file [%s]",
- "$urpm->{statedir}/synthesis.$medium->{hdlist}"));
- ($medium->{start}, $medium->{end}) =
- $urpm->parse_synthesis("$urpm->{statedir}/synthesis.$medium->{hdlist}");
- unless (defined $medium->{start} && defined $medium->{end}) {
- $urpm->{log}(N("examining hdlist file [%s]", "$urpm->{statedir}/$medium->{hdlist}"));
- ($medium->{start}, $medium->{end}) =
- $urpm->parse_hdlist("$urpm->{statedir}/$medium->{hdlist}", packing => 1);
- unless (defined $medium->{start} && defined $medium->{end}) {
- $urpm->{error}(N("problem reading hdlist or synthesis file of medium \"%s\"",
- $medium->{name}));
- $medium->{ignore} = 1;
- }
- }
- #- no need to continue examining other md5sum.
- last;
+ if (defined $retrieved_md5sum && $medium->{md5sum} eq $retrieved_md5sum) {
+ unlink "$urpm->{cachedir}/partial/$basename";
+ #- the medium is now considered not modified.
+ $medium->{modified} = 0;
+ #- XXX we could link the new hdlist to the old one.
+ #- (However links need to be managed. see bug #12391.)
+ #- as previously done, just read synthesis file here, this is enough.
+ $urpm->{log}(N("examining synthesis file [%s]",
+ "$urpm->{statedir}/synthesis.$medium->{hdlist}"));
+ ($medium->{start}, $medium->{end}) =
+ $urpm->parse_synthesis("$urpm->{statedir}/synthesis.$medium->{hdlist}");
+ unless (defined $medium->{start} && defined $medium->{end}) {
+ $urpm->{log}(N("examining hdlist file [%s]", "$urpm->{statedir}/$medium->{hdlist}"));
+ ($medium->{start}, $medium->{end}) =
+ $urpm->parse_hdlist("$urpm->{statedir}/$medium->{hdlist}", packing => 1);
+ unless (defined $medium->{start} && defined $medium->{end}) {
+ $urpm->{error}(N("problem reading hdlist or synthesis file of medium \"%s\"",
+ $medium->{name}));
+ $medium->{ignore} = 1;
}
}
}
@@ -1511,29 +1505,23 @@ this could happen if you mounted manually the directory when creating the medium
#- files are the same.
#- if local md5sum is the same as distant md5sum, this means there is no need to
#- download hdlist or synthesis file again.
- if (defined $retrieved_md5sum) {
- foreach (@{$urpm->{media}}) {
- if ($_->{md5sum} && $_->{md5sum} eq $retrieved_md5sum) {
- unlink "$urpm->{cachedir}/partial/$basename";
- #- the medium is now considered not modified.
- $medium->{modified} = 0;
- #- XXX we could link the new hdlist to the old one.
- #- (However links need to be managed. see bug #12391.)
- #- as previously done, just read synthesis file here, this is enough.
- $urpm->{log}(N("examining synthesis file [%s]", "$urpm->{statedir}/synthesis.$medium->{hdlist}"));
- ($medium->{start}, $medium->{end}) =
- $urpm->parse_synthesis("$urpm->{statedir}/synthesis.$medium->{hdlist}");
- unless (defined $medium->{start} && defined $medium->{end}) {
- $urpm->{log}(N("examining hdlist file [%s]", "$urpm->{statedir}/$medium->{hdlist}"));
- ($medium->{start}, $medium->{end}) =
- $urpm->parse_hdlist("$urpm->{statedir}/$medium->{hdlist}", packing => 1);
- unless (defined $medium->{start} && defined $medium->{end}) {
- $urpm->{error}(N("problem reading synthesis file of medium \"%s\"", $medium->{name}));
- $medium->{ignore} = 1;
- }
- }
- #- no need to continue examining other md5sum.
- last;
+ if (defined $retrieved_md5sum && $medium->{md5sum} eq $retrieved_md5sum) {
+ unlink "$urpm->{cachedir}/partial/$basename";
+ #- the medium is now considered not modified.
+ $medium->{modified} = 0;
+ #- XXX we could link the new hdlist to the old one.
+ #- (However links need to be managed. see bug #12391.)
+ #- as previously done, just read synthesis file here, this is enough.
+ $urpm->{log}(N("examining synthesis file [%s]", "$urpm->{statedir}/synthesis.$medium->{hdlist}"));
+ ($medium->{start}, $medium->{end}) =
+ $urpm->parse_synthesis("$urpm->{statedir}/synthesis.$medium->{hdlist}");
+ unless (defined $medium->{start} && defined $medium->{end}) {
+ $urpm->{log}(N("examining hdlist file [%s]", "$urpm->{statedir}/$medium->{hdlist}"));
+ ($medium->{start}, $medium->{end}) =
+ $urpm->parse_hdlist("$urpm->{statedir}/$medium->{hdlist}", packing => 1);
+ unless (defined $medium->{start} && defined $medium->{end}) {
+ $urpm->{error}(N("problem reading synthesis file of medium \"%s\"", $medium->{name}));
+ $medium->{ignore} = 1;
}
}
}