diff options
author | Scott Moser <smoser@ubuntu.com> | 2018-05-01 15:38:41 -0600 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2018-05-01 15:38:41 -0600 |
commit | 26fbb1a0ce89451edad83a47054cacb6dd7b6dcc (patch) | |
tree | 29f56cca1c877660a52eaeb65132e2ead88ccfcc /packages/bddeb | |
parent | 14cb4924a6cf191107f9c04698ace2753eb44d2b (diff) | |
download | vyos-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/bddeb')
-rwxr-xr-x | packages/bddeb | 12 |
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] |