From: Raphael Hertzog Date: Tue, 1 Jan 2008 15:13:26 +0000 (+0100) Subject: dpkg-source: Integrate readmd5sum from controllib X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4d652c97156ddefaeef06c9060632efa0f64706;p=dpkg dpkg-source: Integrate readmd5sum from controllib --- diff --git a/ChangeLog b/ChangeLog index 2cd89bb3..6359b943 100644 --- a/ChangeLog +++ b/ChangeLog @@ -52,6 +52,9 @@ anything useful anymore as it got dropped from several other scripts over the years without problems. + * scripts/dpkg-source.pl: Integrate readmd5sum from controllib here + as it's the only user of that function. + 2007-12-28 Raphael Hertzog * scripts/Dpkg/ErrorHandling.pm (syntaxerr): New function to diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 6fee10e1..caf104dc 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -1668,3 +1668,10 @@ sub deoctify { return join("", @_); } } +sub readmd5sum { + (my $md5sum = shift) or return; + $md5sum =~ s/^([0-9a-f]{32})\s*\*?-?\s*\n?$/$1/o + || failure(_g("md5sum gave bogus output `%s'"), $md5sum); + return $md5sum; +} +