Skip to content

Commit 7ffe709

Browse files
Ramsay Allan JonesJunio C Hamano
authored andcommitted
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>
1 parent 1fd4da6 commit 7ffe709

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ install: all
712712
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
713713
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
714714
$(INSTALL) git$X gitk '$(DESTDIR_SQ)$(bindir_SQ)'
715-
$(MAKE) -C templates install
715+
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
716716
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)'
717717
$(INSTALL) $(PYMODULES) '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)'
718718
if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \

templates/Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ prefix ?= $(HOME)
66
template_dir ?= $(prefix)/share/git-core/templates/
77
# DESTDIR=
88

9-
# Shell quote;
10-
# Result of this needs to be placed inside ''
11-
shq = $(subst ','\'',$(1))
12-
# This has surrounding ''
13-
shellquote = '$(call shq,$(1))'
9+
# Shell quote (do not use $(call) to accomodate ancient setups);
10+
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
11+
template_dir_SQ = $(subst ','\'',$(template_dir))
1412

1513
all: boilerplates.made custom
1614

@@ -43,6 +41,6 @@ clean:
4341
rm -rf blt boilerplates.made
4442

4543
install: all
46-
$(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(template_dir))
44+
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(template_dir_SQ)'
4745
(cd blt && $(TAR) cf - .) | \
48-
(cd $(call shellquote,$(DESTDIR)$(template_dir)) && $(TAR) xf -)
46+
(cd '$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR) xf -)

0 commit comments

Comments
 (0)