mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-09-19 21:20:31 +02:00
lib.sh: always sanitize xbmkver before writing
this removed the need to check it in xbmk_set_version as it calls update_xbmkver, which in turn performs the same check. this increases the general reliability and safety of xbmk when recording its own version after update. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -259,10 +259,6 @@ xbmk_set_version()
|
||||
versiondate="$(git show --no-patch --no-notes \
|
||||
--pretty='%ct' HEAD)" || versiondate="$versiondate_"
|
||||
|
||||
if [ -z "$version" ] || [ -z "$versiondate" ]; then
|
||||
err "version and/or versiondate unset" "xbmk_set_version" "$@"
|
||||
fi
|
||||
|
||||
update_xbmkver "."
|
||||
|
||||
relname="$projectname-$version"
|
||||
|
||||
@@ -26,6 +26,9 @@ update_xbmkver()
|
||||
{
|
||||
xbmk_sanitize_version
|
||||
|
||||
[ -z "${version-}${versiondate-}" ] && \
|
||||
err "version and/or versiondate unset" "update_xbmkver" "$@"
|
||||
|
||||
printf "%s\n" "$version" > "$1/.version" || \
|
||||
err "can't write '$1'" "update_xbmkver" "$@"; :
|
||||
|
||||
|
||||
Reference in New Issue
Block a user