init.sh: bail if date is non-GNU (for now)

We currently use GNU-only options in the date command,
when initialising a Git repository.

This isn't a problem in practise, on non-GNU implementations
if not initialising a Git repository, because it's only
used in that situation.

In practise, only those systems with GNU coreutils and libc
are used to compile releases, so this is OK for me at least.

Future portability improvements will correct the issue, and
then this error check can be removed.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-09-07 14:14:46 +01:00
parent 882a6917bc
commit f5e8483f41
+4
View File
@@ -252,6 +252,10 @@ xbmk_git_init()
[ -L ".git" ] && err "'$xbmkpwd/.git' is a symlink"
[ -e ".git" ] && return 0
x_ date --version | grep "GNU coreutils" 1>/dev/null 2>/dev/null || \
err "Non-GNU date implementation; current use relies on GNU date"
eval "`setvars "$(date -Rud @$versiondate)" cdate _nogit`"
x_ git init 1>/dev/null 2>/dev/null