UpstreamSource.pack: reuse unpacked dir if no filter is used
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 6 Jun 2013 12:21:48 +0000 (15:21 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 14 Nov 2014 12:22:08 +0000 (14:22 +0200)
Set the unpacked attribute to the source dir if the content is not
filtered.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp/pkg/__init__.py

index b6d77ae..2029ec5 100644 (file)
@@ -540,7 +540,11 @@ class UpstreamSource(object):
         except gbpc.CommandExecFailed:
             # repackArchive already printed an error
             raise GbpError
-        return type(self)(newarchive)
+        new = type(self)(newarchive)
+        # Reuse the same unpacked dir if the content matches
+        if not filters:
+            new.unpacked = self.unpacked
+        return new
 
     @staticmethod
     def known_compressions():