Skip to content

Commit

Permalink
8284539: Configure --with-source-date=version fails on MacOS
Browse files Browse the repository at this point in the history
Reviewed-by: erikj, ihse
  • Loading branch information
Andrew Leonard committed Apr 19, 2022
1 parent ac77b63 commit da3d8b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion make/autoconf/util.m4
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,17 @@ AC_DEFUN([UTIL_GET_EPOCH_TIMESTAMP],
timestamp=$($DATE --utc --date=$2 +"%s" 2> /dev/null)
else
# BSD date
timestamp=$($DATE -u -j -f "%FZ %TZ" "$2" "+%s" 2> /dev/null)
# ISO-8601 date&time in Zulu 'date'T'time'Z
timestamp=$($DATE -u -j -f "%FT%TZ" "$2" "+%s" 2> /dev/null)
if test "x$timestamp" = x; then
# BSD date cannot handle trailing milliseconds.
# Try again ignoring characters at end
timestamp=$($DATE -u -j -f "%Y-%m-%dT%H:%M:%S" "$2" "+%s" 2> /dev/null)
fi
if test "x$timestamp" = x; then
# Perhaps the time was missing.
timestamp=$($DATE -u -j -f "%FT%TZ" "$2""T00:00:00Z" "+%s" 2> /dev/null)
fi
fi
$1=$timestamp
])
Expand Down

1 comment on commit da3d8b1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.