Files
git/generate-script.sh
Carlo Marcelo Arenas Belón 0e3233b913 git-gui: honor TCLTK_PATH in git-gui--askpass
Since its introduction in 8c76212 (git-gui: Add a simple implementation
of SSH_ASKPASS., 2008-10-15), git-gui--askpass has been calling whatever
wish interpreter is in the path, unlike git-gui.

Correct that by turning it into a script that would be processed at build
time.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2025-07-31 18:42:54 +02:00

35 lines
661 B
Bash
Executable File

#!/bin/sh
set -e
if test $# -ne 3
then
echo >&2 "USAGE: $0 <INPUT> <OUTPUT> <GIT-BUILD-OPTIONS>"
exit 1
fi
INPUT="$1"
OUTPUT="$2"
BUILD_OPTIONS="$3"
. "$BUILD_OPTIONS"
sed -e "1s|#!.*/sh|#!$SHELL_PATH|" \
-e "s|@SHELL_PATH@|$SHELL_PATH|" \
-e "s|@DIFF@|$DIFF|" \
-e "s|@LOCALEDIR@|$LOCALEDIR|g" \
-e "s/@USE_GETTEXT_SCHEME@/$USE_GETTEXT_SCHEME/g" \
-e "$BROKEN_PATH_FIX" \
-e "s|@GITWEBDIR@|$GITWEBDIR|g" \
-e "s|@PERL_PATH@|$PERL_PATH|g" \
-e "s|@PAGER_ENV@|$PAGER_ENV|g" \
"$INPUT" >"$OUTPUT"
case "$(basename "$INPUT")" in
git-mergetool--lib.sh|git-sh-i18n.sh|git-sh-setup.sh)
;;
*)
chmod a+x "$OUTPUT"
;;
esac