diff options
author | Rob Austein <sra@hactrn.net> | 2013-04-05 19:30:07 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2013-04-05 19:30:07 +0000 |
commit | 52b5cb0ad90b445c44c4797c688b46012c3240bc (patch) | |
tree | ab7503d4ff890143880f7666040353c652ac5e56 | |
parent | f25b1a9a55fd9e61b19d073fe8426cc2aac3c0ef (diff) |
Add --debuild option.
svn path=/trunk/; revision=5284
-rw-r--r-- | buildtools/build-ubuntu-ports.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/buildtools/build-ubuntu-ports.py b/buildtools/build-ubuntu-ports.py index 858ca259..e748c86b 100644 --- a/buildtools/build-ubuntu-ports.py +++ b/buildtools/build-ubuntu-ports.py @@ -25,10 +25,30 @@ # PERFORMANCE OF THIS SOFTWARE. import subprocess +import getopt import shutil import sys import os +def usage(status): + f = sys.stderr if status else sys.stdout + f.write("Usage: %s [--debuild]\n" % sys.argv[0]) + sys.exit(status) + +debuild = False + +try: + opts, argv = getopt.getopt(sys.argv[1:], "-bh?", ["debuild", "help"]) +except getopt.GetoptError: + usage(1) +for o, a in opts: + if o in ("-h", "-?", "--help"): + usage(0) + elif o in ("-b", "--debuild"): + debuild = not debuild +if argv: + usage(1) + version = "0." + subprocess.check_output(("svnversion", "-c")).strip().split(":")[-1] if os.path.exists("debian"): @@ -48,3 +68,6 @@ subprocess.check_call(("dch", "--create", "--package", "rpki", "--newversion", VISUAL = "true", TZ = "UTC", DEBEMAIL = "APT Builder Robot <aptbot@rpki.net>")) + +if debuild: + subprocess.check_call(("debuild", "-us", "-uc")) |