X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/8c67a535e61f23ae8b1616bf82690e1b675691b2..6d6f2b519e037c3cfd417638f7acbde14d5ccc38:/bin/mdw-sbuild diff --git a/bin/mdw-sbuild b/bin/mdw-sbuild index 7bbeb3c..5630dab 100755 --- a/bin/mdw-sbuild +++ b/bin/mdw-sbuild @@ -33,8 +33,8 @@ fail_usage () { usage >&2; exit 1; } ###-------------------------------------------------------------------------- ### Parse options. -bogusp=nil noactp=nil -unset buildopts keyid +bogusp=nil noactp=nil signp=nil +unset buildopts while getopts "haik:nt:" opt; do case $opt in h) @@ -90,12 +90,22 @@ cd .. dsc=${pkg}_${ver}.dsc [ -f "$dsc" ] || fail "where is my \`.dsc' file?" +## Actually do the build. Get a build directory assigned by the server, +## upload the sources, run the build, and collect the results. builddir=$(ssh "$host" mdw-sbuild-server dir "$pkg/$ver") dcmd rsync -a "$dsc" "$host:$builddir/" set +e; ssh "$host" mdw-sbuild-server $buildopts build "$builddir" rc=$?; set -e rsync -a "$host:$builddir/" ./ case $rc in 0) ;; *) exit $rc ;; esac -case $?,${keyid+t},$noactp in - 0,t,nil) debsign -k"$keyid" "${pkg}_${ver}_"*.changes ;; + +## Merge the change files together, and maybe sign the result. +chchch=${pkg}_${ver}_source.changes +for i in "${pkg}_${ver}"_*.changes; do + case " $chchch " in *" $i "*) ;; *) chchch="$chchch $i" ;; esac +done +mergechanges -f $chchch +rm $chchch +case $signp in + t) debsign -k"$keyid" "${pkg}_${ver}_multi.changes" ;; esac