From 816af8ee2ef4512bc57def6d3e3e8a09c0d87f53 Mon Sep 17 00:00:00 2001 Message-Id: <816af8ee2ef4512bc57def6d3e3e8a09c0d87f53.1717590621.git.mdw@distorted.org.uk> From: Mark Wooding Date: Wed, 10 Feb 2016 01:51:21 +0000 Subject: [PATCH] bin/mdw-build: Read initial option state from a configuration file. Organization: Straylight/Edgeware From: Mark Wooding It's just a shell fragment, so it can set the necessary variables in any way that seems sensible. --- bin/mdw-build | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/bin/mdw-build b/bin/mdw-build index 7247073..650f0c1 100755 --- a/bin/mdw-build +++ b/bin/mdw-build @@ -53,6 +53,31 @@ set -e +###-------------------------------------------------------------------------- +### Configuration. + +unset checkout checkoutrev +unset setup setupcmd +unset dput dputtarget +unset build distcheck debian upload clean vpath native +for i in \ + "/etc/mdw-build.conf" \ + "${XDG_CONFIG_HOME-$HOME/.config}/mdw-build.conf" \ + "./.mdw-build.conf" +do + if [ -f "$i" ]; then . "$i"; fi +done +: ${checkout=yes} ${checkoutrev=HEAD} +: ${build=test} +: ${setup=yes} ${setupcmd=mdw-setup} +: ${distcheck=yes} +: ${debian=yes} +: ${upload=yes} +: ${clean=yes} +: ${vpath=yes} +: ${native=yes} +: ${DEB_BUILD_OPTIONS=parallel=4}; export DEB_BUILD_OPTIONS + ###-------------------------------------------------------------------------- ### Parse options. @@ -88,17 +113,6 @@ done shift $((OPTIND - 1)) ## Parse the build options. -checkout=yes -checkoutrev=HEAD -build=test -setup=yes -setupcmd=mdw-setup -distcheck=yes -debian=yes -upload=yes -clean=yes -vpath=yes -native=yes for opt; do case "$opt" in checkout) checkout=yes checkoutrev=HEAD ;; -- [mdw]