It would be cleaner to test the tarball's magic to see if it's a regular,
non-compressed tarball. But, there are a lot of historical tar-like
formats, so implementing magic for tar is hard. (And I don't use file(1)
in pristine-tar).
Anyway, this also catches any other failure that can result in a delta >=
the size of the input. Completely failing to get any of the input files
right could also make this happen, perhaps.
+pristine-tar (1.17) UNRELEASED; urgency=low
+
+ * pristine-tar: Fail when the delta is excessively large, probably
+ due to the tarball being compressed with something that tar x can
+ auto-extract, but that pristine-tar does not support.
+
+ -- Joey Hess <joeyh@debian.org> Mon, 09 Jan 2012 11:41:49 -0400
+
pristine-tar (1.16) unstable; urgency=low
* pristine-bz2: Can recreate bz2 files greated by Suse's
error "xdelta failed with return code $ret";
}
+ if (-s $delta{delta} >= -s $tarball) {
+ print STDERR "error: excessively large binary delta for $tarball\n";
+ if (! defined $compression) {
+ print STDERR "(Probably the tarball is compressed with an unsupported form of compression.)\n";
+ }
+ else {
+ print STDERR "(Please consider filing a bug report.)\n";
+ }
+ exit 1;
+ }
+
Pristine::Tar::Delta::write(Tarball => $deltafile, {
version => 2,
type => 'tar',