summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-13 15:53:01 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-13 15:53:01 +0000
commit370a6d5ffe088e8dc121b770166f34353fc6ba56 (patch)
treef78f66e07bbf311c46605f443793f0510d250472 /urpm.pm
parente5bcf4f42d3b8233a1fcf967207dcf4845ebe9f0 (diff)
downloadurpmi-370a6d5ffe088e8dc121b770166f34353fc6ba56.tar
urpmi-370a6d5ffe088e8dc121b770166f34353fc6ba56.tar.gz
urpmi-370a6d5ffe088e8dc121b770166f34353fc6ba56.tar.bz2
urpmi-370a6d5ffe088e8dc121b770166f34353fc6ba56.tar.xz
urpmi-370a6d5ffe088e8dc121b770166f34353fc6ba56.zip
simplify
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm27
1 files 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";
}