gnunet-bugreport: add check for git commit.
authorng0 <ng0@n0.is>
Thu, 21 Nov 2019 11:57:31 +0000 (11:57 +0000)
committerng0 <ng0@n0.is>
Thu, 21 Nov 2019 11:57:31 +0000 (11:57 +0000)
contrib/scripts/gnunet-bugreport

index a63b816efab42aa5d35d7f9fa867c8326d08c205..5f090a3504d52e11f804097429a9329258572f70 100755 (executable)
@@ -63,7 +63,6 @@ gcc_check()
     if test -n "$TEST"; then
         VERS=`gcc --version 2>/dev/null | head -n 1`
         infomsg "gcc            : $VERS"
-        # The elif will work in bourne shells, no other shells tested.
     elif test -n "`gcc 2>&1 | tail -1 | awk '{print $1}'`"; then
         VERS=`gcc --version 2>/dev/null | head -n 1`
         infomsg "gcc             : $VERS"
@@ -253,6 +252,17 @@ gnunet011x_check()
     fi
 }
 
+gitcommit_check()
+{
+    TEST=$(git | grep -v "not found" 2> /dev/null)
+    if test -n "$TEST"; then
+        VER=$(git rev-parse HEAD)
+        infomsg "git commit     : $VER"
+    else
+        warningmsg "git commit      : Not a git checkout"
+    fi
+}
+
 gcrypt_check()
 {
     TEST=`$WHICH libgcrypt-config | grep -v "not found" 2> /dev/null`
@@ -539,6 +549,7 @@ main()
     gnunet09x_check
     gnunet010x_check
     gnunet011x_check
+    gitcommit_check
     gcrypt_check
     mysql_check
     pkgconf_check