Git fork

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>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
dbe46c0f 4638e880

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