Просмотр исходного кода

dpkg-source: Integrate readmd5sum from controllib

Raphael Hertzog лет назад: 18
Родитель
Сommit
f4d652c971
2 измененных файлов с 10 добавлено и 0 удалено
  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
 	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>
 
 	* scripts/Dpkg/ErrorHandling.pm (syntaxerr): New function to

+ 7 - 0
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;
+}
+