cyphesis/scripts/extract_revision.sh
Olek Wojnar d9edddbb71 Remove obsolete buildTime/buildDate system
The __TIME__ and __DATE__ macros were interfering with reproducible builds.
2016-09-04 15:35:21 -04:00

26 lines
538 B
Bash
Executable file

#!/bin/bash
TOPSRCDIR="$@"
GITCHECK="${TOPSRCDIR}/.git/config"
if ! test -d "${TOPSRCDIR}"
then
echo Non existent source directory \"${TOPSRCDIR}\" >&2
echo -1
exit 1
fi
# If sources are under Git version control then use "git rev-parse"
if test -f "${GITCHECK}"
then
if (cd "${TOPSRCDIR}" && git rev-parse HEAD)
then
echo Getting buildid from Git >&2
exit 0
fi
fi
# Not in Git version control, therefore this is a released build.
echo Released build, no SHA1 buildid. >&2
echo Released
exit 0