mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
init.sh: simplify unknown version creation
we don't need to read or write a file at all, in that case. we only then need to generate one if running ./mk release. the scenario in which no .git and no version files exist is when someone grabs the build system from a snapshot generated by e.g. forgejo instances. it's ill advised, so we advise against it, but it is mitigated in code. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+2
-4
@@ -55,10 +55,8 @@ xbmk_get_version()
|
||||
[ ! -f ".version" ] || read -r version < ".version" || :; :
|
||||
[ ! -f ".versiondate" ] || read -r versiondate < ".versiondate" || :; :
|
||||
|
||||
[ -e ".git" ] || [ -f ".version" ] || printf "unknown\n" > ".version" \
|
||||
|| err "Cannot generate unknown .version file"
|
||||
[ -e ".git" ] || [ -f ".versiondate" ] || printf "1716415872\n" > \
|
||||
".versiondate" || err "Can't generate unknown versiondate file"; :
|
||||
[ ! -e ".git" ] && [ ! -f ".version" ] && version="unknown"
|
||||
[ ! -e ".git" ] && [ ! -f ".versiondate" ] && versiondate="1716415872"
|
||||
|
||||
version_="$version"
|
||||
[ ! -e ".git" ] || version="$(git describe --tags HEAD 2>&1)" || \
|
||||
|
||||
Reference in New Issue
Block a user