RFR: 8284539: Configure --with-source-date=version fails on MacOS

Andrew Leonard aleonard at openjdk.java.net
Thu Apr 14 16:20:58 UTC 2022


On Thu, 14 Apr 2022 16:13:59 GMT, Andrew Leonard <aleonard at openjdk.org> wrote:

> JDK-8282769 added support for more ISO-8601 formats, but remove handling of just a date "YYYY-MM-DD" being present, which is the case for a configure using --with-source-date=version which uses the date string from version-numbers.conf.
> Also, the first date parse had an invalid format string "%FZ %TZ", with too many Zs.
> This PR corrects the first date parse to parse a standard ISO-8601 Zulu date&time: "%FT%TZ"
> Then it adds the final check for no time being specified.
> 
> Signed-off-by: Andrew Leonard <anleonar at redhat.com>

Verified formatting on MacOS:
1st parse:

% date -u -j -f "%FT%TZ" "2022-09-22T12:56:04Z" "+%s"               
1663851364

2nd parse trimming milli-seconds:

% date -u -j -f "%Y-%m-%dT%H:%M:%S" "2022-09-22T12:56:04.456Z" "+%s"             
Warning: Ignoring 5 extraneous characters in date string (.456Z)
1663851364

3rd parse with T00:00:00Z time added:

% date -u -j -f "%FT%TZ" "2022-09-22T00:00:00Z" "+%s"               
1663804800

-------------

PR: https://git.openjdk.java.net/jdk/pull/8247



More information about the build-dev mailing list