chiark / gitweb /
bin/mdw-build: Initialize `gitver' even when not checking out.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 12 Sep 2024 12:13:01 +0000 (13:13 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 12 Sep 2024 12:13:01 +0000 (13:13 +0100)
Otherwise we still try to extend the changelog file, only `gitver' is
empty, so the `new' version isn't actually different from the previous
one and `lintian' gets sad.

This setting includes the standard `+' for a dirty tree, which is
clearly superfluous in a `checkout' build.

bin/mdw-build

index 01e393c6985f491de0e3f5d481d785bc76d1f11f..860140155948fb25ae10377b9da61b48d06ca988 100755 (executable)
@@ -344,6 +344,11 @@ case "$checkout" in
     ;;
   no)
     assign srcpath $toppath
+    if [ -e .git ] && gitver=$(git describe --abbrev=4 --dirty=+ 2>/dev/null); then
+      assign gitversion "$gitver"
+    else
+      assign gitversion none
+    fi
     ;;
 esac