Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CVS dpkg md5sum fix

12 views
Skip to first unread message

Wichert Akkerman

unread,
Dec 31, 2001, 9:14:08 AM12/31/01
to
Previously YAEGASHI Takeshi wrote:
> Here is another fix. Some dpkg scripts fail because newer md5sum adds
> trailing "-" to the output.

Isn't that the same fix that was commited to CVS HEAD on June 20?
The ChangeLog seems to indicate that.

Wichert.

--
_________________________________________________________________
/wic...@wiggy.net This space intentionally left occupied \
| wic...@deephackmode.org http://www.liacs.nl/~wichert/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0 2805 3CB8 9250 2FA3 BC2D |


--
To UNSUBSCRIBE, email to debian-dp...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

YAEGASHI Takeshi

unread,
Dec 31, 2001, 9:11:39 AM12/31/01
to
Hi,

Here is another fix. Some dpkg scripts fail because newer md5sum adds
trailing "-" to the output.


Index: scripts/dpkg-genchanges.pl
===================================================================
RCS file: /cvs/dpkg/dpkg/scripts/dpkg-genchanges.pl,v
retrieving revision 1.14
diff -u -r1.14 dpkg-genchanges.pl
--- scripts/dpkg-genchanges.pl 2001/06/20 16:30:15 1.14
+++ scripts/dpkg-genchanges.pl 2001/12/31 14:02:13
@@ -321,9 +321,10 @@
(@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 ||
+ chomp($md5sum);
+ $md5sum =~ s/ *-$//; # Remove trailing spaces and -, to work with GNU md5sum
+ $md5sum =~ m/^[0-9a-f]{32}$/ ||
&failure("md5sum upload file $uf gave strange output \`$md5sum'");
- $md5sum= $1;
defined($md5sum{$f}) && $md5sum{$f} ne $md5sum &&
&error("md5sum of source file $uf ($md5sum) is different from md5sum in $dsc".
" ($md5sum{$f})");
Index: scripts/dpkg-scanpackages.pl
===================================================================
RCS file: /cvs/dpkg/dpkg/scripts/dpkg-scanpackages.pl,v
retrieving revision 1.10
diff -u -r1.10 dpkg-scanpackages.pl
--- scripts/dpkg-scanpackages.pl 2001/06/20 16:30:15 1.10
+++ scripts/dpkg-scanpackages.pl 2001/12/31 14:02:14
@@ -102,6 +102,7 @@

open(C,"md5sum <$fn |") || die "$fn $!";
chop($_=<C>); close(C); $? and die "\`md5sum < $fn' exited with $?\n";
+ s/ *-$//; # Remove trailing spaces and -, to work with GNU md5sum
/^[0-9a-f]{32}$/ or die "Strange text from \`md5sum < $fn': \`$_'\n";
$tv{'MD5sum'}= $_;

Index: scripts/dpkg-scansources.pl
===================================================================
RCS file: /cvs/dpkg/dpkg/scripts/dpkg-scansources.pl,v
retrieving revision 1.5
diff -u -r1.5 dpkg-scansources.pl
--- scripts/dpkg-scansources.pl 2000/11/24 16:01:12 1.5
+++ scripts/dpkg-scansources.pl 2001/12/31 14:02:14
@@ -285,6 +285,7 @@
exec 'md5sum' or xdie "can't exec md5sum:";
}
chomp($md5 = join '', <MD5>);
+ $md5 =~ s/ *-$//; # Remove trailing spaces and -, to work with GNU md5sum
unless (close MD5) {
xwarn_noerror close_msg 'md5sum';
return;
Index: scripts/dpkg-source.pl
===================================================================
RCS file: /cvs/dpkg/dpkg/scripts/dpkg-source.pl,v
retrieving revision 1.26
diff -u -r1.26 dpkg-source.pl
--- scripts/dpkg-source.pl 2001/07/17 15:03:55 1.26
+++ scripts/dpkg-source.pl 2001/12/31 14:02:15
@@ -1071,7 +1071,9 @@
$size= (stat _)[7];
my $md5sum= `md5sum <$filename`;
$? && &subprocerr("md5sum $filename");
- $md5sum =~ s/^([0-9a-f]{32})\n$/$1/ || &failure("md5sum gave bogus output \`$_'");
+ chomp($md5sum);
+ $md5sum =~ s/ *-$//; # Remove trailing spaces and -, to work with GNU md5sum
+ $md5sum =~ m/^[0-9a-f]{32}$/ || &failure("md5sum gave bogus output \`$_'");
$f{'Files'}.= "\n $md5sum $size $filename";
}

--
YAEGASHI Takeshi <t...@keshi.org> <tak...@yaegashi.jp> <yaeg...@dodes.org>

Fumitoshi UKAI

unread,
Dec 31, 2001, 9:28:19 AM12/31/01
to
At Mon, 31 Dec 2001 15:13:41 +0100,

