Only generate versions in SBCL git checkouts

Sometimes larger build systems contain copies of SBCL sources, if those
systems are managed with git, we don't want to trample version.lisp-expr
with _their_ version, but keep the version of SBCL.

Attempt to detect this by checking whether
`git rev-parse --show-top-level`/run-sbcl.sh exists, if not assume git
is operating on a checkout of something other than SBCL
This commit is contained in:
Richard Lowe 2019-07-15 23:49:30 +00:00 committed by Christophe Rhodes
parent 19f2e5eeb3
commit 1eb4300bdd

View file

@ -2,7 +2,8 @@
git_available_p() {
# Check that (1) we have git (2) this is a git tree.
if ( command -v git >/dev/null && git describe >/dev/null 2>/dev/null )
if ( command -v git >/dev/null && git describe >/dev/null 2>/dev/null && \
test -f `git rev-parse --show-toplevel`/run-sbcl.sh)
then
echo "ok"
else
@ -17,7 +18,7 @@ then
exit 0
elif [ -z "$AVAILABLE" ]
then
echo "Can't run 'git describe' and version.lisp-expr is missing." >&2
echo "Can't 'git describe' SBCL source and version.lisp-expr is missing." >&2
echo "To fix this, either install git or create a fake version.lisp-expr file." >&2
echo "You can create a fake version.lisp-expr file like this:" >&2
echo " \$ echo '\"1.0.99.999\"' > version.lisp-expr" >&2