diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-07-09 15:49:06 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-07-09 15:49:06 -0400 |
commit | a7e13e1f540019170de0f4fb0e008b703226df77 (patch) | |
tree | 12edfc7278254aff47503c50fbe04b9e3914fc50 /packages/brpm | |
parent | cf1fa7219724c7192ebfb35e9a0796bf84dd9b26 (diff) | |
download | vyos-cloud-init-a7e13e1f540019170de0f4fb0e008b703226df77.tar.gz vyos-cloud-init-a7e13e1f540019170de0f4fb0e008b703226df77.zip |
include ~bzr in make-tarball output tarball and top level dir
output of 'make-tarball' now is tarball with name formatted as:
cloud-init-$VERSION~bzr$REVNO.tar.gz
Instead of
cloud-init-$VERSION-$REVNO.tar.gz
The former is desireable for apt at least as the '~' is understood
to mean less than.
This merges revno 569 and 570 from lp:~harlowja/cloud-init/rework
Diffstat (limited to 'packages/brpm')
-rwxr-xr-x | packages/brpm | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/packages/brpm b/packages/brpm index 99288ce9..4a9cdcf3 100755 --- a/packages/brpm +++ b/packages/brpm @@ -43,6 +43,8 @@ PKG_MP = { 'argparse': 'python-argparse' } +RPM_BUILD_SUBDIRS = ['BUILD', 'RPMS', 'SOURCES', 'SPECS', 'SRPMS'] + def get_log_header(version): # Try to find the version in the tags output @@ -88,7 +90,7 @@ def format_change_line(ds, who, comment=None): return "* %s" % (d) -def generate_spec_contents(args, tmpl_fn): +def generate_spec_contents(args, tmpl_fn, arc_fn): # Figure out the version and revno cmd = [util.abs_join(find_root(), 'tools', 'read-version')] @@ -103,8 +105,8 @@ def generate_spec_contents(args, tmpl_fn): subs = {} subs['version'] = version subs['revno'] = revno - subs['release'] = revno - subs['archive_name'] = '%{name}-%{version}-' + revno + '.tar.gz' + subs['release'] = "bzr%s" % (revno) + subs['archive_name'] = arc_fn subs['bd_requires'] = ['python-devel', 'python-setuptools'] cmd = [util.abs_join(find_root(), 'tools', 'read-dependencies')] @@ -177,8 +179,13 @@ def main(): root_dir = os.path.expanduser("~/rpmbuild") if os.path.isdir(root_dir): shutil.rmtree(root_dir) + arc_dir = util.abs_join(root_dir, 'SOURCES') - util.ensure_dirs([root_dir, arc_dir]) + build_dirs = [root_dir, arc_dir] + for dname in RPM_BUILD_SUBDIRS: + build_dirs.append(util.abs_join(root_dir, dname)) + build_dirs.sort() + util.ensure_dirs(build_dirs) # Archive the code cmd = [util.abs_join(find_root(), 'tools', 'make-tarball')] @@ -189,7 +196,7 @@ def main(): # Form the spec file to be used tmpl_fn = util.abs_join(find_root(), 'packages', 'redhat', 'cloud-init.spec') - contents = generate_spec_contents(args, tmpl_fn) + contents = generate_spec_contents(args, tmpl_fn, os.path.basename(archive_fn)) spec_fn = util.abs_join(root_dir, 'cloud-init.spec') util.write_file(spec_fn, contents) |