summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2018-05-01 15:38:41 -0600
committerChad Smith <chad.smith@canonical.com>2018-05-01 15:38:41 -0600
commit26fbb1a0ce89451edad83a47054cacb6dd7b6dcc (patch)
tree29f56cca1c877660a52eaeb65132e2ead88ccfcc /packages
parent14cb4924a6cf191107f9c04698ace2753eb44d2b (diff)
downloadvyos-cloud-init-26fbb1a0ce89451edad83a47054cacb6dd7b6dcc.tar.gz
vyos-cloud-init-26fbb1a0ce89451edad83a47054cacb6dd7b6dcc.zip
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.
Diffstat (limited to 'packages')
-rwxr-xr-xpackages/bddeb12
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/bddeb b/packages/bddeb
index 4f2e2ddf..0f124784 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]