summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-14 12:06:12 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-14 12:06:12 +0000
commitf796f81358d135a578dbb0bb3c431a6989b67570 (patch)
tree839da06fe4a89a1a4ad9a4e6bc2bce90038c469e
parent429c79a35ce4ee08558a5b3eba79ecfd943da5ac (diff)
downloadurpmi-f796f81358d135a578dbb0bb3c431a6989b67570.tar
urpmi-f796f81358d135a578dbb0bb3c431a6989b67570.tar.gz
urpmi-f796f81358d135a578dbb0bb3c431a6989b67570.tar.bz2
urpmi-f796f81358d135a578dbb0bb3c431a6989b67570.tar.xz
urpmi-f796f81358d135a578dbb0bb3c431a6989b67570.zip
factorize code
-rw-r--r--urpm.pm9
1 files changed, 3 insertions, 6 deletions
diff --git a/urpm.pm b/urpm.pm
index 9705d209..005a3471 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -3386,12 +3386,9 @@ sub compute_local_md5sum {
my ($urpm, $medium) = @_;
$urpm->{log}(N("computing md5sum of existing source hdlist (or synthesis)"));
- if ($medium->{synthesis}) {
- -e statedir_synthesis($urpm, $medium) and
- $medium->{md5sum} = md5sum(statedir_synthesis($urpm, $medium));
- } else {
- -e statedir_hdlist($urpm, $medium) and
- $medium->{md5sum} = md5sum(statedir_hdlist($urpm, $medium));
+ my $f = $medium->{synthesis} ? statedir_synthesis($urpm, $medium) : statedir_hdlist($urpm, $medium);
+ if (-e $f) {
+ $medium->{md5sum} = md5sum($f);
}
}