pristine-tar: Fix behavior in the corner case where the tarball puts all files in...
authorJoey Hess <joey@gnu.kitenet.net>
Wed, 15 Apr 2009 01:11:59 +0000 (21:11 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Wed, 15 Apr 2009 01:11:59 +0000 (21:11 -0400)
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
pristine-tar

index 1a5c814..e86af52 100644 (file)
@@ -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.
index 5d3a6ed..e7cd0f7 100755 (executable)
@@ -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");