From f796f81358d135a578dbb0bb3c431a6989b67570 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 14 Nov 2006 12:06:12 +0000 Subject: factorize code --- urpm.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'urpm.pm') 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); } } -- cgit v1.2.1