8284539: Configure --with-source-date=version fails on MacOS
Reviewed-by: erikj, ihse
This commit is contained in:
parent
ac77b63018
commit
da3d8b1d1e
@ -239,12 +239,17 @@ AC_DEFUN([UTIL_GET_EPOCH_TIMESTAMP],
|
|||||||
timestamp=$($DATE --utc --date=$2 +"%s" 2> /dev/null)
|
timestamp=$($DATE --utc --date=$2 +"%s" 2> /dev/null)
|
||||||
else
|
else
|
||||||
# BSD date
|
# 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
|
if test "x$timestamp" = x; then
|
||||||
# BSD date cannot handle trailing milliseconds.
|
# BSD date cannot handle trailing milliseconds.
|
||||||
# Try again ignoring characters at end
|
# Try again ignoring characters at end
|
||||||
timestamp=$($DATE -u -j -f "%Y-%m-%dT%H:%M:%S" "$2" "+%s" 2> /dev/null)
|
timestamp=$($DATE -u -j -f "%Y-%m-%dT%H:%M:%S" "$2" "+%s" 2> /dev/null)
|
||||||
fi
|
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
|
fi
|
||||||
$1=$timestamp
|
$1=$timestamp
|
||||||
])
|
])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user