4 [ -n "$TOPDIR" ] && cd $TOPDIR
7 [ -f version.date ] || return 1
8 SOURCE_DATE_EPOCH="$(cat version.date)"
9 [ -n "$SOURCE_DATE_EPOCH" ]
13 [ -d .svn ] || return 1
14 SOURCE_DATE_EPOCH="$(./scripts/portable_date.sh "$(LC_ALL=C svn info | sed -ne 's/^Last Changed Date: //p')" +%s)"
15 [ -n "$SOURCE_DATE_EPOCH" ]
19 [ -e .git ] || return 1
20 SOURCE_DATE_EPOCH="$(git log -1 --format=format:%ct)"
21 [ -n "$SOURCE_DATE_EPOCH" ]
25 [ -d .hg ] || return 1
27 [ -n "$SOURCE_DATE_EPOCH" ]
30 try_version || try_svn || try_git || try_hg || SOURCE_DATE_EPOCH=""
31 echo "$SOURCE_DATE_EPOCH"