From: Mark Wooding Date: Tue, 9 Feb 2016 14:04:55 +0000 (+0000) Subject: bin/mdw-build: Make `checkout=REV' actually work. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/46fced9d44cbfd4828c5e78d3eccd4948b18a66a?ds=sidebyside bin/mdw-build: Make `checkout=REV' actually work. Collect the revision number from the checkout, and delay checking against the changelog. --- diff --git a/bin/mdw-build b/bin/mdw-build index b4c5cfe..9d2dad6 100755 --- a/bin/mdw-build +++ b/bin/mdw-build @@ -222,7 +222,6 @@ case "$checkout,$setup,$(yesno [ -d $srcpath/.git ])" in cd $srcpath [ "$(git ls-files -m)" = "" ] || warn "working tree has uncommitted changes" - gitver=$(git describe --abbrev=4) ;; esac @@ -242,6 +241,18 @@ case "$debian,$(yesno [ -d $srcpath/debian ])" in ;; esac +## Maybe check out a copy of the source. +case "$checkout" in + yes) + cd $releasepath + run git clone -sn $srcpath/.git _source + assign srcpath $releasepath/_source + cd $srcpath + run git checkout -b mdw-build $checkoutrev + gitver=$(git describe --abbrev=4) + ;; +esac + ## Check the version number. hack_dch_p=no case "$gitver,$debver" in @@ -255,17 +266,6 @@ case "$gitver,$debver" in ;; esac -## Maybe check out a copy of the source. -case "$checkout" in - yes) - cd $releasepath - run git clone -sn $srcpath/.git _source - assign srcpath $releasepath/_source - cd $srcpath - run git checkout -b mdw-build $checkoutrev - ;; -esac - ## Maybe refresh the build machinery. case "$setup" in yes)