Re: OS X compatibility patches

Julian Graham <[email protected]> Mon, 17 Mar 2014 12:14:36 -0400
Newsgroups gmane.network.serveez.devel
Message-ID <CANdC_RBye9DB0Fu+hHYR6jdn6QjkTNp5Q-5_JB-eFEoRUxGPmQ@mail.gmail.com>
> I take it OSX date(1) does not support '-r'.

It accepts that flag but interprets it differently:

"Print the date and time represented by seconds, where seconds is
the number of seconds since the Epoch (00:00:00 UTC, January 1,
1970; see time(3)), and can be specified in decimal, octal, or
hex."


> Does it support '-u' and +FORMAT?

It does, but will attempt to SET the local date unless you specify
'-j' (along with some other arguments), which is not portable back to
GNU/Linux. In the process of playing around with this, I also noticed
that getting the year/month/day of a file's modification time is not
straightforward from the shell - you can do it with 'stat', but that
opens another can of portability worms. In the end, I figured it would
be safest to use mdate-sh, the presence of which suggests that the
Automake maintainers anticipated this difficulty.


Regards,
Julian