emcrisostomo / fswatch

A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
https://emcrisostomo.github.io/fswatch/
GNU General Public License v3.0
5.06k stars 330 forks source link

Check the capabilities of date before using --utc and --date #193

Closed emcrisostomo closed 6 years ago

emcrisostomo commented 6 years ago

192 introduced the following change:

MAN_DATE=$(date +'%B %d, %Y')
if test -n "$SOURCE_DATE_EPOCH"; then
  MAN_DATE=$(LC_ALL=C date --utc --date=@$SOURCE_DATE_EPOCH +'%B %d, %Y')
fi

However, date capabilities are not checked and invocation may fail in platforms where --utc and --date are not supported.

t3hk0d3 commented 6 years ago

Synonym for BSD date would be following command:

MAN_DATE=$(LC_ALL=C TZ=UTC date -r $SOURCE_DATE_EPOCH +'%B %d, %Y')
emcrisostomo commented 6 years ago

Thank you very much @t3hk0d3

t3hk0d3 commented 6 years ago

@emcrisostomo Isn't this one could be closed?

emcrisostomo commented 6 years ago

Hi @t3hk0d3, yes, it can be closed: I left it open because I wanted to configure and build it in all the supported OS and this wasn't assigned to any milestone.