build: only try to use git if the command is available.
This commit is contained in:
parent
05ff04a0fb
commit
e3b7472b41
2
configure
vendored
2
configure
vendored
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user