Skip to content

Commit 7fa2b1f

Browse files
committed
Merge branch 'jn/makefile-script-lib'
* jn/makefile-script-lib: Do not install shell libraries executable
2 parents e95a4df + 46bac90 commit 7fa2b1f

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

Makefile

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ PROGRAMS =
315315
SCRIPT_PERL =
316316
SCRIPT_PYTHON =
317317
SCRIPT_SH =
318+
SCRIPT_LIB =
318319
TEST_PROGRAMS =
319320

320321
SCRIPT_SH += git-am.sh
@@ -326,20 +327,21 @@ SCRIPT_SH += git-merge-octopus.sh
326327
SCRIPT_SH += git-merge-one-file.sh
327328
SCRIPT_SH += git-merge-resolve.sh
328329
SCRIPT_SH += git-mergetool.sh
329-
SCRIPT_SH += git-mergetool--lib.sh
330330
SCRIPT_SH += git-notes.sh
331-
SCRIPT_SH += git-parse-remote.sh
332331
SCRIPT_SH += git-pull.sh
333332
SCRIPT_SH += git-quiltimport.sh
334333
SCRIPT_SH += git-rebase--interactive.sh
335334
SCRIPT_SH += git-rebase.sh
336335
SCRIPT_SH += git-repack.sh
337336
SCRIPT_SH += git-request-pull.sh
338-
SCRIPT_SH += git-sh-setup.sh
339337
SCRIPT_SH += git-stash.sh
340338
SCRIPT_SH += git-submodule.sh
341339
SCRIPT_SH += git-web--browse.sh
342340

341+
SCRIPT_LIB += git-mergetool--lib
342+
SCRIPT_LIB += git-parse-remote
343+
SCRIPT_LIB += git-sh-setup
344+
343345
SCRIPT_PERL += git-add--interactive.perl
344346
SCRIPT_PERL += git-difftool.perl
345347
SCRIPT_PERL += git-archimport.perl
@@ -1411,7 +1413,7 @@ export TAR INSTALL DESTDIR SHELL_PATH
14111413

14121414
SHELL = $(SHELL_PATH)
14131415

1414-
all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
1416+
all:: shell_compatibility_test $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
14151417
ifneq (,$X)
14161418
$(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
14171419
endif
@@ -1462,17 +1464,25 @@ common-cmds.h: ./generate-cmdlist.sh command-list.txt
14621464
common-cmds.h: $(wildcard Documentation/git-*.txt)
14631465
$(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
14641466

1467+
define cmd_munge_script
1468+
$(RM) $@ $@+ && \
1469+
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1470+
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
1471+
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1472+
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
1473+
-e $(BROKEN_PATH_FIX) \
1474+
1475+
endef
1476+
14651477
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
1466-
$(QUIET_GEN)$(RM) $@ $@+ && \
1467-
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1468-
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
1469-
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1470-
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
1471-
-e $(BROKEN_PATH_FIX) \
1472-
$@.sh >$@+ && \
1478+
$(QUIET_GEN)$(cmd_munge_script) && \
14731479
chmod +x $@+ && \
14741480
mv $@+ $@
14751481

1482+
$(SCRIPT_LIB) : % : %.sh
1483+
$(QUIET_GEN)$(cmd_munge_script) && \
1484+
mv $@+ $@
1485+
14761486
ifndef NO_PERL
14771487
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
14781488

@@ -1805,6 +1815,7 @@ install: all
18051815
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
18061816
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
18071817
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
1818+
$(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
18081819
$(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'
18091820
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
18101821
ifndef NO_PERL
@@ -1924,7 +1935,7 @@ distclean: clean
19241935
clean:
19251936
$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \
19261937
$(LIB_FILE) $(XDIFF_LIB)
1927-
$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
1938+
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
19281939
$(RM) $(TEST_PROGRAMS)
19291940
$(RM) -r bin-wrappers
19301941
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
@@ -1956,7 +1967,7 @@ endif
19561967
### Check documentation
19571968
#
19581969
check-docs::
1959-
@(for v in $(ALL_PROGRAMS) $(BUILT_INS) git gitk; \
1970+
@(for v in $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git gitk; \
19601971
do \
19611972
case "$$v" in \
19621973
git-merge-octopus | git-merge-ours | git-merge-recursive | \
@@ -1999,9 +2010,12 @@ check-docs::
19992010
documented,gitrepository-layout | \
20002011
documented,gittutorial | \
20012012
documented,gittutorial-2 | \
2013+
documented,git-bisect-lk2009 | \
2014+
documented.git-remote-helpers | \
2015+
documented,gitworkflows | \
20022016
sentinel,not,matching,is,ok ) continue ;; \
20032017
esac; \
2004-
case " $(ALL_PROGRAMS) $(BUILT_INS) git gitk " in \
2018+
case " $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git gitk " in \
20052019
*" $$cmd "*) ;; \
20062020
*) echo "removed but $$how: $$cmd" ;; \
20072021
esac; \

git-parse-remote.sh

100755100644
File mode changed.

git-sh-setup.sh

100755100644
File mode changed.

0 commit comments

Comments
 (0)