diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-15 15:33:39 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-15 15:33:39 +0000 |
commit | 8255b4073db51f84772ec1f174962eb97060801e (patch) | |
tree | c955ec095683e7d25b5c2f6079e1d0baee42f443 /urpm.pm | |
parent | 9d2786e3e8f1d055357137eb76b6c803094a748f (diff) | |
download | urpmi-8255b4073db51f84772ec1f174962eb97060801e.tar urpmi-8255b4073db51f84772ec1f174962eb97060801e.tar.gz urpmi-8255b4073db51f84772ec1f174962eb97060801e.tar.bz2 urpmi-8255b4073db51f84772ec1f174962eb97060801e.tar.xz urpmi-8255b4073db51f84772ec1f174962eb97060801e.zip |
cleanup (if we sync_fetch something, we really want it to succeed)
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -853,13 +853,13 @@ sub add_distrib_media { \%options, quiet => 1); $urpm->{log}(N("...retrieving done")); }; - $@ and $urpm->{error}(N("...retrieving failed: %s", $@)); - if (-e "$urpm->{cachedir}/partial/media.cfg") { - $distribconf->parse_mediacfg("$urpm->{cachedir}/partial/media.cfg") - or $urpm->{error}(N("unable to parse media.cfg")), return(); - } else { + if ($@) { + $urpm->{error}(N("...retrieving failed: %s", $@)); $urpm->{error}(N("unable to access the distribution medium (no media.cfg file found)")); return (); + } else { + $distribconf->parse_mediacfg("$urpm->{cachedir}/partial/media.cfg") + or $urpm->{error}(N("unable to parse media.cfg")), return(); } } @@ -1343,11 +1343,7 @@ sub _update_medium__get_descriptions_remote { sync_webfetch($urpm, $medium, [ reduce_pathname("$medium->{url}/media_info/descriptions") ], $options, quiet => 1); }; - #- 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") { + if ($@) { eval { #- try older location sync_webfetch($urpm, $medium, [ reduce_pathname("$medium->{url}/../descriptions") ], |