From 4d11fc91cb12840a6d5b8a583d594becfa7eba63 Mon Sep 17 00:00:00 2001 From: TomIO Date: Sat, 16 Nov 2024 23:17:06 +0100 Subject: [PATCH] fix(main/just): fix shebang recipes Co-authored-by: kaike95 <104430068+kaike95@users.noreply.github.com> Co-authored-by: Ted Stein <221157+tstein@users.noreply.github.com> --- packages/just/build.sh | 1 + packages/just/termux_shebang.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 packages/just/termux_shebang.patch diff --git a/packages/just/build.sh b/packages/just/build.sh index cc574f3f8280425..0bd0f46e7afb1d6 100644 --- a/packages/just/build.sh +++ b/packages/just/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="A handy way to save and run project-specific commands" TERMUX_PKG_LICENSE="CC0-1.0" TERMUX_PKG_MAINTAINER="@flipee" TERMUX_PKG_VERSION="1.36.0" +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/casey/just/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=bc2e2ff0268c2818659c524b21663564864b50ba102afb0a44fe73c08cf35ff0 TERMUX_PKG_AUTO_UPDATE=true diff --git a/packages/just/termux_shebang.patch b/packages/just/termux_shebang.patch new file mode 100644 index 000000000000000..e7d9781333af8b8 --- /dev/null +++ b/packages/just/termux_shebang.patch @@ -0,0 +1,13 @@ +diff --git a/src/recipe.rs b/src/recipe.rs +index 3976983a..4253099b 100644 +--- a/src/recipe.rs ++++ b/src/recipe.rs +@@ -355,6 +355,8 @@ impl<'src, D> Recipe<'src, D> { + .unwrap_or_else(|| Interpreter::default_script_interpreter()), + ) + } else { ++ evaluated_lines[0] = format!("#!@TERMUX_PREFIX@{}", evaluated_lines[0][2..].to_string()); ++ evaluated_lines[0] = evaluated_lines[0].replace("/usr/usr", "/usr"); + let line = evaluated_lines + .first() + .ok_or_else(|| Error::internal("evaluated_lines was empty"))?;