Author: adam-guest
Date: 2008-03-24 17:32:08 +0000 (Mon, 24 Mar 2008)
New Revision: 1195

Modified:
   trunk/debian/changelog
   trunk/scripts/debdiff.pl
Log:
debdiff:
+ Make tarball-in-tarball support more intelligent. If a sub-tarball
named foo.tar.gz unpacks to a directory named foo, the directory is
renamed to =unpacked-tarN= so that the directory names match across
the unpacked packages (Closes: #459294)


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-03-24 16:31:36 UTC (rev 1194)
+++ trunk/debian/changelog      2008-03-24 17:32:08 UTC (rev 1195)
@@ -33,8 +33,12 @@
     + Add documentation to the manpage of the current VCS-specific features
     + Make --strip-message also strip leading spaces from continuation lines
     + Strip single change commit messages by default
-  * debdiff: Escape package names when normalising path names
-    (Closes: #471282)
+  * debdiff:
+    + Escape package names when normalising path names (Closes: #471282)
+    + Make tarball-in-tarball support more intelligent. If a sub-tarball
+      named foo.tar.gz unpacks to a directory named foo, the directory is
+      renamed to =unpacked-tarN= so that the directory names match across
+      the unpacked packages (Closes: #459294)
   * debuild:
     + Add a --prepend-path option allowing $PATH to have directories added
       to it once it has been sanitised, for example to add /usr/lib/ccache.

Modified: trunk/scripts/debdiff.pl
===================================================================
--- trunk/scripts/debdiff.pl    2008-03-24 16:31:36 UTC (rev 1194)
+++ trunk/scripts/debdiff.pl    2008-03-24 17:32:08 UTC (rev 1195)
@@ -464,12 +464,20 @@
            }
            closedir(DIR);
            opendir DIR,${"dir$i"}.'/'.${"sdir$i"};
+
+           my $tarballs = 1;
            while ($_ = readdir(DIR)) {
+                   my $unpacked = "=unpacked-tar" . $tarballs . "=";
+                   my $filename = $_;
                    if ($_ =~ /tar.gz$/) {
-                       system qq(cd ${"dir$i"}/${"sdir$i"} && tar zxf $_ 
>/dev/null); 
+                       $filename =~ s%(.*)\.tar\.gz$%$1%;
+                       $tarballs++;
+                       system qq(cd ${"dir$i"}/${"sdir$i"} && tar zxf $_ 
>/dev/null && test -d $filename && mv $filename $unpacked); 
                    }
                    if ($_ =~ /tar.bz$/ || $_ =~ /tar.bz2$/) {
-                       system qq(cd ${"dir$i"}/${"sdir$i"} && tar jxf $_ 
>/dev/null);
+                       $filename =~ s%(.*)\.tar\.bz2?$%$1%;
+                       $tarballs++;
+                       system qq(cd ${"dir$i"}/${"sdir$i"} && tar jxf $_ 
>/dev/null && test -d $filename && mv $filename $unpacked);
                    }
            }
            closedir(DIR);



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to