From a493ba7d75043e8e649ee8d6d4942c1f4b31d1c5 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 29 Dec 2022 02:14:02 +0000 Subject: gentoo auto-resync : 29:12:2022 - 02:14:02 --- app-alternatives/sh/sh-0.ebuild | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app-alternatives/sh/sh-0.ebuild') diff --git a/app-alternatives/sh/sh-0.ebuild b/app-alternatives/sh/sh-0.ebuild index 4cd530a89d9c..682533efb3bf 100644 --- a/app-alternatives/sh/sh-0.ebuild +++ b/app-alternatives/sh/sh-0.ebuild @@ -5,6 +5,7 @@ EAPI=8 ALTERNATIVES=( bash:app-shells/bash + busybox:sys-apps/busybox dash:app-shells/dash ksh:app-shells/ksh "lksh:app-shells/mksh[lksh]" @@ -20,6 +21,19 @@ RDEPEND=" !!app-eselect/eselect-sh " +pkg_setup() { + if [[ -z ${ROOT} ]] && use busybox ; then + # Needed to avoid busybox preferring internal applets over PATH lookups. + # https://web.archive.org/web/20221206223848/https://busybox.net/FAQ.html#standalone_shell. + if busybox bbconfig | grep -q "CONFIG_FEATURE_SH_STANDALONE=y" ; then + ewarn "busybox is configured with CONFIG_FEATURE_SH_STANDALONE=y!" + ewarn "This is not a safe configuration for busybox as /bin/sh." + ewarn "Please use savedconfig to disable CONFIG_FEATURE_SH_STANDALONE on busybox." + die "Aborting due to unsafe Busybox configuration (CONFIG_FEATURE_SH_STANDALONE=y)!" + fi + fi +} + src_install() { dosym "$(get_alternative)" /bin/sh || die } -- cgit v1.2.3