[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: svn corruption: trunk/packages/po/sublevel4/da.po

On Sunday 18 January 2009, Philip Hands wrote:
>   phil@cold:~/src/debian-svn/d-i$ git svn fetch -r57093:57094
>   Checksum mismatch: trunk/packages/po/sublevel4/da.po c9893a6364a37460e7a8ee1676d7ac0c9e85f59e
>   expected: 2df48ca6c7a79d95b479c4f16eec44ba
>        got: ec0b72182b31be69dcae734015d9e316

By making a small change in git-svn in apply_textdelta() I get:
Checksum check: trunk/packages/po/sublevel4/da.po d22ac0ca8c73fd76313d1a61e47ef213c83b9c45
expected: 2df48ca6c7a79d95b479c4f16eec44ba
     got: 2df48ca6c7a79d95b479c4f16eec44ba
        M       packages/po/sublevel4/da.po
r57094 = 0eb6d42840581acf9d0fc1475a933afd01a0d0ca (trunk)

And afterwards:
$ git show d22ac0ca8c73fd76313d1a61e47ef213c83b9c45 | md5sum
2df48ca6c7a79d95b479c4f16eec44ba  -

The ID of the blob is different, but I guess that's OK. Important thing
is that the "expected" checksum matches what you got.

So, AFAICT the "got" checksum is calculated here:
sub apply_textdelta {
        my ($self, $fb, $exp) = @_;
        my $fh = IO::File->new_tmpfile;
        # $fh gets auto-closed() by SVN::TxDelta::apply(),
        # (but $base does not,) so dup() it for reading in close_file
        open my $dup, '<&', $fh or croak $!;
        my $base = IO::File->new_tmpfile;
        if ($fb->{blob}) {
                print $base 'link ' if ($fb->{mode_a} == 120000);
                my $size = $::_repository->cat_blob($fb->{blob}, $base);
                die "Failed to read object $fb->{blob}" if ($size < 0);

                if (defined $exp) {
                        seek $base, 0, 0 or croak $!;
                        my $got = ::md5sum($base);
                        die "Checksum mismatch: $fb->{path} $fb->{blob}\n",
                            "expected: $exp\n",
                            "     got: $got\n" if ($got ne $exp);

So maybe someone who understands Perl can tell why '::md5sum($base)' is
returning the wrong result here on 32-bit systems.

BTW, my git-svn has: $VERSION = '' (Lenny).


Attachment: signature.asc
Description: This is a digitally signed message part.

Reply to: