Przeglądaj źródła

dpkg-source: Integrate readmd5sum from controllib

Raphael Hertzog 18 lat temu
rodzic
commit
f4d652c971
2 zmienionych plików z 10 dodań i 0 usunięć
  1. 3 0
      ChangeLog
  2. 7 0
      scripts/dpkg-source.pl

+ 3 - 0
ChangeLog

@@ -52,6 +52,9 @@
 	anything useful anymore as it got dropped from several other
 	anything useful anymore as it got dropped from several other
 	scripts over the years without problems.
 	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  <hertzog@debian.org>
 2007-12-28  Raphael Hertzog  <hertzog@debian.org>
 
 
 	* scripts/Dpkg/ErrorHandling.pm (syntaxerr): New function to
 	* scripts/Dpkg/ErrorHandling.pm (syntaxerr): New function to

+ 7 - 0
scripts/dpkg-source.pl

@@ -1668,3 +1668,10 @@ sub deoctify {
     return join("", @_);
     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;
+}
+