summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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}");
}