Makefile: consistently use @PLACEHOLDER@ to substitute

We have a bunch of placeholders in our scripts that we replace at build time, for example by using sed(1). These placeholders come in three different formats: @PLACEHOLDER@, @@PLACEHOLDER@@ and ++PLACEHOLDER++. Next to being inconsistent it also creates a bit of a problem with CMake, which only supports the first syntax in its `configure_file()` function. To work around that we instead manually replace placeholders via string operations, which is a hassle and removes safeguards that CMake has to verify that we didn't forget to replace any placeholders. Besides that, other build systems like Meson also support the CMake syntax. Unify our codebase to consistently use the syntax supported by such build systems. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Dec 6, 2024 at 14:24 UTC dbe46c0feb25417d01267bb97edb861694ed023d
18 files changed +119 -119
Makefile
+22 -22
@@ -1555,10 +1555,10 @@ endif
1555
1556 ifdef SANE_TOOL_PATH
1557 SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH))
1558 -BROKEN_PATH_FIX = 's|^\# @@BROKEN_PATH_FIX@@$$|git_broken_path_fix "$(SANE_TOOL_PATH_SQ)"|'
1558 +BROKEN_PATH_FIX = 's|^\# @BROKEN_PATH_FIX@$$|git_broken_path_fix "$(SANE_TOOL_PATH_SQ)"|'
1559 PATH := $(SANE_TOOL_PATH):${PATH}
1560 else
1561 -BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d'
1561 +BROKEN_PATH_FIX = '/^\# @BROKEN_PATH_FIX@$$/d'
1562 endif
1563
1564 ifeq (,$(HOST_CPU))
@@ -2548,13 +2548,13 @@ GIT-SCRIPT-DEFINES: FORCE
2548 define cmd_munge_script
2549 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2550 -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
2551 - -e 's|@@DIFF@@|$(DIFF_SQ)|' \
2552 - -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \
2553 - -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \
2551 + -e 's|@DIFF@|$(DIFF_SQ)|' \
2552 + -e 's|@LOCALEDIR@|$(localedir_SQ)|g' \
2553 + -e 's/@USE_GETTEXT_SCHEME@/$(USE_GETTEXT_SCHEME)/g' \
2554 -e $(BROKEN_PATH_FIX) \
2555 - -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
2556 - -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
2557 - -e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \
2555 + -e 's|@GITWEBDIR@|$(gitwebdir_SQ)|g' \
2556 + -e 's|@PERL@|$(PERL_PATH_SQ)|g' \
2557 + -e 's|@PAGER_ENV@|$(PAGER_ENV_SQ)|g' \
2558 $@.sh >$@+
2559 endef
2560
@@ -2611,7 +2611,7 @@ $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
2611 -e ' r GIT-PERL-HEADER' \
2612 -e ' G' \
2613 -e '}' \
2614 - -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
2614 + -e 's/@GIT_VERSION@/$(GIT_VERSION)/g' \
2615 $< >$@+ && \
2616 chmod +x $@+ && \
2617 mv $@+ $@
@@ -2629,11 +2629,11 @@ GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile
2629 INSTLIBDIR='$(perllibdir_SQ)' && \
2630 INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \
2631 INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \
2632 - sed -e 's=@@PATHSEP@@=$(pathsep)=g' \
2633 - -e "s=@@INSTLIBDIR@@=$$INSTLIBDIR=g" \
2634 - -e 's=@@PERLLIBDIR_REL@@=$(perllibdir_relative_SQ)=g' \
2635 - -e 's=@@GITEXECDIR_REL@@=$(gitexecdir_relative_SQ)=g' \
2636 - -e 's=@@LOCALEDIR_REL@@=$(localedir_relative_SQ)=g' \
2632 + sed -e 's=@PATHSEP@=$(pathsep)=g' \
2633 + -e "s=@INSTLIBDIR@=$$INSTLIBDIR=g" \
2634 + -e 's=@PERLLIBDIR_REL@=$(perllibdir_relative_SQ)=g' \
2635 + -e 's=@GITEXECDIR_REL@=$(gitexecdir_relative_SQ)=g' \
2636 + -e 's=@LOCALEDIR_REL@=$(localedir_relative_SQ)=g' \
2637 $< >$@+ && \
2638 mv $@+ $@
2639
@@ -2649,7 +2649,7 @@ else # NO_PERL
2649 $(SCRIPT_PERL_GEN) git-instaweb: % : unimplemented.sh
2650 $(QUIET_GEN) \
2651 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2652 - -e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \
2652 + -e 's|@REASON@|NO_PERL=$(NO_PERL)|g' \
2653 unimplemented.sh >$@+ && \
2654 chmod +x $@+ && \
2655 mv $@+ $@
@@ -2670,13 +2670,13 @@ else # NO_PYTHON
2670 $(SCRIPT_PYTHON_GEN): % : unimplemented.sh
2671 $(QUIET_GEN) \
2672 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2673 - -e 's|@@REASON@@|NO_PYTHON=$(NO_PYTHON)|g' \
2673 + -e 's|@REASON@|NO_PYTHON=$(NO_PYTHON)|g' \
2674 unimplemented.sh >$@+ && \
2675 chmod +x $@+ && \
2676 mv $@+ $@
2677 endif # NO_PYTHON
2678
2679 -CONFIGURE_RECIPE = sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
2679 +CONFIGURE_RECIPE = sed -e 's/@GIT_VERSION@/$(GIT_VERSION)/g' \
2680 configure.ac >configure.ac+ && \
2681 autoconf -o configure configure.ac+ && \
2682 $(RM) configure.ac+
@@ -3104,9 +3104,9 @@ endif
3104 perl/build/lib/%.pm: perl/%.pm GIT-PERL-DEFINES
3105 $(call mkdir_p_parent_template)
3106 $(QUIET_GEN) \
3107 - sed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \
3108 - -e 's|@@NO_GETTEXT@@|$(NO_GETTEXT_SQ)|g' \
3109 - -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \
3107 + sed -e 's|@LOCALEDIR@|$(perl_localedir_SQ)|g' \
3108 + -e 's|@NO_GETTEXT@|$(NO_GETTEXT_SQ)|g' \
3109 + -e 's|@NO_PERL_CPAN_FALLBACKS@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \
3110 < $< > $@
3111
3112 perl/build/man/man3/Git.3pm: perl/Git.pm
@@ -3231,8 +3231,8 @@ all:: $(TEST_PROGRAMS) $(test_bindir_programs) $(UNIT_TEST_PROGS) $(CLAR_TEST_PR
3231 bin-wrappers/%: wrap-for-bin.sh
3232 $(call mkdir_p_parent_template)
3233 $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
3234 - -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
3235 - -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \
3234 + -e 's|@BUILD_DIR@|$(shell pwd)|' \
3235 + -e 's|@PROG@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \
3236 chmod +x $@
3237
3238 # GNU make supports exporting all variables by "export" without parameters.
configure.ac
+1 -1
@@ -142,7 +142,7 @@ fi
142 ## Configure body starts here.
143
144 AC_PREREQ(2.59)
145 -AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org])
145 +AC_INIT([git], [@GIT_VERSION@], [git@vger.kernel.org])
146
147 AC_CONFIG_SRCDIR([git.c])
148
contrib/buildsystems/CMakeLists.txt
+17 -17
@@ -836,14 +836,14 @@ set(git_shell_scripts
836 foreach(script ${git_shell_scripts})
837 file(STRINGS ${CMAKE_SOURCE_DIR}/${script}.sh content NEWLINE_CONSUME)
838 string(REPLACE "@SHELL_PATH@" "${SHELL_PATH}" content "${content}")
839 - string(REPLACE "@@DIFF@@" "diff" content "${content}")
839 + string(REPLACE "@DIFF@" "diff" content "${content}")
840 string(REPLACE "@LOCALEDIR@" "${LOCALEDIR}" content "${content}")
841 string(REPLACE "@GITWEBDIR@" "${GITWEBDIR}" content "${content}")
842 - string(REPLACE "@@NO_CURL@@" "" content "${content}")
843 - string(REPLACE "@@USE_GETTEXT_SCHEME@@" "" content "${content}")
844 - string(REPLACE "# @@BROKEN_PATH_FIX@@" "" content "${content}")
845 - string(REPLACE "@@PERL@@" "${PERL_PATH}" content "${content}")
846 - string(REPLACE "@@PAGER_ENV@@" "LESS=FRX LV=-c" content "${content}")
842 + string(REPLACE "@NO_CURL@" "" content "${content}")
843 + string(REPLACE "@USE_GETTEXT_SCHEME@" "" content "${content}")
844 + string(REPLACE "# @BROKEN_PATH_FIX@" "" content "${content}")
845 + string(REPLACE "@PERL@" "${PERL_PATH}" content "${content}")
846 + string(REPLACE "@PAGER_ENV@" "LESS=FRX LV=-c" content "${content}")
847 file(WRITE ${CMAKE_BINARY_DIR}/${script} ${content})
848 endforeach()
849
@@ -852,13 +852,13 @@ parse_makefile_for_scripts(git_perl_scripts "SCRIPT_PERL" ".perl")
852
853 #create perl header
854 file(STRINGS ${CMAKE_SOURCE_DIR}/perl/header_templates/fixed_prefix.template.pl perl_header )
855 -string(REPLACE "@@PATHSEP@@" ":" perl_header "${perl_header}")
856 -string(REPLACE "@@INSTLIBDIR@@" "${INSTLIBDIR}" perl_header "${perl_header}")
855 +string(REPLACE "@PATHSEP@" ":" perl_header "${perl_header}")
856 +string(REPLACE "@INSTLIBDIR@" "${INSTLIBDIR}" perl_header "${perl_header}")
857
858 foreach(script ${git_perl_scripts})
859 file(STRINGS ${CMAKE_SOURCE_DIR}/${script}.perl content NEWLINE_CONSUME)
860 string(REPLACE "#!/usr/bin/perl" "#!/usr/bin/perl\n${perl_header}\n" content "${content}")
861 - string(REPLACE "@@GIT_VERSION@@" "${PROJECT_VERSION}" content "${content}")
861 + string(REPLACE "@GIT_VERSION@" "${PROJECT_VERSION}" content "${content}")
862 file(WRITE ${CMAKE_BINARY_DIR}/${script} ${content})
863 endforeach()
864
@@ -873,8 +873,8 @@ file(GLOB_RECURSE perl_modules "${CMAKE_SOURCE_DIR}/perl/*.pm")
873 foreach(pm ${perl_modules})
874 string(REPLACE "${CMAKE_SOURCE_DIR}/perl/" "" file_path ${pm})
875 file(STRINGS ${pm} content NEWLINE_CONSUME)
876 - string(REPLACE "@@LOCALEDIR@@" "${LOCALEDIR}" content "${content}")
877 - string(REPLACE "@@NO_PERL_CPAN_FALLBACKS@@" "" content "${content}")
876 + string(REPLACE "@LOCALEDIR@" "${LOCALEDIR}" content "${content}")
877 + string(REPLACE "@NO_PERL_CPAN_FALLBACKS@" "" content "${content}")
878 file(WRITE ${CMAKE_BINARY_DIR}/perl/build/lib/${file_path} ${content})
879 #test-lib.sh requires perl/build/lib to be the build directory of perl modules
880 endforeach()
@@ -1064,21 +1064,21 @@ set(wrapper_test_scripts
1064
1065 foreach(script ${wrapper_scripts})
1066 file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
1067 - string(REPLACE "@@BUILD_DIR@@" "${CMAKE_BINARY_DIR}" content "${content}")
1068 - string(REPLACE "@@PROG@@" "${script}${EXE_EXTENSION}" content "${content}")
1067 + string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1068 + string(REPLACE "@PROG@" "${script}${EXE_EXTENSION}" content "${content}")
1069 file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
1070 endforeach()
1071
1072 foreach(script ${wrapper_test_scripts})
1073 file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
1074 - string(REPLACE "@@BUILD_DIR@@" "${CMAKE_BINARY_DIR}" content "${content}")
1075 - string(REPLACE "@@PROG@@" "t/helper/${script}${EXE_EXTENSION}" content "${content}")
1074 + string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1075 + string(REPLACE "@PROG@" "t/helper/${script}${EXE_EXTENSION}" content "${content}")
1076 file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
1077 endforeach()
1078
1079 file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
1080 -string(REPLACE "@@BUILD_DIR@@" "${CMAKE_BINARY_DIR}" content "${content}")
1081 -string(REPLACE "@@PROG@@" "git-cvsserver" content "${content}")
1080 +string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1081 +string(REPLACE "@PROG@" "git-cvsserver" content "${content}")
1082 file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver ${content})
1083
1084 #options for configuring test options
git-cvsserver.perl
+1 -1
@@ -26,7 +26,7 @@ use File::Path qw/rmtree/;
26 use File::Basename;
27 use Getopt::Long qw(:config require_order no_ignore_case);
28
29 -my $VERSION = '@@GIT_VERSION@@';
29 +my $VERSION = '@GIT_VERSION@';
30
31 my $log = GITCVS::log->new();
32 my $cfg;
git-instaweb.sh
+4 -4
@@ -3,7 +3,7 @@
3 # Copyright (c) 2006 Eric Wong
4 #
5
6 -PERL='@@PERL@@'
6 +PERL='@PERL@'
7 OPTIONS_KEEPDASHDASH=
8 OPTIONS_STUCKLONG=
9 OPTIONS_SPEC="\
@@ -38,8 +38,8 @@ conf="$GIT_DIR/gitweb/httpd.conf"
38 # if installed, it doesn't need further configuration (module_path)
39 test -z "$httpd" && httpd='lighttpd -f'
40
41 -# Default is @@GITWEBDIR@@
42 -test -z "$root" && root='@@GITWEBDIR@@'
41 +# Default is @GITWEBDIR@
42 +test -z "$root" && root='@GITWEBDIR@'
43
44 # any untaken local port will do...
45 test -z "$port" && port=1234
@@ -716,7 +716,7 @@ EOF
716
717 gitweb_conf() {
718 cat > "$fqgitdir/gitweb/gitweb_config.perl" <<EOF
719 -#!@@PERL@@
719 +#!@PERL@
720 our \$projectroot = "$(dirname "$fqgitdir")";
721 our \$git_temp = "$fqgitdir/gitweb/tmp";
722 our \$projects_list = \$projectroot;
git-request-pull.sh
+1 -1
@@ -112,7 +112,7 @@ find_matching_ref='
112 }
113 '
114
115 -set fnord $(git ls-remote "$url" | @@PERL@@ -e "$find_matching_ref" "${remote:-HEAD}" "$headrev")
115 +set fnord $(git ls-remote "$url" | @PERL@ -e "$find_matching_ref" "${remote:-HEAD}" "$headrev")
116 remote_sha1=$2
117 ref=$3
118
git-send-email.perl
+1 -1
@@ -1501,7 +1501,7 @@ sub gen_header {
1501 @recipients = unique_email_list(@recipients,@cc,@initial_bcc);
1502 @recipients = (map { extract_valid_address_or_die($_) } @recipients);
1503 my $date = format_2822_time($time++);
1504 - my $gitversion = '@@GIT_VERSION@@';
1504 + my $gitversion = '@GIT_VERSION@';
1505 if ($gitversion =~ m/..GIT_VERSION../) {
1506 $gitversion = Git::version();
1507 }
git-sh-i18n.sh
+3 -3
@@ -9,7 +9,7 @@ TEXTDOMAIN=git
9 export TEXTDOMAIN
10 if test -z "$GIT_TEXTDOMAINDIR"
11 then
12 - TEXTDOMAINDIR="@@LOCALEDIR@@"
12 + TEXTDOMAINDIR="@LOCALEDIR@"
13 else
14 TEXTDOMAINDIR="$GIT_TEXTDOMAINDIR"
15 fi
@@ -17,9 +17,9 @@ export TEXTDOMAINDIR
17
18 # First decide what scheme to use...
19 GIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough
20 -if test -n "@@USE_GETTEXT_SCHEME@@"
20 +if test -n "@USE_GETTEXT_SCHEME@"
21 then
22 - GIT_INTERNAL_GETTEXT_SH_SCHEME="@@USE_GETTEXT_SCHEME@@"
22 + GIT_INTERNAL_GETTEXT_SH_SCHEME="@USE_GETTEXT_SCHEME@"
23 elif test -n "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"
24 then
25 : no probing necessary
git-sh-setup.sh
+3 -3
@@ -41,7 +41,7 @@ git_broken_path_fix () {
41 esac
42 }
43
44 -# @@BROKEN_PATH_FIX@@
44 +# @BROKEN_PATH_FIX@
45
46 # Source git-sh-i18n for gettext support.
47 . "$(git --exec-path)/git-sh-i18n"
@@ -154,7 +154,7 @@ git_pager() {
154 else
155 GIT_PAGER=cat
156 fi
157 - for vardef in @@PAGER_ENV@@
157 + for vardef in @PAGER_ENV@
158 do
159 var=${vardef%%=*}
160 eval ": \"\${$vardef}\" && export $var"
@@ -280,7 +280,7 @@ get_author_ident_from_commit () {
280 # remove lines from $1 that are not in $2, leaving only common lines.
281 create_virtual_base() {
282 sz0=$(wc -c <"$1")
283 - @@DIFF@@ -u -La/"$1" -Lb/"$1" "$1" "$2" | git apply --no-add
283 + @DIFF@ -u -La/"$1" -Lb/"$1" "$1" "$2" | git apply --no-add
284 sz1=$(wc -c <"$1")
285
286 # If we do not have enough common material, it is not
git-svn.perl
+1 -1
@@ -9,7 +9,7 @@ use vars qw/ $AUTHOR $VERSION
9 $_revision $_repository
10 $_q $_authors $_authors_prog %users/;
11 $AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
12 -$VERSION = '@@GIT_VERSION@@';
12 +$VERSION = '@GIT_VERSION@';
13
14 use Carp qw/croak/;
15 use File::Basename qw/dirname basename/;
gitweb/Makefile
+22 -22
@@ -79,28 +79,28 @@ GITWEB_JSLIB_FILES += static/js/blame_incremental.js
79
80
81 GITWEB_REPLACE = \
82 - -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
83 - -e 's|++GIT_BINDIR++|$(bindir)|g' \
84 - -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
85 - -e 's|++GITWEB_CONFIG_SYSTEM++|$(GITWEB_CONFIG_SYSTEM)|g' \
86 - -e 's|++GITWEB_CONFIG_COMMON++|$(GITWEB_CONFIG_COMMON)|g' \
87 - -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
88 - -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
89 - -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
90 - -e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \
91 - -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
92 - -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
93 - -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
94 - -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
95 - -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
96 - -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
97 - -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
98 - -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
99 - -e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \
100 - -e 's|++GITWEB_SITE_HTML_HEAD_STRING++|$(GITWEB_SITE_HTML_HEAD_STRING)|g' \
101 - -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
102 - -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
103 - -e 's|++HIGHLIGHT_BIN++|$(HIGHLIGHT_BIN)|g'
82 + -e 's|@GIT_VERSION@|$(GIT_VERSION)|g' \
83 + -e 's|@GIT_BINDIR@|$(bindir)|g' \
84 + -e 's|@GITWEB_CONFIG@|$(GITWEB_CONFIG)|g' \
85 + -e 's|@GITWEB_CONFIG_SYSTEM@|$(GITWEB_CONFIG_SYSTEM)|g' \
86 + -e 's|@GITWEB_CONFIG_COMMON@|$(GITWEB_CONFIG_COMMON)|g' \
87 + -e 's|@GITWEB_HOME_LINK_STR@|$(GITWEB_HOME_LINK_STR)|g' \
88 + -e 's|@GITWEB_SITENAME@|$(GITWEB_SITENAME)|g' \
89 + -e 's|@GITWEB_PROJECTROOT@|$(GITWEB_PROJECTROOT)|g' \
90 + -e 's|"@GITWEB_PROJECT_MAXDEPTH@"|$(GITWEB_PROJECT_MAXDEPTH)|g' \
91 + -e 's|@GITWEB_EXPORT_OK@|$(GITWEB_EXPORT_OK)|g' \
92 + -e 's|@GITWEB_STRICT_EXPORT@|$(GITWEB_STRICT_EXPORT)|g' \
93 + -e 's|@GITWEB_BASE_URL@|$(GITWEB_BASE_URL)|g' \
94 + -e 's|@GITWEB_LIST@|$(GITWEB_LIST)|g' \
95 + -e 's|@GITWEB_HOMETEXT@|$(GITWEB_HOMETEXT)|g' \
96 + -e 's|@GITWEB_CSS@|$(GITWEB_CSS)|g' \
97 + -e 's|@GITWEB_LOGO@|$(GITWEB_LOGO)|g' \
98 + -e 's|@GITWEB_FAVICON@|$(GITWEB_FAVICON)|g' \
99 + -e 's|@GITWEB_JS@|$(GITWEB_JS)|g' \
100 + -e 's|@GITWEB_SITE_HTML_HEAD_STRING@|$(GITWEB_SITE_HTML_HEAD_STRING)|g' \
101 + -e 's|@GITWEB_SITE_HEADER@|$(GITWEB_SITE_HEADER)|g' \
102 + -e 's|@GITWEB_SITE_FOOTER@|$(GITWEB_SITE_FOOTER)|g' \
103 + -e 's|@HIGHLIGHT_BIN@|$(HIGHLIGHT_BIN)|g'
104
105 .PHONY: FORCE
106 $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS: FORCE
gitweb/gitweb.perl
+22 -22
@@ -35,7 +35,7 @@ BEGIN {
35 CGI->compile() if $ENV{'MOD_PERL'};
36 }
37
38 -our $version = "++GIT_VERSION++";
38 +our $version = "@GIT_VERSION@";
39
40 our ($my_url, $my_uri, $base_url, $path_info, $home_link);
41 sub evaluate_uri {
@@ -80,46 +80,46 @@ sub evaluate_uri {
80
81 # core git executable to use
82 # this can just be "git" if your webserver has a sensible PATH
83 -our $GIT = "++GIT_BINDIR++/git";
83 +our $GIT = "@GIT_BINDIR@/git";
84
85 # absolute fs-path which will be prepended to the project path
86 #our $projectroot = "/pub/scm";
87 -our $projectroot = "++GITWEB_PROJECTROOT++";
87 +our $projectroot = "@GITWEB_PROJECTROOT@";
88
89 # fs traversing limit for getting project list
90 # the number is relative to the projectroot
91 -our $project_maxdepth = "++GITWEB_PROJECT_MAXDEPTH++";
91 +our $project_maxdepth = "@GITWEB_PROJECT_MAXDEPTH@";
92
93 # string of the home link on top of all pages
94 -our $home_link_str = "++GITWEB_HOME_LINK_STR++";
94 +our $home_link_str = "@GITWEB_HOME_LINK_STR@";
95
96 # extra breadcrumbs preceding the home link
97 our @extra_breadcrumbs = ();
98
99 # name of your site or organization to appear in page titles
100 # replace this with something more descriptive for clearer bookmarks
101 -our $site_name = "++GITWEB_SITENAME++"
101 +our $site_name = "@GITWEB_SITENAME@"
102 || ($ENV{'SERVER_NAME'} || "Untitled") . " Git";
103
104 # html snippet to include in the <head> section of each page
105 -our $site_html_head_string = "++GITWEB_SITE_HTML_HEAD_STRING++";
105 +our $site_html_head_string = "@GITWEB_SITE_HTML_HEAD_STRING@";
106 # filename of html text to include at top of each page
107 -our $site_header = "++GITWEB_SITE_HEADER++";
107 +our $site_header = "@GITWEB_SITE_HEADER@";
108 # html text to include at home page
109 -our $home_text = "++GITWEB_HOMETEXT++";
109 +our $home_text = "@GITWEB_HOMETEXT@";
110 # filename of html text to include at bottom of each page
111 -our $site_footer = "++GITWEB_SITE_FOOTER++";
111 +our $site_footer = "@GITWEB_SITE_FOOTER@";
112
113 # URI of stylesheets
114 -our @stylesheets = ("++GITWEB_CSS++");
114 +our @stylesheets = ("@GITWEB_CSS@");
115 # URI of a single stylesheet, which can be overridden in GITWEB_CONFIG.
116 our $stylesheet = undef;
117 # URI of GIT logo (72x27 size)
118 -our $logo = "++GITWEB_LOGO++";
118 +our $logo = "@GITWEB_LOGO@";
119 # URI of GIT favicon, assumed to be image/png type
120 -our $favicon = "++GITWEB_FAVICON++";
120 +our $favicon = "@GITWEB_FAVICON@";
121 # URI of gitweb.js (JavaScript code for gitweb)
122 -our $javascript = "++GITWEB_JS++";
122 +our $javascript = "@GITWEB_JS@";
123
124 # URI and label (title) of GIT logo link
125 #our $logo_url = "https://www.kernel.org/pub/software/scm/git/docs/";
@@ -128,7 +128,7 @@ our $logo_url = "https://git-scm.com/";
128 our $logo_label = "git homepage";
129
130 # source of projects list
131 -our $projects_list = "++GITWEB_LIST++";
131 +our $projects_list = "@GITWEB_LIST@";
132
133 # the width (in characters) of the projects list "Description" column
134 our $projects_list_description_width = 25;
@@ -147,7 +147,7 @@ our $default_projects_order = "project";
147
148 # show repository only if this file exists
149 # (only effective if this variable evaluates to true)
150 -our $export_ok = "++GITWEB_EXPORT_OK++";
150 +our $export_ok = "@GITWEB_EXPORT_OK@";
151
152 # don't generate age column on the projects list page
153 our $omit_age_column = 0;
@@ -161,11 +161,11 @@ our $omit_owner=0;
161 our $export_auth_hook = undef;
162
163 # only allow viewing of repositories also shown on the overview page
164 -our $strict_export = "++GITWEB_STRICT_EXPORT++";
164 +our $strict_export = "@GITWEB_STRICT_EXPORT@";
165
166 # list of git base URLs used for URL to where fetch project from,
167 # i.e. full URL is "$git_base_url/$project"
168 -our @git_base_url_list = grep { $_ ne '' } ("++GITWEB_BASE_URL++");
168 +our @git_base_url_list = grep { $_ ne '' } ("@GITWEB_BASE_URL@");
169
170 # default blob_plain mimetype and default charset for text/plain blob
171 our $default_blob_plain_mimetype = 'text/plain';
@@ -200,7 +200,7 @@ our $prevent_xss = 0;
200 # http://andre-simon.de/zip/download.php due to assumptions about parameters and output).
201 # Useful if highlight is not installed on your webserver's PATH.
202 # [Default: highlight]
203 -our $highlight_bin = "++HIGHLIGHT_BIN++";
203 +our $highlight_bin = "@HIGHLIGHT_BIN@";
204
205 # information about snapshot formats that gitweb is capable of serving
206 our %known_snapshot_formats = (
@@ -741,9 +741,9 @@ sub read_config_file {
741
742 our ($GITWEB_CONFIG, $GITWEB_CONFIG_SYSTEM, $GITWEB_CONFIG_COMMON);
743 sub evaluate_gitweb_config {
744 - our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
745 - our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
746 - our $GITWEB_CONFIG_COMMON = $ENV{'GITWEB_CONFIG_COMMON'} || "++GITWEB_CONFIG_COMMON++";
744 + our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "@GITWEB_CONFIG@";
745 + our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "@GITWEB_CONFIG_SYSTEM@";
746 + our $GITWEB_CONFIG_COMMON = $ENV{'GITWEB_CONFIG_COMMON'} || "@GITWEB_CONFIG_COMMON@";
747
748 # Protect against duplications of file names, to not read config twice.
749 # Only one of $GITWEB_CONFIG and $GITWEB_CONFIG_SYSTEM is used, so
perl/Git/I18N.pm
+3 -3
@@ -20,14 +20,14 @@ our @EXPORT_OK = @EXPORT;
20 # this "'@@' [...] '@@'" pattern.
21 use constant NO_GETTEXT_STR => '@@' . 'NO_GETTEXT' . '@@';
22 use constant NO_GETTEXT => (
23 - q[@@NO_GETTEXT@@] ne ''
23 + q[@NO_GETTEXT@] ne ''
24 and
25 - q[@@NO_GETTEXT@@] ne NO_GETTEXT_STR
25 + q[@NO_GETTEXT@] ne NO_GETTEXT_STR
26 );
27
28 sub __bootstrap_locale_messages {
29 our $TEXTDOMAIN = 'git';
30 - our $TEXTDOMAINDIR ||= $ENV{GIT_TEXTDOMAINDIR} || '@@LOCALEDIR@@';
30 + our $TEXTDOMAINDIR ||= $ENV{GIT_TEXTDOMAINDIR} || '@LOCALEDIR@';
31 die "NO_GETTEXT=" . NO_GETTEXT_STR if NO_GETTEXT;
32
33 require POSIX;
perl/Git/LoadCPAN.pm
+3 -3
@@ -31,11 +31,11 @@ C<git.git> repository. Use it for anything else at your peril!
31 # Makefile, and allows for detecting whether the module is loaded from
32 # perl/Git as opposed to perl/build/Git, which is useful for one-off
33 # testing without having Error.pm et al installed.
34 -use constant NO_PERL_CPAN_FALLBACKS_STR => '@@' . 'NO_PERL_CPAN_FALLBACKS' . '@@';
34 +use constant NO_PERL_CPAN_FALLBACKS_STR => '@' . 'NO_PERL_CPAN_FALLBACKS' . '@';
35 use constant NO_PERL_CPAN_FALLBACKS => (
36 - q[@@NO_PERL_CPAN_FALLBACKS@@] ne ''
36 + q[@NO_PERL_CPAN_FALLBACKS@] ne ''
37 and
38 - q[@@NO_PERL_CPAN_FALLBACKS@@] ne NO_PERL_CPAN_FALLBACKS_STR
38 + q[@NO_PERL_CPAN_FALLBACKS@] ne NO_PERL_CPAN_FALLBACKS_STR
39 );
40
41 sub import {
perl/header_templates/fixed_prefix.template.pl
+1 -1
@@ -1 +1 @@
1 -use lib (split(/@@PATHSEP@@/, $ENV{GITPERLLIB} || '@@INSTLIBDIR@@'));
1 +use lib (split(/@PATHSEP@/, $ENV{GITPERLLIB} || '@INSTLIBDIR@'));
perl/header_templates/runtime_prefix.template.pl
+4 -4
@@ -3,7 +3,7 @@
3 # This finds our Git::* libraries relative to the script's runtime path.
4 sub __git_system_path {
5 my ($relpath) = @_;
6 - my $gitexecdir_relative = '@@GITEXECDIR_REL@@';
6 + my $gitexecdir_relative = '@GITEXECDIR_REL@';
7
8 # GIT_EXEC_PATH is supplied by `git` or the test suite.
9 my $exec_path;
@@ -24,11 +24,11 @@ sub __git_system_path {
24 }
25
26 BEGIN {
27 - use lib split /@@PATHSEP@@/,
27 + use lib split /@PATHSEP@/,
28 (
29 $ENV{GITPERLLIB} ||
30 do {
31 - my $perllibdir = __git_system_path('@@PERLLIBDIR_REL@@');
31 + my $perllibdir = __git_system_path('@PERLLIBDIR_REL@');
32 (-e $perllibdir) || die("Invalid system path ($relpath): $path");
33 $perllibdir;
34 }
@@ -36,7 +36,7 @@ BEGIN {
36
37 # Export the system locale directory to the I18N module. The locale directory
38 # is only installed if NO_GETTEXT is set.
39 - $Git::I18N::TEXTDOMAINDIR = __git_system_path('@@LOCALEDIR_REL@@');
39 + $Git::I18N::TEXTDOMAINDIR = __git_system_path('@LOCALEDIR_REL@');
40 }
41
42 # END RUNTIME_PREFIX generated code.
unimplemented.sh
+1 -1
@@ -1,4 +1,4 @@
1 #!/bin/sh
2
3 -echo >&2 "fatal: git was built without support for $(basename $0) (@@REASON@@)."
3 +echo >&2 "fatal: git was built without support for $(basename $0) (@REASON@)."
4 exit 128
wrap-for-bin.sh
+9 -9
@@ -4,33 +4,33 @@
4 # to run test suite against sandbox, but with only bindir-installed
5 # executables in PATH. The Makefile copies this into various
6 # files in bin-wrappers, substituting
7 -# @@BUILD_DIR@@ and @@PROG@@.
7 +# @BUILD_DIR@ and @PROG@.
8
9 -GIT_EXEC_PATH='@@BUILD_DIR@@'
9 +GIT_EXEC_PATH='@BUILD_DIR@'
10 if test -n "$NO_SET_GIT_TEMPLATE_DIR"
11 then
12 unset GIT_TEMPLATE_DIR
13 else
14 - GIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'
14 + GIT_TEMPLATE_DIR='@BUILD_DIR@/templates/blt'
15 export GIT_TEMPLATE_DIR
16 fi
17 -GITPERLLIB='@@BUILD_DIR@@/perl/build/lib'"${GITPERLLIB:+:$GITPERLLIB}"
18 -GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'
19 -PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
17 +GITPERLLIB='@BUILD_DIR@/perl/build/lib'"${GITPERLLIB:+:$GITPERLLIB}"
18 +GIT_TEXTDOMAINDIR='@BUILD_DIR@/po/build/locale'
19 +PATH='@BUILD_DIR@/bin-wrappers:'"$PATH"
20
21 export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
22
23 case "$GIT_DEBUGGER" in
24 '')
25 - exec "${GIT_EXEC_PATH}/@@PROG@@" "$@"
25 + exec "${GIT_EXEC_PATH}/@PROG@" "$@"
26 ;;
27 1)
28 unset GIT_DEBUGGER
29 - exec gdb --args "${GIT_EXEC_PATH}/@@PROG@@" "$@"
29 + exec gdb --args "${GIT_EXEC_PATH}/@PROG@" "$@"
30 ;;
31 *)
32 GIT_DEBUGGER_ARGS="$GIT_DEBUGGER"
33 unset GIT_DEBUGGER
34 - exec ${GIT_DEBUGGER_ARGS} "${GIT_EXEC_PATH}/@@PROG@@" "$@"
34 + exec ${GIT_DEBUGGER_ARGS} "${GIT_EXEC_PATH}/@PROG@" "$@"
35 ;;
36 esac