bin/mdw-build: Make `checkout=REV' actually work.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 9 Feb 2016 14:04:55 +0000 (14:04 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 9 Feb 2016 14:04:55 +0000 (14:04 +0000)
Collect the revision number from the checkout, and delay checking
against the changelog.

bin/mdw-build

index b4c5cfe..9d2dad6 100755 (executable)
@@ -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)