chiark / gitweb /
bin/mdw-build: Read initial option state from a configuration file.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 10 Feb 2016 01:51:21 +0000 (01:51 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 10 Feb 2016 02:11:06 +0000 (02:11 +0000)
It's just a shell fragment, so it can set the necessary variables in any
way that seems sensible.

bin/mdw-build

index 7247073e3924d75584769131e721d624012404a6..650f0c1360b5a2ea6755f1e0ebe3c40ef93dbfba 100755 (executable)
 
 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 ;;