mirror of
https://github.com/git/git.git
synced 2026-03-14 10:53:25 +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
|
COMPAT_OBJS += compat/mingw.o compat/fnmatch.o
|
||||||
EXTLIBS += -lws2_32 -lregex
|
EXTLIBS += -lws2_32 -lregex
|
||||||
X = .exe
|
X = .exe
|
||||||
|
NOEXECTEMPL = .noexec
|
||||||
endif
|
endif
|
||||||
ifneq (,$(findstring arm,$(uname_M)))
|
ifneq (,$(findstring arm,$(uname_M)))
|
||||||
ARM_SHA1 = YesPlease
|
ARM_SHA1 = YesPlease
|
||||||
@@ -635,7 +636,7 @@ endif
|
|||||||
|
|
||||||
all::
|
all::
|
||||||
$(MAKE) -C perl PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' 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: $(PROGRAMS) git$X
|
||||||
$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
|
$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ TAR ?= tar
|
|||||||
prefix ?= $(HOME)
|
prefix ?= $(HOME)
|
||||||
template_dir ?= $(prefix)/share/git-core/templates/
|
template_dir ?= $(prefix)/share/git-core/templates/
|
||||||
# DESTDIR=
|
# 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);
|
# Shell quote (do not use $(call) to accomodate ancient setups);
|
||||||
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
||||||
@@ -27,7 +29,11 @@ boilerplates.made : $(bpsrc)
|
|||||||
mkdir -p blt/$$dir && \
|
mkdir -p blt/$$dir && \
|
||||||
case "$$boilerplate" in \
|
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; \
|
esac || exit; \
|
||||||
done || exit
|
done || exit
|
||||||
date >$@
|
date >$@
|
||||||
|
|||||||
Reference in New Issue
Block a user