summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-02-01 17:43:19 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-02-01 17:43:19 +0000
commit3fc070c42b6158f085de20f843697d689a32842b (patch)
treecdf4f6a3cb027b52994c11bed59fd41e98bee71d /urpm.pm
parente2e7a6c666eb615770d59b1b7db900f9bd159a67 (diff)
downloadurpmi-3fc070c42b6158f085de20f843697d689a32842b.tar
urpmi-3fc070c42b6158f085de20f843697d689a32842b.tar.gz
urpmi-3fc070c42b6158f085de20f843697d689a32842b.tar.bz2
urpmi-3fc070c42b6158f085de20f843697d689a32842b.tar.xz
urpmi-3fc070c42b6158f085de20f843697d689a32842b.zip
Patch by Shlomi Fish to fix error recovery on download of description files.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/urpm.pm b/urpm.pm
index 504eff54..cc0d0f08 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1438,10 +1438,16 @@ this could happen if you mounted manually the directory when creating the medium
media => $medium->{name},
};
eval { $urpm->{sync}($syncopts, reduce_pathname("$medium->{url}/media_info/descriptions")) };
- -e "$urpm->{cachedir}/partial/descriptions" or eval {
- #- try older location
- $urpm->{sync}($syncopts, reduce_pathname("$medium->{url}/../descriptions"));
- };
+ #- It is possible that the original fetch of the descriptions
+ #- failed, but the file still remains in partial/ because it was
+ #- moved from $urpm->{statedir} earlier. So we need to check if
+ #- the previous download failed.
+ if ($@ || (! -e "$urpm->{cachedir}/partial/descriptions")) {
+ eval {
+ #- try older location
+ $urpm->{sync}($syncopts, reduce_pathname("$medium->{url}/../descriptions"));
+ };
+ }
if (-e "$urpm->{cachedir}/partial/descriptions") {
urpm::util::move("$urpm->{cachedir}/partial/descriptions", "$urpm->{statedir}/descriptions.$medium->{name}");
}