chiark / gitweb /
Support SOURCE_DATE_EPOCH
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 10 Nov 2024 10:49:28 +0000 (10:49 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Thu, 14 Nov 2024 22:27:18 +0000 (22:27 +0000)
commitc9248551038642c9f036920a9d82b19acee741ed
tree60656029aa6bf809739e2062926a8422d48db937
parent4254bff53ae9367bf09302ebecded363617af322
Support SOURCE_DATE_EPOCH

If set, it is used to set the "created" and "modified" fields in the
OpenType 'head' table.  This means that builds of Bedstead can be
reproducible.

The current code just casts the "long long" interpretation of the
environment variable into a time_t.  This is potentially undefined
behaviour, because time_t might be a signed integer type smaller than
"long long".  But I can't find a way to properly range-check it.  Even
in POSIX, where time_t is required to be an integer type, there
doesn't seem to be a constant that specifies its range.
bedstead.c