mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
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:
3
Makefile
3
Makefile
@@ -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
|
||||
|
||||
@@ -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 >$@
|
||||
|
||||
Reference in New Issue
Block a user