mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
vsc_tag() always reruns even if the vcs-tag option is disabled. Let's use custom_target() instead so that we can only enable build_always_stale if the vcs-tag option is enabled.
24 lines
453 B
Bash
Executable File
24 lines
453 B
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
set -e
|
|
|
|
INPUT="$1"
|
|
MODE="$2"
|
|
ENABLED="$3"
|
|
|
|
if ! ((ENABLED)) || ! [[ -d .git ]] || ! command -v git >/dev/null || git describe --tags --exact-match &>/dev/null
|
|
then
|
|
sed "$INPUT" -e "s/@VCS_TAG@//"
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "$MODE" == "developer" ]]; then
|
|
DIRTY="--dirty=^"
|
|
else
|
|
DIRTY=""
|
|
fi
|
|
|
|
TAG="-g$(git describe --abbrev=7 --match="" --always $DIRTY)"
|
|
|
|
sed "$INPUT" -e "s/@VCS_TAG@/$TAG/"
|