mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 13:16:47 +02:00
lib.sh: simplify reading of version files
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+3
-4
@@ -45,8 +45,9 @@ chkvars()
|
|||||||
eval `setvars "" tmpdir _nogit board boarddir relname versiondate projectsite \
|
eval `setvars "" tmpdir _nogit board boarddir relname versiondate projectsite \
|
||||||
projectname aur_notice cfgsdir datadir version`
|
projectname aur_notice cfgsdir datadir version`
|
||||||
|
|
||||||
read -r projectname < projectname || :
|
for fv in projectname projectsite version versiondate; do
|
||||||
read -r projectsite < projectsite || :
|
eval "[ ! -f "$fv" ] || read -r $fv < \"$fv\" || :"
|
||||||
|
done
|
||||||
|
|
||||||
setcfg()
|
setcfg()
|
||||||
{
|
{
|
||||||
@@ -120,11 +121,9 @@ x_() {
|
|||||||
[ -e ".git" ] || [ -f "versiondate" ] || printf "1716415872\n" > versiondate || \
|
[ -e ".git" ] || [ -f "versiondate" ] || printf "1716415872\n" > versiondate || \
|
||||||
$err "Cannot generate unknown versiondate file"
|
$err "Cannot generate unknown versiondate file"
|
||||||
|
|
||||||
[ ! -f version ] || read -r version < version || :
|
|
||||||
version_="$version"
|
version_="$version"
|
||||||
[ ! -e ".git" ] || version="$(git describe --tags HEAD 2>&1)" || \
|
[ ! -e ".git" ] || version="$(git describe --tags HEAD 2>&1)" || \
|
||||||
version="git-$(git rev-parse HEAD 2>&1)" || version="$version_"
|
version="git-$(git rev-parse HEAD 2>&1)" || version="$version_"
|
||||||
[ ! -f versiondate ] || read -r versiondate < versiondate || :
|
|
||||||
versiondate_="$versiondate"
|
versiondate_="$versiondate"
|
||||||
[ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \
|
[ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \
|
||||||
--pretty='%ct' HEAD)" || versiondate="$versiondate_"
|
--pretty='%ct' HEAD)" || versiondate="$versiondate_"
|
||||||
|
|||||||
Reference in New Issue
Block a user