summaryrefslogtreecommitdiff
path: root/packages/bddeb
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-07-16 11:15:22 -0400
committerScott Moser <smoser@ubuntu.com>2012-07-16 11:15:22 -0400
commit8069296b86da0fdbe2e9f4b804169ed3c238b9ba (patch)
tree6548b1337a00b2caae6c152bf7a81af82b035d6a /packages/bddeb
parenta6893e097508054b878fe4f62758af316cb5aa86 (diff)
downloadvyos-cloud-init-8069296b86da0fdbe2e9f4b804169ed3c238b9ba.tar.gz
vyos-cloud-init-8069296b86da0fdbe2e9f4b804169ed3c238b9ba.zip
packages/bddeb: support building source package
This does a few things: * changes bddeb to copying out all files created during builddeb. * link to .dsc file * remove the '--no-sign' flag, replace that by '-us -uc' command line args * also know about debuild flag '-S'.
Diffstat (limited to 'packages/bddeb')
-rwxr-xr-xpackages/bddeb40
1 files changed, 23 insertions, 17 deletions
diff --git a/packages/bddeb b/packages/bddeb
index b73c8af7..2cfddb99 100755
--- a/packages/bddeb
+++ b/packages/bddeb
@@ -3,7 +3,6 @@
import os
import shutil
import sys
-import glob
def find_root():
@@ -37,6 +36,7 @@ PKG_MP = {
'argparse': 'python-argparse',
'cheetah': 'python-cheetah',
}
+DEBUILD_ARGS = ["-us", "-S", "-uc"]
def write_debian_folder(root, version, revno):
@@ -82,16 +82,16 @@ def write_debian_folder(root, version, revno):
def main():
parser = argparse.ArgumentParser()
- parser.add_argument("-n", "--no-sign", dest="sign",
- help=("attempt to sign "
- "the package (default: %(default)s)"),
- default=True,
- action='store_false')
parser.add_argument("-v", "--verbose", dest="verbose",
help=("run verbosely"
" (default: %(default)s)"),
default=False,
action='store_true')
+
+ for ent in DEBUILD_ARGS:
+ parser.add_argument(ent, dest="debuild_args", action='append_const',
+ const=ent, help=("pass through '%s' to debuild" % ent))
+
args = parser.parse_args()
capture = True
@@ -150,23 +150,29 @@ def main():
print("Running 'debuild' in %r" % (xdir))
with util.chdir(xdir):
cmd = ['debuild', '--preserve-envvar', 'INIT_SYSTEM']
- if not args.sign:
- cmd.extend(['-us', '-uc'])
+ if args.debuild_args:
+ cmd.extend(args.debuild_args)
util.subp(cmd, capture=capture)
- globs = []
- globs.extend(glob.glob("%s/*.deb" %
- (os.path.join(tdir))))
link_fn = os.path.join(os.getcwd(), 'cloud-init_all.deb')
- for fn in globs:
- base_fn = os.path.basename(fn)
- shutil.move(fn, base_fn)
- print("Wrote out debian package %r" % (base_fn))
- if fn.endswith('_all.deb'):
+ link_dsc = os.path.join(os.getcwd(), 'cloud-init.dsc')
+ for base_fn in os.listdir(os.path.join(tdir)):
+ full_fn = os.path.join(tdir, base_fn)
+ if not os.path.isfile(full_fn):
+ continue
+ shutil.move(full_fn, base_fn)
+ print("Wrote %r" % (base_fn))
+ if base_fn.endswith('_all.deb'):
# Add in the local link
util.del_file(link_fn)
os.symlink(base_fn, link_fn)
- print("Linked %r to %r" % (base_fn, link_fn))
+ print("Linked %r to %r" % (base_fn,
+ os.path.basename(link_fn)))
+ if base_fn.endswith('.dsc'):
+ util.del_file(link_dsc)
+ os.symlink(base_fn, link_dsc)
+ print("Linked %r to %r" % (base_fn,
+ os.path.basename(link_dsc)))
return 0