From: martin f. krafft Date: Fri, 15 May 2009 09:14:01 +0000 (+0200) Subject: determine default dist from changes file X-Git-Url: https://git.madduck.net/code/mbuild.git/commitdiff_plain/0a2c4104a6288cded4592c613122a7dc87debe41?ds=inline determine default dist from changes file --- diff --git a/sbuild-wrapper.sh b/sbuild-wrapper.sh index 243587d..02edbc2 100755 --- a/sbuild-wrapper.sh +++ b/sbuild-wrapper.sh @@ -54,7 +54,7 @@ usage() echo echo "Valid options are:" cat <<-_eof | column -s\& -t - --dist & specify the target distribution (default: sid) + --dist & specify the target distribution (default: from changes file) --arch & specify the target architecture (default: $DEB_BUILD_ARCH) -sa & pass --force-orig-source to sbuild -B & do a binary-only build @@ -67,13 +67,11 @@ binonly=0 sbuild_args= schangesfile= arch= -dist= for opt in "$@"; do case "$opt" in -h|--help) usage; exit 0;; -V|--version) about; exit 0;; --arch=*) arch="${opt#--arch=}";; - --dist=*) dist="${opt#--dist=}";; -sa) sbuild_args="${sbuild_args:+$sbuild_args }--force-orig-source";; -B) binonly=1;; --*) sbuild_args="${sbuild_args:+$sbuild_args }$opt";; @@ -103,7 +101,8 @@ if [ -z "$schangesfile" ]; then fi [ -z "$arch" ] && arch="$DEB_BUILD_ARCH" -[ -z "$dist" ] && dist="unstable" + +dist="$(sed -ne 's,Distribution: ,,p' "$schangesfile")" schangesfile_basename="${schangesfile##*/}" packagenameversion="${schangesfile_basename%_*}"