summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-04-19 10:50:19 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-04-19 10:50:19 -0400
commit13cd21d9f1b62456f84aa995a9b4e5b203bf657c (patch)
tree3bc10ebe3da1b2072816d05c51c217b9236756b0 /Makefile
parent75917eaede6b82492d51f29af9275a3cd12fb608 (diff)
downloadbfs-13cd21d9f1b62456f84aa995a9b4e5b203bf657c.tar.xz
Makefile: Quiet errors from git describe
With new git versions, it is an error to invoke git inside a repository owned by someone else. This manifested as $ sudo make install fatal: unsafe repository ('/home/tavianator/code/bfs' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /home/tavianator/code/bfs Work around it with `2>/dev/null`. This should also help if git is not installed, but .git/ still exists. Link: https://github.blog/2022-04-12-git-security-vulnerability-announced/
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index e9a32a9..a6e7363 100644
--- a/Makefile
+++ b/Makefile
@@ -14,10 +14,12 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #
############################################################################
-ifeq ($(wildcard .git),)
+ifneq ($(wildcard .git),)
+VERSION := $(shell git describe --always 2>/dev/null)
+endif
+
+ifndef VERSION
VERSION := 2.5
-else
-VERSION := $(shell git describe --always)
endif
ifndef OS