mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
40238aeee2
[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.
21 lines
356 B
Bash
Executable File
21 lines
356 B
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
set -e
|
|
|
|
MODE="$1"
|
|
|
|
if ! [[ -d .git ]] ||
|
|
! command -v git >/dev/null ||
|
|
git describe --tags --exact-match &>/dev/null
|
|
then
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "$MODE" == "developer" ]]; then
|
|
DIRTY="--dirty=^"
|
|
else
|
|
DIRTY=""
|
|
fi
|
|
|
|
echo "-g$(git describe --abbrev=7 --match="" --always $DIRTY)"
|