From f5e8483f417db6b36a2ad660faf40475edd5ed1b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 7 Sep 2025 14:14:46 +0100 Subject: 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 --- include/init.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/init.sh') 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 -- cgit v1.2.1