build: only try to use git if the command is available.

This commit is contained in:
Érico Rolim 2020-12-13 01:53:42 -03:00 committed by Duncan Overbruck
parent 05ff04a0fb
commit e3b7472b41

2
configure vendored
View File

@ -202,7 +202,7 @@ echo "CPPFLAGS += -DXBPS_VERSION=\\\"${VERSION}\\\"" >>$CONFIG_MK
echo "CPPFLAGS += -DXBPS_META_PATH=\\\"${DBDIR}\\\"" >>$CONFIG_MK echo "CPPFLAGS += -DXBPS_META_PATH=\\\"${DBDIR}\\\"" >>$CONFIG_MK
echo "CPPFLAGS += -DUNUSED=\"__attribute__((__unused__))\"" >>$CONFIG_MK echo "CPPFLAGS += -DUNUSED=\"__attribute__((__unused__))\"" >>$CONFIG_MK
if [ -d .git ]; then if [ -d .git ] && command -v git >/dev/null; then
_gitrev=$(git rev-parse --short HEAD) _gitrev=$(git rev-parse --short HEAD)
echo "CPPFLAGS += -DXBPS_GIT=\\\"${_gitrev}\\\"" >>$CONFIG_MK echo "CPPFLAGS += -DXBPS_GIT=\\\"${_gitrev}\\\"" >>$CONFIG_MK
fi fi