Fix installation of templates on ancient systems.

Do not use $(call) for 'shell quoting' paths, and pass DESTDIR down
to the templates makefile.

[jc: we have fixed the main Makefile long time ago, but somehow
 forgot to apply the same fix to templates Makefile.]

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Ramsay Allan Jones 2006-07-29 17:25:03 +01:00 committed by Junio C Hamano
parent 1fd4da643c
commit 7ffe7098dc
2 changed files with 6 additions and 8 deletions

View file

@ -712,7 +712,7 @@ install: all
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
$(INSTALL) git$X gitk '$(DESTDIR_SQ)$(bindir_SQ)' $(INSTALL) git$X gitk '$(DESTDIR_SQ)$(bindir_SQ)'
$(MAKE) -C templates install $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)' $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)'
$(INSTALL) $(PYMODULES) '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)' $(INSTALL) $(PYMODULES) '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)'
if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \ if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \

View file

@ -6,11 +6,9 @@ prefix ?= $(HOME)
template_dir ?= $(prefix)/share/git-core/templates/ template_dir ?= $(prefix)/share/git-core/templates/
# DESTDIR= # DESTDIR=
# Shell quote; # Shell quote (do not use $(call) to accomodate ancient setups);
# Result of this needs to be placed inside '' DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
shq = $(subst ','\'',$(1)) template_dir_SQ = $(subst ','\'',$(template_dir))
# This has surrounding ''
shellquote = '$(call shq,$(1))'
all: boilerplates.made custom all: boilerplates.made custom
@ -43,6 +41,6 @@ clean:
rm -rf blt boilerplates.made rm -rf blt boilerplates.made
install: all install: all
$(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(template_dir)) $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(template_dir_SQ)'
(cd blt && $(TAR) cf - .) | \ (cd blt && $(TAR) cf - .) | \
(cd $(call shellquote,$(DESTDIR)$(template_dir)) && $(TAR) xf -) (cd '$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR) xf -)