Skip Menu |

This queue is for tickets about the SVN-Dumpfile CPAN distribution.

Report information
The Basics
Id: 45229
Status: resolved
Priority: 0/
Queue: SVN-Dumpfile

People
Owner: martin [...] scharrer-online.de
Requestors: glarkin [...] sourcehosting.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.13.106
Fixed in: (no value)



Subject: Parse error and exit after "no UUID" warning
I generated a Subversion dump file from a Microsoft VSS repository by using the Polarion svnimporter tool (http://community.polarion.com/index.php?page=overview&project=svnimporter). While trying to write a Perl script to fix some issues with the dumpfile due to bugs in the svnimporter, I also discovered that it omits the UUID: header in the file. SVN::Dumpfile catches this condition, carps about it and presumably continues along. However, shortly after that, a syntax error is emitted and the script exits. I have attached a simple dump file that exhibits the problem. I found that the Revision-number line is consumed by the UUID check, and when code in Node.pm attempts to read the dumpfile node, it can't locate the revision number. I get a sequence of errors like this: Error: Dumpfile looks invalid. Couldn't find valid 'UUID' header. at ./fix_dump.pl line 16 No node start found at input file position 75. at /usr/lib/perl5/site_perl/5.10/SVN/Dumpfile/Node.pm line 221 My attached diff saves the current file position, and if the UUID header isn't present, it restores it so parsing will not fail later. I read another SVN::Dumpfile bug description, and it's possible that my patch will break usage when reading from a pipe. If that's the case, is there another way to fix the problem? Thank you, Greg Larkin SourceHosting.net, LLC http://www.sourcehosting.net/
Subject: Dumpfile.pm.diff
--- /usr/lib/perl5/site_perl/5.10/SVN/Dumpfile.pm.orig 2009-04-22 15:01:02.763220400 -0400 +++ /usr/lib/perl5/site_perl/5.10/SVN/Dumpfile.pm 2009-04-22 15:03:25.669470400 -0400 @@ -273,6 +273,7 @@ } if ( $self->{'SVN-fs-dump-format-version'} > 1 ) { + my $pos = $fh->tell; while ( ( $line = $fh->getline ) =~ /^$/ ) { } if ( $line =~ /^UUID: (.*)$/ ) { $self->{'UUID'} = $1; @@ -280,6 +281,8 @@ else { carp "Error: Dumpfile looks invalid. Couldn't find valid ", "'UUID' header.\n"; + # reset filehandle position + $fh->seek($pos, 0); } # read blank line after UUID:
Subject: no-uuid-out-of-order.dump
Download no-uuid-out-of-order.dump
application/octet-stream 1014b

Message body not shown because it is not plain text.

Thanks for bug report and the patch. However, I did not used it but used $fh->getc to check if the next line starts with 'U'. If so it is assumed to be a 'UUID' line, if not the character is pushed back to the input buffer using $fh->ungetc. This seems to be safe enough and will also work with pipes. I uploaded this now as version 0.13.107. The test dumpfile provided by you works with this version. If the dumpfile is recreated using the module a new UUID is added to it. Best, Martin