Subject: bug#26121: guile-2.2.0: date -d argument problem

From: [email-masked] (ITOH Yasufumi)
Date: Thu, 1 Feb 2018 15:12:58 +0900

Hello,
date options should precede the format string.

% date -u +'%Y-%m-%d %T' -d @100000
date: Expected digit in canonical time
date: -d
date: ^
Usage: date [-ajnu] [-d date] [-r seconds] [+format] [[[[[[CC]yy]mm]dd]HH]MM[.SS]]
% date -u -d @100000 +'%Y-%m-%d %T'
1970-01-02 03:46:40

Possibly the first example is trying to set the system time to '-d'.

Here's patch to guile-2.0.14.
Thanks,

--- libguile/Makefile.am.orig	2016-12-15 09:03:33.000000000 +0900
+++ libguile/Makefile.am	2018-02-01 05:47:59.438589465 +0900
@@ -722,7 +722,7 @@
 	@echo '	{ "LIBS",	   "@GUILE_LIBS@" }, \' >> libpath.tmp
 	@echo '	{ "CFLAGS",	   "@GUILE_CFLAGS@" }, \' >> libpath.tmp
 	@BUILD_DATE="$${SOURCE_DATE_EPOCH:-`date '+%s'`}" ; \
-	 echo '	{ "buildstamp",    "'`date -u +'%Y-%m-%d %T' -d @$$BUILD_DATE`'" }, \' >> libpath.tmp
+	 echo '	{ "buildstamp",    "'`date -u -d @$$BUILD_DATE +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
 	@echo '}' >> libpath.tmp
 	$(AM_V_GEN)mv libpath.tmp libpath.h