mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +02:00
cc1642096e
This results in much cleaner copyright and license declarations. SPDX headers are legally recognised and make auditing easier. Also, remove descriptions of each script, from each script. Libreboot documentation at docs/maintain/ describes them. Signed-off-by: Leah Rowe <leah@libreboot.org>
35 lines
952 B
Bash
Executable File
35 lines
952 B
Bash
Executable File
#!/usr/bin/env sh
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
# SPDX-FileCopyrightText: 2021 Leah Rowe <info@minifree.org>
|
|
|
|
[ "x${DEBUG+set}" = 'xset' ] && set -v
|
|
set -u
|
|
|
|
. "include/err.sh"
|
|
|
|
read project < projectname
|
|
|
|
version="version-unknown"
|
|
[ -f version ] && read version < version
|
|
version_="${version}"
|
|
if [ -e ".git" ]; then
|
|
version="$(git describe --tags HEAD 2>&1)" || \
|
|
version="git-$(git rev-parse HEAD 2>&1)" || \
|
|
version="${version_}"
|
|
printf "%s\n" "${version}" > version
|
|
fi
|
|
|
|
versiondate="version-date-unknown"
|
|
[ -f versiondate ] && read versiondate < versiondate
|
|
versiondate_="${versiondate}"
|
|
if [ -e ".git" ]; then
|
|
versiondate="$(git show --no-patch --no-notes --pretty='%ct' HEAD)" || \
|
|
versiondate="${versiondate_}"
|
|
printf "%s\n" "${versiondate}" > versiondate
|
|
fi
|
|
|
|
if [ "${versiondate}" = "version-date-unknown" ] || \
|
|
[ "${version}" = "version-unknown" ]; then
|
|
err "cannot determine ${projectname} revision"
|
|
fi
|