diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-13 15:53:01 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-13 15:53:01 +0000 |
commit | 370a6d5ffe088e8dc121b770166f34353fc6ba56 (patch) | |
tree | f78f66e07bbf311c46605f443793f0510d250472 | |
parent | e5bcf4f42d3b8233a1fcf967207dcf4845ebe9f0 (diff) | |
download | urpmi-370a6d5ffe088e8dc121b770166f34353fc6ba56.tar urpmi-370a6d5ffe088e8dc121b770166f34353fc6ba56.tar.gz urpmi-370a6d5ffe088e8dc121b770166f34353fc6ba56.tar.bz2 urpmi-370a6d5ffe088e8dc121b770166f34353fc6ba56.tar.xz urpmi-370a6d5ffe088e8dc121b770166f34353fc6ba56.zip |
simplify
-rw-r--r-- | urpm.pm | 27 |
1 files changed, 10 insertions, 17 deletions
@@ -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"; } |