From cc68920db2ffab4d22b9b93f83206faaf3a65fff Mon Sep 17 00:00:00 2001 From: Kevin Daudt Date: Sat, 6 Aug 2022 19:20:32 +0200 Subject: [PATCH] makefile: honor DESTDIR for /bin/git target When providing `DESTDIR`, the git binary ends up in `${DESTDIR}/${GIT_PREFIX}/`. The Makefile target tries to touch `${GIT_PREFIX}`bin/git, which will fail when this is run as a non-root user. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 39a7609d4d8..1fc9ec207c2 100644 --- a/Makefile +++ b/Makefile @@ -537,7 +537,7 @@ upgrade-module: .PHONY: git ## Build Git. -git: ${GIT_PREFIX}/bin/git +git: ${DESTDIR}/${GIT_PREFIX}/bin/git .PHONY: libgit2 ## Build libgit2. @@ -568,7 +568,7 @@ ${DEPENDENCY_DIR}: | ${BUILD_DIR} ${Q}mkdir -p ${DEPENDENCY_DIR} # This target builds a full Git distribution and installs it into GIT_PREFIX. -${GIT_PREFIX}/bin/git: ${DEPENDENCY_DIR}/git-distribution/Makefile +${DESTDIR}/${GIT_PREFIX}/bin/git: ${DEPENDENCY_DIR}/git-distribution/Makefile @ # Remove the Git installation first in case GIT_PREFIX is the default @ # prefix which always points into our build directory. This is done so @ # we never end up with mixed Git installations on developer machines. -- GitLab