chiark / gitweb /
bin/mdw-sbuild{,-server}: Push arguments through to `dpkg-buildpackage'.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 3 May 2020 16:47:32 +0000 (17:47 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 3 May 2020 16:47:32 +0000 (17:47 +0100)
Both now have `-A' options to make this work.

bin/mdw-sbuild
bin/mdw-sbuild-server

index a8864c77436667062dac5e6e1b723a6ed0583815..18f9901a547505cf37525864cec61efe5f9ede60 100755 (executable)
@@ -34,8 +34,8 @@ fail_usage () { usage >&2; exit 1; }
 ### Parse options.
 
 bogusp=nil noactp=nil signp=nil
-unset buildopts pkgs
-while getopts "haik:np:t:" opt; do
+unset buildopts pkgs dbpargs
+while getopts "haik:np:t:A:" opt; do
   case $opt in
     h)
       usage
@@ -49,6 +49,7 @@ Options:
        -n              Don't actually do the build.
        -p DIR          Upload additional packages from DIR.
        -t TARGET       Build in TARGET build environment.
+       -A ARGS         Pass ARGS to \`dpkg-buildpackage'.
 EOF
       exit 0
       ;;
@@ -58,6 +59,10 @@ EOF
     n) buildopts="${buildopts+$buildopts }-n" noactp=t ;;
     p) pkgs=$OPTARG ;;
     t) buildopts="${buildopts+$buildopts }-t$OPTARG" ;;
+    A)
+      buildopts="${buildopts+$buildopts }-A$OPTARG"
+      dbpargs="${dbpargs+$dbpargs }$OPTARG"
+      ;;
     *) bogusp=t ;;
   esac
 done
@@ -88,7 +93,7 @@ case ${ver+t} in t) ;; *) fail "can't figure out the package version" ;; esac
 
 ## Build a Debian source package.  Don't sign anything yet.  That will happen
 ## at the end, all in one go.
-dpkg-buildpackage -S -uc -us -d -i
+dpkg-buildpackage -S -uc -us -d -i $dbpargs
 cd ..
 dsc=${pkg}_${ver}.dsc
 [ -f "$dsc" ] || fail "where is my \`.dsc' file?"
@@ -113,3 +118,5 @@ rm $chchch
 case $signp in
   t) debsign -k"$keyid" "${pkg}_${ver}_multi.changes" ;;
 esac
+
+###----- That's all, folks --------------------------------------------------
index 2bba42a2f008da6654746bc9a0a9f6d12592879a..7bb2e46cd171d2487fd02d799484db3ff269a0fd 100755 (executable)
@@ -74,9 +74,9 @@ decor () {
 ### Parse options.
 
 bogusp=nil archp=nil indepp=nil keepon=nil notreally=nil
-unset targets
+unset targets dbpargs
 
-while getopts "haint:" opt; do
+while getopts "haint:A:" opt; do
   case $opt in
     h)
       usage
@@ -89,6 +89,7 @@ Options:
        -k              Keep going even if one fails.
        -n              Don't actually do the build.
        -t TARGET       Build in TARGET build environment.
+       -A ARGS         Pass ARGS to \`dpkg-buildpackage'.
 
 Commands available:
 
@@ -108,6 +109,7 @@ EOF
     k) keepon=t ;;
     n) notreally=t ;;
     t) targets="${targets+$targets }$OPTARG" ;;
+    A) dbpargs="${dbpargs+$dbpargs }$OPTARG" ;;
     *) bogusp=nil ;;
   esac
 done
@@ -290,6 +292,7 @@ case "$#,$1" in
                run sbuild --extra-package=$pkgs.$target \
                    --dist=$suite --build=$host --host=$target \
                    --chroot=$suite-$host --verbose $buildopt $dsc \
+                   ${dbpargs+--debbuildopts="$dbpargs"} \
                    3>&- 4>&- 5>&-
                echo $? >&5
              } |