MinGW: Change the name of hook scripts to make them not executable by default.

Since on Windows there is no 'executable' bit whose absence would deny
execution of a script, we must change the hook scripts' names entirely
to inhibit that they can be invoked by the tools.
This commit is contained in:
Johannes Sixt
2007-01-25 09:17:06 +01:00
parent 10c1047e09
commit daabe66f18
2 changed files with 9 additions and 2 deletions

View File

@@ -434,6 +434,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
COMPAT_OBJS += compat/mingw.o compat/fnmatch.o
EXTLIBS += -lws2_32 -lregex
X = .exe
NOEXECTEMPL = .noexec
endif
ifneq (,$(findstring arm,$(uname_M)))
ARM_SHA1 = YesPlease
@@ -635,7 +636,7 @@ endif
all::
$(MAKE) -C perl PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
$(MAKE) -C templates
$(MAKE) -C templates NOEXECTEMPL='$(NOEXECTEMPL)'
strip: $(PROGRAMS) git$X
$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X

View File

@@ -5,6 +5,8 @@ TAR ?= tar
prefix ?= $(HOME)
template_dir ?= $(prefix)/share/git-core/templates/
# DESTDIR=
# set NOEXECTEMPL to non-empty to change the names of hook scripts
# so that the tools will not find them
# Shell quote (do not use $(call) to accomodate ancient setups);
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
@@ -27,7 +29,11 @@ boilerplates.made : $(bpsrc)
mkdir -p blt/$$dir && \
case "$$boilerplate" in \
*--) ;; \
*) cp $$boilerplate blt/$$dst ;; \
*) if head -1 $$boilerplate | grep -q '^#!/'; then \
cp $$boilerplate blt/$${dst}$(NOEXECTEMPL); \
else \
cp $$boilerplate blt/$$dst; \
fi ;; \
esac || exit; \
done || exit
date >$@