summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d5b0c9e)
raw | patch | inline | side by side (parent: d5b0c9e)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 10 Oct 2005 20:50:01 +0000 (13:50 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 10 Oct 2005 20:51:52 +0000 (13:51 -0700) |
... using HPA's shellquote macro.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile | patch | blob | history | |
git-merge-recursive.py | patch | blob | history | |
t/Makefile | patch | blob | history | |
templates/Makefile | patch | blob | history |
diff --git a/Makefile b/Makefile
index ac384c7dc484387b5f9fc6a65ef6cdbf2343cf9e..f7eee4708a5df439c5a39d4b3fae6ebc9baa4d4c 100644 (file)
--- a/Makefile
+++ b/Makefile
LIBS = $(LIB_FILE)
LIBS += -lz
+# Shell quote;
+# Result of this needs to be placed inside ''
+shq = $(subst ','\'',$(1))
+# This has surrounding ''
+shellquote = '$(call shq,$(1))'
+
#
# Platform specific tweaks
#
OPENSSL_LINK =
endif
else
- DEFINES += '-DNO_OPENSSL'
+ DEFINES += -DNO_OPENSSL
MOZILLA_SHA1 = 1
OPENSSL_LIBSSL =
endif
endif
endif
-DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)'
+DEFINES += -DSHA1_HEADER=$(call shellquote,$(SHA1_HEADER))
SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
git: git.sh Makefile
rm -f $@+ $@
- sed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
+ sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-e 's/@@X@@/$(X)/g' \
$(GIT_LIST_TWEAK) <$@.sh >$@+
$(filter-out git,$(patsubst %.sh,%,$(SCRIPT_SH))) : % : %.sh
rm -f $@
- sed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
+ sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
$@.sh >$@
chmod +x $@
$(patsubst %.perl,%,$(SCRIPT_PERL)) : % : %.perl
rm -f $@
- sed -e '1s|#!.*perl|#!$(PERL_PATH)|' \
+ sed -e '1s|#!.*perl|#!$(call shq,$(PERL_PATH))|' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
$@.perl >$@
chmod +x $@
$(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
rm -f $@
- sed -e '1s|#!.*python|#!$(PYTHON_PATH)|' \
- -e 's|@@GIT_PYTHON_PATH@@|$(GIT_PYTHON_DIR)|g' \
+ sed -e '1s|#!.*python|#!$(call shq,$(PYTHON_PATH))|' \
+ -e 's|@@GIT_PYTHON_PATH@@|$(call shq,$(GIT_PYTHON_DIR))|g' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
$@.py >$@
chmod +x $@
init-db.o: init-db.c
$(CC) -c $(ALL_CFLAGS) \
- -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir)"' $*.c
+ -DDEFAULT_GIT_TEMPLATE_DIR=$(call shellquote,"$(template_dir)") $*.c
$(LIB_OBJS): $(LIB_H)
$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H)
### Installation rules
install: $(PROGRAMS) $(SCRIPTS)
- $(INSTALL) -d -m755 $(DESTDIR)$(bindir)
- $(INSTALL) $(PROGRAMS) $(SCRIPTS) $(DESTDIR)$(bindir)
- $(INSTALL) git-revert $(DESTDIR)$(bindir)/git-cherry-pick
- sh ./cmd-rename.sh $(DESTDIR)$(bindir)
+ $(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(bindir))
+ $(INSTALL) $(PROGRAMS) $(SCRIPTS) $(call shellquote,$(DESTDIR)$(bindir))
+ $(INSTALL) git-revert $(call shellquote,$(DESTDIR)$(bindir)/git-cherry-pick)
+ sh ./cmd-rename.sh $(call shellquote,$(DESTDIR)$(bindir))
$(MAKE) -C templates install
- $(INSTALL) -d -m755 $(DESTDIR)$(GIT_PYTHON_DIR)
- $(INSTALL) $(PYMODULES) $(DESTDIR)$(GIT_PYTHON_DIR)
+ $(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(GIT_PYTHON_DIR))
+ $(INSTALL) $(PYMODULES) $(call shellquote,$(DESTDIR)$(GIT_PYTHON_DIR))
install-doc:
$(MAKE) -C Documentation install
diff --git a/git-merge-recursive.py b/git-merge-recursive.py
index b80a860357a4c402c01aeeb7d7974b8d6eafe23e..626d85493a64d798dedbdc52b2b0f68d56d447fd 100755 (executable)
--- a/git-merge-recursive.py
+++ b/git-merge-recursive.py
from heapq import heappush, heappop
from sets import Set
-sys.path.append('@@GIT_PYTHON_PATH@@')
+sys.path.append('''@@GIT_PYTHON_PATH@@''')
from gitMergeCommon import *
originalIndexFile = os.environ.get('GIT_INDEX_FILE',
diff --git a/t/Makefile b/t/Makefile
index e71da7782ecce282a2c0098cc1d10d2171a5a954..5c76afff83087ee4d6324699f7ba376c18201716 100644 (file)
--- a/t/Makefile
+++ b/t/Makefile
SHELL_PATH ?= $(SHELL)
TAR ?= $(TAR)
+# Shell quote;
+# Result of this needs to be placed inside ''
+shq = $(subst ','\'',$(1))
+# This has surrounding ''
+shellquote = '$(call shq,$(1))'
+
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
all:
- @$(foreach t,$T,echo "*** $t ***"; $(SHELL_PATH) $t $(GIT_TEST_OPTS) || exit; )
+ @$(foreach t,$T,echo "*** $t ***"; $(call shellquote,$(SHELL_PATH)) $t $(GIT_TEST_OPTS) || exit; )
@rm -fr trash
clean:
diff --git a/templates/Makefile b/templates/Makefile
index c23aee866d3eca13abd5586ee06bac6e2ab87dc7..07e928e56dd00678fdbe092b65bd16f7b7edfcc7 100644 (file)
--- a/templates/Makefile
+++ b/templates/Makefile
template_dir ?= $(prefix)/share/git-core/templates/
# DESTDIR=
+# Shell quote;
+# Result of this needs to be placed inside ''
+shq = $(subst ','\'',$(1))
+# This has surrounding ''
+shellquote = '$(call shq,$(1))'
+
all: boilerplates.made custom
find blt
rm -rf blt boilerplates.made
install: all
- $(INSTALL) -d -m755 $(DESTDIR)$(template_dir)
+ $(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(template_dir))
(cd blt && $(TAR) cf - .) | \
- (cd $(DESTDIR)$(template_dir) && $(TAR) xf -)
+ (cd $(call shellquote,$(DESTDIR)$(template_dir)) && $(TAR) xf -)