genversion.sh 296 Bytes
Newer Older
Stephane Glondu's avatar
Stephane Glondu committed
1 2 3 4 5 6
#!/bin/sh

# the following is to be run from _build directory
if [ -d ../.git ] && which git >/dev/null 2>&1; then
    BUILD=${BUILD:-$(git describe)}
else
7
    DATE=${SOURCE_DATE_EPOCH:-$(date +%s)}
8
    DATE=$(date -u -d @$DATE +%Y%m%d)
9
    BUILD=${BUILD:-$DATE}
Stephane Glondu's avatar
Stephane Glondu committed
10 11 12 13
fi

head -n1 VERSION
echo $BUILD