netblue30 / firejail

Linux namespaces and seccomp-bpf sandbox
https://firejail.wordpress.com
GNU General Public License v2.0
5.83k stars 568 forks source link

build: improve reliability/portability of date command usage #6404

Closed kmk3 closed 4 months ago

kmk3 commented 4 months ago

Changes:

Some date implementations only support BSD -r instead of GNU -d / --date= and others may not support any of them since neither option is in POSIX.

For example, if zoneinfo is installed by chromebrew on ChromeOS, it provides a date program that only supports -r and overrides the system one (which supports -d) [1]:

./mkman.sh 0.9.72 src/man/firejail.man firejail.1
date: invalid option -- '-'
date: usage: date [-u] [-c] [-r seconds] [+format]
make: *** [Makefile:42: firejail.1] Error 1

Environment: zoneinfo 2024a on ChromeOS M125.

Note: The changes are based on what is suggested by reproducible-builds.org [2].

Relates to #193.

Fixes #6403.

[1] https://github.com/netblue30/firejail/issues/6403#issue-2402292506 [2] https://reproducible-builds.org/docs/source-date-epoch/

Reported-by: @Zopolis4 Cc: @reinerh (from #193)