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

Accept GNU md5sum style output

Wichert Akkerman лет назад: 24
Родитель
Сommit
d33f7b5880
4 измененных файлов с 12 добавлено и 4 удалено
  1. 6 0
      ChangeLog
  2. 1 1
      scripts/dpkg-genchanges.pl
  3. 2 2
      scripts/dpkg-scanpackages.pl
  4. 3 1
      scripts/dpkg-scansources.pl

+ 6 - 0
ChangeLog

@@ -1,6 +1,12 @@
+Thu Jan  3 15:49:14 CET 2002 Wichert Akkerman <wakkerma@debian.org>
+
+  * scripts/dpkg-genchanges.pl, scripts/dpkg-scanpackages.pl,
+    scripts/dpkg-scansources.pl: Accept GNU md5sum style output
+
 Thu Jan  3 15:20:25 CET 2002 Wichert Akkerman <wakkerma@debian.org>
 
   * utils/md5sum.c: add error handling to do_check
+
 Wed Jan  2 16:08:02 CET 2002 Wichert Akkerman <wakkerma@debian.org>
 
   * scripts/dpkg-source.pl: Update default ignore expression to also

+ 1 - 1
scripts/dpkg-genchanges.pl

@@ -321,7 +321,7 @@ for $f (@sourcefiles,@fileslistfiles) {
     (@s=stat(STDIN)) || &syserr("cannot fstat upload file $uf");
     $size= $s[7]; $size || &warn("upload file $uf is empty");
     $md5sum=`md5sum`; $? && subprocerr("md5sum upload file $uf");
-    $md5sum =~ m/^([0-9a-f]{32})\s*$/i ||
+    $md5sum =~ m/^([0-9a-f]{32})\s*-?\s*$/i ||
         &failure("md5sum upload file $uf gave strange output \`$md5sum'");
     $md5sum= $1;
     defined($md5sum{$f}) && $md5sum{$f} ne $md5sum &&

+ 2 - 2
scripts/dpkg-scanpackages.pl

@@ -102,8 +102,8 @@ while (<F>) {
 
     open(C,"md5sum <$fn |") || die "$fn $!";
     chop($_=<C>); close(C); $? and die "\`md5sum < $fn' exited with $?\n";
-    /^[0-9a-f]{32}$/ or die "Strange text from \`md5sum < $fn': \`$_'\n";
-    $tv{'MD5sum'}= $_;
+    /^[0-9a-f]{32}\s*-?\s*$/ or die "Strange text from \`md5sum < $fn': \`$_'\n";
+    $tv{'MD5sum'}= $1;
 
     @stat= stat($fn) or die "Couldn't stat $fn: $!\n";
     $stat[7] or die "$fn is empty\n";

+ 3 - 1
scripts/dpkg-scansources.pl

@@ -3,7 +3,8 @@ use strict;
 
 # $Id$
 
-# Copyright (C) 1999 Roderick Schertler
+# Copyright 1999 Roderick Schertler
+# Copyright 2002 Wichert Akkerman <wakkerma@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -289,6 +290,7 @@ sub read_dsc {
 	xwarn_noerror close_msg 'md5sum';
 	return;
     }
+    $md5 =~ s/ *-$//; # Remove trailing spaces and -, to work with GNU md5sum
     unless (length($md5) == 32 && $md5 !~ /[^\da-f]/i) {
 	xwarn_noerror "invalid md5 output for $file ($md5)\n";
 	return;