diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-07-09 16:11:20 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-07-09 16:11:20 -0400 |
commit | 9d47fb974658e9697ae8826e7bc2468dcf7751c3 (patch) | |
tree | 6bc0bc9ec4676e5bdd5dfd0f0bf6747c74b98361 /packages/brpm | |
parent | 0ed44de3afa63c296040bcf7302bac35b8cafc21 (diff) | |
download | vyos-cloud-init-9d47fb974658e9697ae8826e7bc2468dcf7751c3.tar.gz vyos-cloud-init-9d47fb974658e9697ae8826e7bc2468dcf7751c3.zip |
brpm: Add printouts which match the 'bddeb' package builder.
Diffstat (limited to 'packages/brpm')
-rwxr-xr-x | packages/brpm | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/packages/brpm b/packages/brpm index 4a9cdcf3..3acbe28f 100755 --- a/packages/brpm +++ b/packages/brpm @@ -1,5 +1,6 @@ #!/usr/bin/python +import argparse import contextlib import glob import os @@ -9,7 +10,8 @@ import sys import tempfile import re -import argparse +from datetime import datetime + def find_root(): # expected path is in <top_dir>/packages/ @@ -25,13 +27,9 @@ def find_root(): # Use the util functions from cloudinit sys.path.insert(0, find_root()) - from cloudinit import templater from cloudinit import util -from datetime import datetime - - # Mapping of expected packages to there full name... PKG_MP = { 'boto': 'python-boto', @@ -43,6 +41,7 @@ PKG_MP = { 'argparse': 'python-argparse' } +# Subdirectories of the ~/rpmbuild dir RPM_BUILD_SUBDIRS = ['BUILD', 'RPMS', 'SOURCES', 'SPECS', 'SRPMS'] @@ -193,15 +192,19 @@ def main(): archive_fn = stdout.strip() real_archive_fn = os.path.join(arc_dir, os.path.basename(archive_fn)) shutil.move(archive_fn, real_archive_fn) + print("Archived the code in %r" % (real_archive_fn)) # 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, os.path.basename(archive_fn)) spec_fn = util.abs_join(root_dir, 'cloud-init.spec') util.write_file(spec_fn, contents) + print("Created spec file at %r" % (spec_fn)) # Now build it! - cmd = ['rpmbuild', '-ba', spec_fn] + print("Running 'rpmbuild' in %r" % (root_dir)) + cmd = ['rpmbuild', '--clean', + '-ba', spec_fn] util.subp(cmd, capture=capture) # Copy the items built to our local dir @@ -215,7 +218,7 @@ def main(): for rpm_fn in globs: tgt_fn = util.abs_join(os.getcwd(), os.path.basename(rpm_fn)) shutil.move(rpm_fn, tgt_fn) - print(tgt_fn) + print("Wrote out redhat package %r" % (tgt_fn)) return 0 |