summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-16 20:47:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-16 20:47:48 -0400
commit2e11edcfe4a6f5d82289c6ecb3efe73b9f39afed (patch)
tree37d6c9d73642fa096c18eeeeb10a5415386b255d /Makefile
parentfb13aaf640de68e3fdaf7dae92dfcd67855b65f8 (diff)
work around git path-defying behavior that broke "git annex" in standalone tarball, while "git-annex" worked
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 9ffa011b8..8d5d7b6c4 100644
--- a/Makefile
+++ b/Makefile
@@ -143,13 +143,16 @@ linuxstandalone: Build/Standalone
find $(LINUXSTANDALONE_DEST) -type d -name gconv | head -n 1 | sed 's!$(LINUXSTANDALONE_DEST)/*!!' > $(LINUXSTANDALONE_DEST)/gconvdir
find $(LINUXSTANDALONE_DEST) | grep ld-linux | head -n 1 | sed 's!$(LINUXSTANDALONE_DEST)/*!!' > $(LINUXSTANDALONE_DEST)/linker
- # Install linker shim for each binary.
+ # Install linker shim for each binary. Note that each binary is put
+ # in its own separate directory, to avoid eg git looking for
+ # binaries in its directory rather than in PATH.
for file in $$(find "$(LINUXSTANDALONE_DEST)" -type f); do \
if file "$$file" | grep ELF | grep -q executable; then \
- mkdir -p "$(LINUXSTANDALONE_DEST)/shimmed"; \
- mv "$$file" "$(LINUXSTANDALONE_DEST)/shimmed"; \
+ base=$$(basename "$$file"); \
+ mkdir -p "$(LINUXSTANDALONE_DEST)/shimmed/$$base"; \
+ mv "$$file" "$(LINUXSTANDALONE_DEST)/shimmed/$$base/"; \
echo "#!/bin/sh" > "$$file"; \
- echo "exec \"\$$GIT_ANNEX_LINKER\" --library-path \"\$$GIT_ANNEX_LD_LIBRARY_PATH\" \"\$$GIT_ANNEX_SHIMMED/$$(basename "$$file")\" \"\$$@\"" >> "$$file"; \
+ echo "exec \"\$$GIT_ANNEX_LINKER\" --library-path \"\$$GIT_ANNEX_LD_LIBRARY_PATH\" \"\$$GIT_ANNEX_SHIMMED/$$base/$$base\" \"\$$@\"" >> "$$file"; \
chmod +x "$$file"; \
fi; \
done