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
21 [ -n "$SOURCE_DATE_EPOCH" ]
24 try_version || try_git || try_hg || SOURCE_DATE_EPOCH=""
25 echo "$SOURCE_DATE_EPOCH"