]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
pluginlib: Update git version building.
authorRadosław Korzeniewski <radoslaw@korzeniewski.net>
Fri, 2 Jul 2021 13:33:10 +0000 (15:33 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:03 +0000 (09:03 +0100)
bacula/scripts/getgitcommit [new file with mode: 0755]
bacula/src/plugins/fd/pluginlib/Makefile

diff --git a/bacula/scripts/getgitcommit b/bacula/scripts/getgitcommit
new file mode 100755 (executable)
index 0000000..21ace24
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+GIT=$(which git)
+if [ "x$GIT" != "x" ]
+then
+   COMMIT=$(git log --pretty=format:%h -n 1) 2> /dev/null
+   if [ "x$COMMIT" != "x" ]
+   then
+      echo "$COMMIT"
+   fi
+fi
+echo "Unknown"
index 53d66ed57252a7426ed7c799a0ff8a3148b1be82..89b6238d756b97cc10b383a534f3970532f454df 100644 (file)
@@ -9,6 +9,9 @@
 
 include ../Makefile.inc
 
+_GIT := $(shell eval $(topdir)/scripts/getgitcommit)
+VERSIONGIT = "/git-$(_GIT)"
+
 UNITTESTSOBJ = $(LIBDIR)/unittests.lo
 LIBBACOBJ = $(LIBDIR)/libbac.la
 LIBBACCFGOBJ = $(LIBDIR)/libbaccfg.la