2009-03-10 17:43:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
TOPSRCDIR="$@"
|
|
|
|
|
GITCHECK="${TOPSRCDIR}/.git/config"
|
|
|
|
|
|
|
|
|
|
if ! test -d "${TOPSRCDIR}"
|
|
|
|
|
then
|
|
|
|
|
echo Non existent source directory \"${TOPSRCDIR}\" >&2
|
|
|
|
|
echo -1
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2016-08-31 20:18:11 -04:00
|
|
|
# If sources are under Git version control then use "git rev-parse"
|
2009-03-10 17:43:05 +00:00
|
|
|
if test -f "${GITCHECK}"
|
|
|
|
|
then
|
2016-08-31 20:18:11 -04:00
|
|
|
if (cd "${TOPSRCDIR}" && git rev-parse HEAD)
|
2009-03-10 17:43:05 +00:00
|
|
|
then
|
2016-01-20 16:14:21 +01:00
|
|
|
echo Getting buildid from Git >&2
|
2009-03-10 17:43:05 +00:00
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2016-08-31 20:18:11 -04:00
|
|
|
# Not in Git version control, therefore this is a released build.
|
|
|
|
|
echo Released build, no SHA1 buildid. >&2
|
|
|
|
|
echo Released
|
2009-03-10 17:43:05 +00:00
|
|
|
exit 0
|