From 69685781db17d2de628090e5e1808f59c1f663ee Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 23 Aug 2016 13:27:26 -0400 Subject: [PATCH] git: Inform about need to install perl when needed Some git commands require perl, but since perl is a relatively large dependency we do not bring it in as a git dependency. Instead inform about the need to 'apt install perl' when trying to run a command requiring perl. Fixes #408. --- packages/git/build.sh | 1 + packages/git/help.c.patch | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 packages/git/help.c.patch diff --git a/packages/git/build.sh b/packages/git/build.sh index 0d33e6854..450034104 100755 --- a/packages/git/build.sh +++ b/packages/git/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Distributed version control system designed to handle ev # less is required as a pager for git log, and the busybox less does not handle used escape sequences. TERMUX_PKG_DEPENDS="libcurl, less" TERMUX_PKG_VERSION=2.9.3 +TERMUX_PKG_BUILD_REVISION=1 TERMUX_PKG_SRCURL=https://www.kernel.org/pub/software/scm/git/git-${TERMUX_PKG_VERSION}.tar.xz ## This requires a working $TERMUX_PREFIX/bin/sh on the host building: TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-tcltk --with-curl --with-shell=$TERMUX_PREFIX/bin/sh ac_cv_header_libintl_h=no ac_cv_fread_reads_directories=yes ac_cv_snprintf_returns_bogus=yes" diff --git a/packages/git/help.c.patch b/packages/git/help.c.patch new file mode 100644 index 000000000..18af2d6f7 --- /dev/null +++ b/packages/git/help.c.patch @@ -0,0 +1,21 @@ +diff -u -r ../git-2.9.3/help.c ./help.c +--- ../git-2.9.3/help.c 2016-08-12 15:38:45.000000000 -0400 ++++ ./help.c 2016-08-23 06:15:57.698156213 -0400 +@@ -307,7 +307,7 @@ + + static const char bad_interpreter_advice[] = + N_("'%s' appears to be a git command, but we were not\n" +- "able to execute it. Maybe git-%s is broken?"); ++ "able to execute it. Maybe you need to 'apt install perl'?"); + + const char *help_unknown_cmd(const char *cmd) + { +@@ -339,7 +339,7 @@ + * it's a bad interpreter in the #! line. + */ + if (!strcmp(candidate, cmd)) +- die(_(bad_interpreter_advice), cmd, cmd); ++ die(_(bad_interpreter_advice), cmd); + + /* Does the candidate appear in common_cmds list? */ + while (n < ARRAY_SIZE(common_cmds) &&