From 9d57a88c0825a0098a89a7f7f1af31b58a836bf3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 14 Apr 2009 21:11:59 -0400 Subject: [PATCH] pristine-tar: Fix behavior in the corner case where the tarball puts all files in a subdir, but does not contain the subdir's directory entry. I think that this block of code has always been buggy. It attempts to see if all files listed in the manifest are present inside the subdir. Usually, though, the manifest *includes* the subdir, and so the code checked to see if $subdir/$subdir existed, and concluded everything was not in the subdir. Turns out there is one tar file that lists files inside a subdir, but does not include the subdir. In that case, the code concludes correctly that all files are in a subdir. But, the result of that turns out to be bad; unsettting $subdir breaks the build since it then tries to move the wrong path. --- debian/changelog | 3 +++ pristine-tar | 15 --------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1a5c814..e86af52 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,9 @@ pristine-tar (1.00) UNRELEASED; urgency=low recreating the gz in some cases. * Add aliases ci and co for commit and checkout. Closes: #500388 * pristine-gz: Fix generation of gz files that have a null filename field. + * pristine-tar: Fix behavior in the corner case where the tarball + puts all files in a subdir, but does not contain the subdir's directory + entry. Stats: 1 failure Deltas for all 14446 tarballs in the Debian archive now use 305 MB total. diff --git a/pristine-tar b/pristine-tar index 5d3a6ed..e7cd0f7 100755 --- a/pristine-tar +++ b/pristine-tar @@ -231,21 +231,6 @@ sub recreatetarball { } } - if (length $subdir && -d "$source/$subdir") { - my $all_in_subdir=1; - foreach my $file (@manifest) { - if (! -e "$source/$file" && - ! -l "$source/$file") { - $all_in_subdir=0; - last; - } - } - if ($all_in_subdir) { - debug("source already in subdir $subdir"); - $subdir=""; - } - } - if (length $subdir) { debug("subdir is $subdir"); doit("mkdir", "$tempdir/workdir"); -- 2.7.4