about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xbuildtools/stamp-date9
-rw-r--r--doc/HISTORY3
2 files changed, 11 insertions, 1 deletions
diff --git a/buildtools/stamp-date b/buildtools/stamp-date
index 902c82e4..f867416d 100755
--- a/buildtools/stamp-date
+++ b/buildtools/stamp-date
@@ -14,7 +14,14 @@
 
 SOURCE_DATE_OR_NONE=${SOURCE_DATE_EPOCH:-NONE}
 
-BUILD_DATETIME=$(date +%s)
+NOW_FROM_DATE_PGM=$(date +%s)
+if [ "$NOW_FROM_DATE_PGM" = "%s" ]; then
+    # This system's 'date' doesn't know %s.  (Solaris 10 for example).
+    # Try Perl
+    BUILD_DATETIME=$(perl -e 'print time()')
+else
+    BUILD_DATETIME=$NOW_FROM_DATE_PGM
+fi
 
 LOGNAME_OR_UNKNOWN=${LOGNAME:-UNKNOWN}
 USER=${USER:-$LOGNAME_OR_UNKNOWN}
diff --git a/doc/HISTORY b/doc/HISTORY
index bb810280..64e0d331 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -33,6 +33,9 @@ not yet  BJH  Release 10.95.00
               Unix process management.  Bug introduced in Netpbm 10.94
               (March 2021).
 
+              Build: make it work on systems that don't have date +%s.
+              Thanks Claes Nästén (pekdon@gmail.com).
+
 21.03.27 BJH  Release 10.94.00
 
               Add pamhomography:  Thanks Scott Pakin.