[Cryptech-Commits] [releng/alpha] branch master updated: Fix --conflicts inconsistency between build scripts and Makefile.

git at cryptech.is git at cryptech.is
Thu May 11 17:53:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch master
in repository releng/alpha.

The following commit(s) were added to refs/heads/master by this push:
     new c2c1a71  Fix --conflicts inconsistency between build scripts and Makefile.
c2c1a71 is described below

commit c2c1a714963fb19390cdeb08f4dc242df14aa60d
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Thu May 11 13:42:01 2017 -0400

    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.
---
 Makefile                              |  6 +++---
 scripts/build-debian-control-files.py |  4 ++--
 scripts/build-homebrew-formula.py     | 16 ++++++++--------
 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))
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list