4 [ -n "$TOPDIR" ] && cd $TOPDIR
7 [ -f version.date ] || return 1
8 SOURCE_DATE_EPOCH="$(cat version.date)"
9 [ -n "$SOURCE_DATE_EPOCH" ]
13 [ -e .git ] || return 1
14 SOURCE_DATE_EPOCH="$(git log -1 --format=format:%ct)"
15 [ -n "$SOURCE_DATE_EPOCH" ]
19 [ -d .hg ] || return 1
20 SOURCE_DATE_EPOCH="$(hg log --template '{date}' -l 1 | cut -d. -f1)"
21 [ -n "$SOURCE_DATE_EPOCH" ]
25 perl -e 'print((stat $ARGV[0])[9])' "$0"
26 [ -n "$SOURCE_DATE_EPOCH" ]
29 try_version || try_git || try_hg || try_mtime || SOURCE_DATE_EPOCH=""
30 echo "$SOURCE_DATE_EPOCH"