5 if [ -n "$TOPDIR" ]; then
12 [ -f "$SOURCE/version.date" ] ||
return 1
13 SOURCE_DATE_EPOCH
=$
(cat "$SOURCE/version.date")
14 [ -n "$SOURCE_DATE_EPOCH" ]
18 SOURCE_DATE_EPOCH
=$
(git
-C "$SOURCE" log
-1 --format=format
:%ct \
19 "$SOURCE" 2>/dev
/null
)
20 [ -n "$SOURCE_DATE_EPOCH" ]
24 SOURCE_DATE_EPOCH
=$
(hg
--cwd "$SOURCE" log
--template '{date}' -l 1 \
25 "$SOURCE" 2>/dev
/null | cut
-d.
-f1)
26 [ -n "$SOURCE_DATE_EPOCH" ]
30 SOURCE_DATE_EPOCH
=$
(perl
-e 'print((stat $ARGV[0])[9])' "$0")
31 [ -n "$SOURCE_DATE_EPOCH" ]
34 try_version || try_git || try_hg || try_mtime || SOURCE_DATE_EPOCH
=""
35 echo "$SOURCE_DATE_EPOCH"