summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-09-07 14:14:46 +0100
committerLeah Rowe <leah@libreboot.org>2025-09-07 14:20:21 +0100
commitf5e8483f417db6b36a2ad660faf40475edd5ed1b (patch)
tree0cfccb97d65fdd48e5f37aa81329ed0245fe0aec /include
parent882a6917bc4438c7d49c2511b03b634fd25d4f39 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/init.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/init.sh b/include/init.sh
index 264e98df..e8f107cd 100644
--- a/include/init.sh
+++ b/include/init.sh
@@ -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