]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: avoid error message if git is not installed
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 5 Dec 2024 11:39:04 +0000 (12:39 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 5 Dec 2024 12:49:50 +0000 (12:49 +0000)
[1/9] Generating version.h with a custom command
/home/zbyszek/src/systemd/tools/vcs-tag.sh: line 17: git: command not found

If git is not available, do not try to call it.

tools/vcs-tag.sh

index 5da39cc539626da7d7dadee509c04ca946b91e4c..0150d0b50e1755dfdfff991ca77f12b853505930 100755 (executable)
@@ -4,7 +4,10 @@ set -e
 
 MODE="$1"
 
-if ! [[ -d .git ]] || git describe --tags --exact-match &>/dev/null; then
+if ! [[ -d .git ]] ||
+        ! command -v git >/dev/null ||
+        git describe --tags --exact-match &>/dev/null
+then
     exit 0
 fi