diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-15 15:39:22 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-15 15:39:22 +0000 |
commit | 71868672a11e7a0cabe8a71dfbab7d21a77a84c0 (patch) | |
tree | 0776050adf705166ca4499fe74d77a7c6f8bdc14 /urpm.pm | |
parent | 8255b4073db51f84772ec1f174962eb97060801e (diff) | |
download | urpmi-71868672a11e7a0cabe8a71dfbab7d21a77a84c0.tar urpmi-71868672a11e7a0cabe8a71dfbab7d21a77a84c0.tar.gz urpmi-71868672a11e7a0cabe8a71dfbab7d21a77a84c0.tar.bz2 urpmi-71868672a11e7a0cabe8a71dfbab7d21a77a84c0.tar.xz urpmi-71868672a11e7a0cabe8a71dfbab7d21a77a84c0.zip |
make things more clear (really?)
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -1272,20 +1272,24 @@ sub db_open_or_die { sub _update_media__sync_file { my ($urpm, $medium, $name, $options) = @_; - my $local_name = $name . _hdlist_suffix($medium); + my $found; + if (_hdlist_suffix($medium)) { + my $local_name = $name . _hdlist_suffix($medium); - foreach (reduce_pathname("$medium->{url}/$medium->{with_hdlist}/../$local_name"), - reduce_pathname("$medium->{url}/$name")) { eval { - sync_webfetch($urpm, $medium, [$_], $options, quiet => 1); - - if ($local_name ne $name && -s "$urpm->{cachedir}/partial/$local_name") { - rename("$urpm->{cachedir}/partial/$local_name", - "$urpm->{cachedir}/partial/$name"); - } + sync_webfetch($urpm, $medium, [reduce_pathname("$medium->{url}/$medium->{with_hdlist}/../$local_name")], + $options, quiet => 1); + + rename("$urpm->{cachedir}/partial/$local_name", "$urpm->{cachedir}/partial/$name"); + $found = 1; + }; + } + if (!$found) { + eval { + sync_webfetch($urpm, $medium, [reduce_pathname("$medium->{url}/$name")], $options, quiet => 1); + $found = 1; }; $@ and unlink "$urpm->{cachedir}/partial/$name"; - -s "$urpm->{cachedir}/partial/$name" and last; } } |