From: Ansgar Burchardt Date: Thu, 6 Dec 2012 10:47:10 +0000 (+0100) Subject: debianqueued: use Digest::MD5 instead of external md5sum binary X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5814e84874cf5fb0566c157173315faa376915fd;p=dak debianqueued: use Digest::MD5 instead of external md5sum binary --- diff --git a/tools/debianqueued-0.9/debianqueued b/tools/debianqueued-0.9/debianqueued index 393f0a0f..776fffea 100755 --- a/tools/debianqueued-0.9/debianqueued +++ b/tools/debianqueued-0.9/debianqueued @@ -23,6 +23,7 @@ use Socket qw( PF_INET AF_INET SOCK_STREAM ); use Config; use Sys::Hostname; use File::Copy; +use Digest::MD5; setlocale(&POSIX::LC_ALL, "C"); @@ -2212,14 +2213,12 @@ sub rm(@) { # sub md5sum($) { my $file = shift; - my $line; - - chomp( $line = `$conf::md5sum $file` ); - debug( "md5sum($file): ", - $? ? "exit status $?" - : $line =~ /^(\S+)/ ? $1 - : "match failed" ); - return $? ? "" : $line =~ /^(\S+)/ ? $1 : ""; + + open my $fh, "<", $file or return ""; + my $md5 = $md5->addfile($fh); + close $fh; + + return $md5->hexdigest; } ## end sub md5sum($) #