← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~smoser/cloud-init:tools/bddeb-reuse-tarball into cloud-init:master

 

Scott Moser has proposed merging ~smoser/cloud-init:tools/bddeb-reuse-tarball into cloud-init:master.

Commit message:
tools: Re-use the orig tarball in packages/bddeb if it is around.

If you built packages with 'bddeb', each time it would create a new
tarball with make-tarball.  If you then tried to upload two different
tarballs to launchpad (to a PPA), it would reject the second as the
orig tarball already existed.

This just supports looking in some places for a orig tarball and
re-using if it is found.

Requested reviews:
  cloud-init commiters (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/344545

see commit message
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:tools/bddeb-reuse-tarball into cloud-init:master.
diff --git a/packages/bddeb b/packages/bddeb
index 4f2e2dd..0f12478 100755
--- a/packages/bddeb
+++ b/packages/bddeb
@@ -157,10 +157,18 @@ def main():
         # This is really only a temporary archive
         # since we will extract it then add in the debian
         # folder, then re-archive it for debian happiness
-        print("Creating a temporary tarball using the 'make-tarball' helper")
         tarball = "cloud-init_%s.orig.tar.gz" % ver_data['version_long']
         tarball_fp = util.abs_join(tdir, tarball)
-        run_helper('make-tarball', ['--long', '--output=' + tarball_fp])
+        path = None
+        for pd in ("./", "../", "../dl/"):
+            if os.path.exists(pd + tarball):
+                path = pd + tarball
+                print("Using existing tarball %s" % path)
+                shutil.copy(path, tarball_fp)
+                break
+        if path is None:
+            print("Creating a temp tarball using the 'make-tarball' helper")
+            run_helper('make-tarball', ['--long', '--output=' + tarball_fp])
 
         print("Extracting temporary tarball %r" % (tarball))
         cmd = ['tar', '-xvzf', tarball_fp, '-C', tdir]

Follow ups