From 370a6d5ffe088e8dc121b770166f34353fc6ba56 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 13 Nov 2006 15:53:01 +0000 Subject: simplify --- urpm.pm | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/urpm.pm b/urpm.pm index 8f66f83c..61ab5377 100644 --- a/urpm.pm +++ b/urpm.pm @@ -1566,23 +1566,16 @@ this could happen if you mounted manually the directory when creating the medium } else { $basename = basename($medium->{with_hdlist}); - #- try to sync (copy if needed) local copy after restored the previous one. - $options{force} and unlink "$urpm->{cachedir}/partial/$basename"; - unless ($options{force}) { - if ($medium->{synthesis}) { - if (-e "$urpm->{statedir}/synthesis.$medium->{hdlist}") { - urpm::util::copy( - "$urpm->{statedir}/synthesis.$medium->{hdlist}", - "$urpm->{cachedir}/partial/$basename", - ) or $urpm->{error}(N("...copying failed")), $error = 1; - } - } else { - if (-e "$urpm->{statedir}/$medium->{hdlist}") { - urpm::util::copy( - "$urpm->{statedir}/$medium->{hdlist}", - "$urpm->{cachedir}/partial/$basename", - ) or $urpm->{error}(N("...copying failed")), $error = 1; - } + if ($options{force}) { + unlink "$urpm->{cachedir}/partial/$basename"; + } else { + #- try to sync (copy if needed) local copy after restored the previous one. + my $wanted = ($medium->{synthesis} ? 'synthesis.' : '') . $medium->{hdlist}; + if (-e "$urpm->{statedir}/$wanted") { + urpm::util::copy( + "$urpm->{statedir}/$wanted", + "$urpm->{cachedir}/partial/$basename", + ) or $urpm->{error}(N("...copying failed")), $error = 1; } chown 0, 0, "$urpm->{cachedir}/partial/$basename"; } -- cgit v1.2.1