From 168a1dbd2eb9a43936fc31545bf345971fc8da45 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 18 Feb 2025 15:59:02 +0100 Subject: [PATCH] app-shells/mksh: apply upstream patch to fix fgrep deprecation Closes: https://bugs.gentoo.org/949882 Signed-off-by: Haelwenn (lanodan) Monnier Closes: https://github.com/gentoo/gentoo/pull/40636 Signed-off-by: Sam James --- app-shells/mksh/files/mksh-59c-fgrep.patch | 60 ++++++++++++++++++++++ app-shells/mksh/mksh-59c.ebuild | 6 ++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 app-shells/mksh/files/mksh-59c-fgrep.patch diff --git a/app-shells/mksh/files/mksh-59c-fgrep.patch b/app-shells/mksh/files/mksh-59c-fgrep.patch new file mode 100644 index 0000000000000..c27bf893934cd --- /dev/null +++ b/app-shells/mksh/files/mksh-59c-fgrep.patch @@ -0,0 +1,60 @@ +From 94229c3fdb6bb3afcc6fbecf4b2e521a9d485dd1 Mon Sep 17 00:00:00 2001 +From: tg +Date: Tue, 27 Jul 2021 19:17:14 +0000 +Subject: [PATCH] =?UTF-8?q?we=20may=20have=20neither=20fgrep=20nor=20grep?= + =?UTF-8?q?=20-F=20(scosysv=20has=20only=20the=20former=E2=80=A6)?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + Build.sh | 6 +++--- + check.t | 8 ++++---- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Build.sh b/Build.sh +index dc98dfa2..08d368d2 100644 +--- a/Build.sh ++++ b/Build.sh +@@ -1413,7 +1413,7 @@ tcc) + ;; + tendra) + vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -V 2>&1 | \ +- grep -F -i -e version -e release" ++ grep -i -e version -e release" + ;; + ucode) + vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -V" +@@ -2688,7 +2688,7 @@ cat >test.sh <<-EOF + args[\${#args[*]}]=\$TMPDIR + fi + print Testing mksh for conformance: +- grep -F -e 'KSH R' -e Mir''OS: "\$sflag" | sed '/KSH/s/^./& /' ++ grep -e 'KSH R' -e Mir''OS: "\$sflag" | sed '/KSH/s/^./& /' + print "This shell is actually:\\n\\t\$KSH_VERSION" + print 'test.sh built for mksh $dstversion' + cstr='\$os = defined \$^O ? \$^O : "unknown";' +diff --git a/check.t b/check.t +index 0d9d50c4..bfe116f0 100644 +--- a/check.t ++++ b/check.t +@@ -6726,7 +6726,7 @@ stdin: + echo FNORD-7 + typeset - + echo FNORD-8 +- } | fgrep FNORD ++ } | grep FNORD + fnord=(42 23) + typeset -p fnord + echo FNORD-9 +@@ -8723,8 +8723,8 @@ stdin: + (echo x; exit 12) | (cat; exit 23) | (cat; exit 42) + echo 5 $? , $PIPESTATUS , ${PIPESTATUS[0]} , ${PIPESTATUS[1]} , ${PIPESTATUS[2]} , ${PIPESTATUS[3]} . + echo 6 ${PIPESTATUS[0]} . +- set | fgrep PIPESTATUS +- echo 8 $(set | fgrep PIPESTATUS) . ++ set | grep PIPESTATUS ++ echo 8 $(set | grep PIPESTATUS) . + expected-stdout: + 1 0 . + 2 0 . diff --git a/app-shells/mksh/mksh-59c.ebuild b/app-shells/mksh/mksh-59c.ebuild index 2921a6d7f5c8e..4dff407f5308f 100644 --- a/app-shells/mksh/mksh-59c.ebuild +++ b/app-shells/mksh/mksh-59c.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -39,6 +39,10 @@ DEPEND=" ) " +PATCHES=( + "${FILESDIR}/mksh-59c-fgrep.patch" +) + src_prepare() { default if use lksh; then