Wichert Akkerman wrote:
>
> Previously YAEGASHI Takeshi wrote:
> > Here is another fix. Some dpkg scripts fail because newer md5sum adds
> > trailing "-" to the output.
>
> Isn't that the same fix that was commited to CVS HEAD on June 20?
> The ChangeLog seems to indicate that.

I don't think so.

| 1.12 (doogie 28-Nov-01): printf("%s %c-\n", digest, bin_mode ? '*' : ' ');

| revision 1.12
| date: 2001/11/28 23:30:31; author: doogie; state: Exp; lines: +1 -1
| When parsing stdin, md5sum now displays '-' as the filename, to match
| textutils md5sum.

Yaegashi's patches are for this changes.

Thanks,
Fumitoshi UKAI

YAEGASHI Takeshi

unread,
Dec 31, 2001, 10:56:17 PM12/31/01
to
Hi and happy new year,

At Mon, 31 Dec 2001 23:27:17 +0900,
Fumitoshi UKAI wrote:

> At Mon, 31 Dec 2001 15:13:41 +0100,
> Wichert Akkerman wrote:
> >
> > Previously YAEGASHI Takeshi wrote:
> > > Here is another fix. Some dpkg scripts fail because newer md5sum adds
> > > trailing "-" to the output.
> >
> > Isn't that the same fix that was commited to CVS HEAD on June 20?
> > The ChangeLog seems to indicate that.

It seems that fix was partial. There are still md5sum calls that need
to be fixed, as you see.


> I don't think so.
>
> | 1.12 (doogie 28-Nov-01): printf("%s %c-\n", digest, bin_mode ? '*' : ' ');
>
> | revision 1.12
> | date: 2001/11/28 23:30:31; author: doogie; state: Exp; lines: +1 -1
> | When parsing stdin, md5sum now displays '-' as the filename, to match
> | textutils md5sum.
>
> Yaegashi's patches are for this changes.

That's right. We always need the treatment for trailing "-" even with
md5sum provided by dpkg.deb.

YAEGASHI Takeshi

unread,
Jan 1, 2002, 5:04:35 PM1/1/02
to
Hi,

At Tue, 01 Jan 2002 12:55:51 +0900,
YAEGASHI Takeshi wrote:

> > | 1.12 (doogie 28-Nov-01): printf("%s %c-\n", digest, bin_mode ? '*' : ' ');
> >
> > | revision 1.12
> > | date: 2001/11/28 23:30:31; author: doogie; state: Exp; lines: +1 -1
> > | When parsing stdin, md5sum now displays '-' as the filename, to match
> > | textutils md5sum.
> >
> > Yaegashi's patches are for this changes.
>
> That's right. We always need the treatment for trailing "-" even with
> md5sum provided by dpkg.deb.

Wichert, how do you think about this fix?

It's obvious that current CVS dpkg-dev scripts are useless for
packaging purposes. Some fixes would be needed anyway, whether my
patch was acceptable or not.

YAEGASHI Takeshi

unread,
Jan 3, 2002, 10:21:19 AM1/3/02
to
Hi,

At Thu, 3 Jan 2002 15:55:48 +0100,
Wichert Akkerman wrote:

> Previously YAEGASHI Takeshi wrote:
> > Here is another fix. Some dpkg scripts fail because newer md5sum adds
> > trailing "-" to the output.
>

> I just commited a different version of this to CVS.

Thanks. But unfortunately it seems insufficient...

% dpkg-buildpackage -rfakeroot -uc -us
dpkg-buildpackage: source package is dpkg
dpkg-buildpackage: source version is 1.10
dpkg-buildpackage: source maintainer is Wichert Akkerman <wakk...@debian.org>
dpkg-buildpackage: host architecture is i386
fakeroot debian/rules clean
test -f include/dpkg.h.in
rm -f debian/files debian/substvars
rm -f debian/dpkg.substvars debian/dpkg-static.substvars
rm -fr /home/yaegashi/cvs/cvs.debian.org/dpkg/dpkg/build /home/yaegashi/cvs/cvs.debian.org/dpkg/dpkg/build-static /home/yaegashi/cvs/cvs.debian.org/dpkg/dpkg/debian/tmp
rm -f po/{cat-id-tbl.c,stamp-cat-id,*.gmo}
rm -f stamp-build stamp-binary
dpkg-source -b dpkg
dpkg-source: warning: source directory `./dpkg' is not <sourcepackage>-<upstreamversion> `dpkg-1.10'
dpkg-source: building dpkg in dpkg_1.10.tar.gz
dpkg-source: failure: md5sum gave bogus output `'

Wichert Akkerman

unread,
Jan 3, 2002, 10:45:05 AM1/3/02
to
Previously YAEGASHI Takeshi wrote:
> Thanks. But unfortunately it seems insufficient...

Already fixed :)

Wichert.

--
_________________________________________________________________
/wic...@wiggy.net This space intentionally left occupied \
| wic...@deephackmode.org http://www.liacs.nl/~wichert/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0 2805 3CB8 9250 2FA3 BC2D |

0 new messages