aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2017-05-11 13:42:01 -0400
committerRob Austein <sra@hactrn.net>2017-05-11 13:42:01 -0400
commitc2c1a714963fb19390cdeb08f4dc242df14aa60d (patch)
tree64f3283659887f6b54cdbf2f787d719d7a2c2dde
parentdd5950077b622a72a1bd04df092804a10c108d8c (diff)
Fix --conflicts inconsistency between build scripts and Makefile.
scripts/build-*.py were treating --conflicts as a sequence of arguments while Makefile was treating as a single argument whose value might contain whitespace. No big deal either way for the scripts, and Makefile is complicated enough, so go with Makefile's approach. Add some pedantic quoting to Makefile while we're at this, out of general paranoia and because the inconsistencies were puzzling.
-rw-r--r--Makefile6
-rwxr-xr-xscripts/build-debian-control-files.py4
-rwxr-xr-xscripts/build-homebrew-formula.py16
3 files changed, 13 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 1eb9b50..b6c0743 100644
--- a/Makefile
+++ b/Makefile
@@ -103,7 +103,7 @@ tamper:
dsc:
rm -f source/debian/changelog ${PACKAGE_NAME}_*.dsc ${PACKAGE_NAME}_*.tar.xz ${PACKAGE_NAME}_*_source.build ${PACKAGE_NAME}_*_source.changes
- cd source; ../scripts/build-debian-control-files.py --debemail='${GPG_USER}' --package ${PACKAGE_NAME} --newversion '${PACKAGE_VERSION}' --conflicts='${PACKAGE_CONFLICT}'
+ cd source; ../scripts/build-debian-control-files.py --debemail='${GPG_USER}' --package='${PACKAGE_NAME}' --newversion='${PACKAGE_VERSION}' --conflicts='${PACKAGE_CONFLICT}'
cd source; debuild -S -uc -us
pbuilder:
@@ -122,8 +122,8 @@ homebrew:
umask ${REPO_UMASK}; \
git clone ${REPO_BASE}/brew/tap tap; \
cd tap; \
- ../scripts/build-homebrew-formula.py --tarball ${REPO_BASE}/brew/tarballs/${PACKAGE_NAME}_${PACKAGE_VERSION}.tar.xz --formula ${PACKAGE_NAME}.rb \
- --package ${PACKAGE_NAME} --version ${PACKAGE_VERSION} --conflicts ${PACKAGE_CONFLICT}; \
+ ../scripts/build-homebrew-formula.py --tarball='${REPO_BASE}/brew/tarballs/${PACKAGE_NAME}_${PACKAGE_VERSION}.tar.xz' --formula='${PACKAGE_NAME}.rb' \
+ --package='${PACKAGE_NAME}' --version='${PACKAGE_VERSION}' --conflicts='${PACKAGE_CONFLICT}'; \
git add ${PACKAGE_NAME}.rb; \
git commit -S${GPG_KEYID} --author='${GPG_USER}' -m '${PACKAGE_NAME} ${PACKAGE_VERSION}'; \
git push
diff --git a/scripts/build-debian-control-files.py b/scripts/build-debian-control-files.py
index cb679b2..a6ff169 100755
--- a/scripts/build-debian-control-files.py
+++ b/scripts/build-debian-control-files.py
@@ -10,7 +10,7 @@ parser.add_argument("--debemail", required = True)
parser.add_argument("--package", required = True)
parser.add_argument("--newversion", required = True)
parser.add_argument("--description", default = "Software and firmware for Cryptech Alpha development board.")
-parser.add_argument("--conflicts", nargs = "*")
+parser.add_argument("--conflicts", default = "")
args = parser.parse_args()
@@ -43,7 +43,7 @@ Description: Cryptech Project open-source cryptographic software and firmware.
'''
if args.conflicts:
- conflicts = "Conflicts: {}\n".format(" ".join(args.conflicts))
+ conflicts = "Conflicts: {}\n".format(args.conflicts)
else:
conflicts = ""
diff --git a/scripts/build-homebrew-formula.py b/scripts/build-homebrew-formula.py
index 618eb77..adffa10 100755
--- a/scripts/build-homebrew-formula.py
+++ b/scripts/build-homebrew-formula.py
@@ -8,12 +8,12 @@ import sys
import os
parser = argparse.ArgumentParser()
-parser.add_argument("--url-base", default = "https://brew.cryptech.is/tarballs/")
-parser.add_argument("--tarball", required = True)
-parser.add_argument("--package", required = True)
-parser.add_argument("--version", required = True)
-parser.add_argument("--formula", type = argparse.FileType("w"), nargs = "?", default = sys.stdout)
-parser.add_argument("--conflicts", nargs = "*")
+parser.add_argument("--url-base", default = "https://brew.cryptech.is/tarballs/")
+parser.add_argument("--tarball", required = True)
+parser.add_argument("--package", required = True)
+parser.add_argument("--version", required = True)
+parser.add_argument("--formula", type = argparse.FileType("w"), nargs = "?", default = sys.stdout)
+parser.add_argument("--conflicts", default = "")
args = parser.parse_args()
template = '''\
@@ -105,8 +105,8 @@ with open(args.tarball, "rb") as f:
classname = "".join(word.capitalize() for word in args.package.split("-"))
-conflicts = "".join(" conflicts_with \"{}\", :because => \"HSM firmware and PKCS #11 library must match each other\"\n".format(i)
- for i in args.conflicts)
+conflicts = "".join(" conflicts_with \"{}\", :because => \"HSM firmware and PKCS #11 library must match\"\n".format(conflict)
+ for conflict in args.conflicts.split())
url = os.path.join(args.url_base, os.path.basename(args.tarball))