summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-13 15:36:35 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-13 15:36:35 +0000
commitf15b9b4cd5c6d464ac082c4b505156046b03d0c1 (patch)
tree35c722deb6fa2688e03473d0bfcf1aff1d25f8ec /urpm.pm
parent6a30386e66b09c554f90d5cd78422ce69d94a994 (diff)
downloadurpmi-f15b9b4cd5c6d464ac082c4b505156046b03d0c1.tar
urpmi-f15b9b4cd5c6d464ac082c4b505156046b03d0c1.tar.gz
urpmi-f15b9b4cd5c6d464ac082c4b505156046b03d0c1.tar.bz2
urpmi-f15b9b4cd5c6d464ac082c4b505156046b03d0c1.tar.xz
urpmi-f15b9b4cd5c6d464ac082c4b505156046b03d0c1.zip
simplify
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm15
1 files changed, 5 insertions, 10 deletions
diff --git a/urpm.pm b/urpm.pm
index 4e0dac45..9cb8e19b 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1363,9 +1363,8 @@ this could happen if you mounted manually the directory when creating the medium
#- check if the files are equal... and no force copy...
if (!$error && !$options{force} && -e "$urpm->{statedir}/synthesis.$medium->{hdlist}") {
- my @sstat = stat "$urpm->{cachedir}/partial/$medium->{hdlist}";
- my @lstat = stat "$urpm->{statedir}/$medium->{hdlist}";
- if ($sstat[7] == $lstat[7] && $sstat[9] == $lstat[9]) {
+ if (same_size_and_mtime("$urpm->{cachedir}/partial/$medium->{hdlist}",
+ "$urpm->{statedir}/$medium->{hdlist}")) {
#- the two files are considered equal here, the medium is so not modified.
$medium->{modified} = 0;
unlink "$urpm->{cachedir}/partial/$medium->{hdlist}";
@@ -1374,10 +1373,7 @@ this could happen if you mounted manually the directory when creating the medium
_parse_synthesis($urpm, $medium, "$urpm->{statedir}/synthesis.$medium->{hdlist}");
if (!is_valid_medium($medium)) {
_parse_hdlist($urpm, $medium, "$urpm->{statedir}/$medium->{hdlist}", packing => 1);
- if (!is_valid_medium($medium)) {
- $urpm->{error}(N("problem reading synthesis file of medium \"%s\"", $medium->{name}));
- $medium->{ignore} = 1;
- }
+ _check_after_reading_hdlist_or_synthesis($urpm, $medium);
}
return;
}
@@ -1607,9 +1603,8 @@ this could happen if you mounted manually the directory when creating the medium
$urpm->{log}(N("...retrieving done"));
unless ($options{force}) {
- my @sstat = stat "$urpm->{cachedir}/partial/$basename";
- my @lstat = stat "$urpm->{statedir}/$medium->{hdlist}";
- if ($sstat[7] == $lstat[7] && $sstat[9] == $lstat[9]) {
+ if (same_size_and_mtime("$urpm->{cachedir}/partial/$basename",
+ "$urpm->{statedir}/$medium->{hdlist}")) {
#- the two files are considered equal here, the medium is so not modified.
$medium->{modified} = 0;
unlink "$urpm->{cachedir}/partial/$basename";