commit:     1088728d5541b66d6e572a431ac15d1013f8fc7d
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 11 22:30:04 2018 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 11 22:36:28 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1088728d

sys-apps/sed: use bootstrap logic with USE=forced-sandbox #650052

The build system runs sed scripts that use r (read) commands, so if the
system version had sandbox enabled, we won't be able to rebuild sed.
Use the existing bootstrap logic so people can enable/disable this flag
on the fly w/out wedging their systems.

Bug: https://bugs.gentoo.org/650052

 sys-apps/sed/metadata.xml      | 6 +++++-
 sys-apps/sed/sed-4.4-r1.ebuild | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/sys-apps/sed/metadata.xml b/sys-apps/sed/metadata.xml
index ea2a7bdbf75..504b6a5e464 100644
--- a/sys-apps/sed/metadata.xml
+++ b/sys-apps/sed/metadata.xml
@@ -9,6 +9,10 @@
        <remote-id type="sourceforge">sed</remote-id>
 </upstream>
 <use>
-       <flag name="forced-sandbox">Always enable --sandbox mode for 
simpler/secure runtime (disables e/r/w commands)</flag>
+       <flag name="forced-sandbox">
+               Always enable --sandbox mode for simpler/secure runtime 
(disables e/r/w commands).
+               Note: This may break many configure scripts, so it should be 
avoided on dev systems
+               (and generally used on binpkg/final systems only).
+       </flag>
 </use>
 </pkgmetadata>

diff --git a/sys-apps/sed/sed-4.4-r1.ebuild b/sys-apps/sed/sed-4.4-r1.ebuild
index 194b1b19369..39c3d130eac 100644
--- a/sys-apps/sed/sed-4.4-r1.ebuild
+++ b/sys-apps/sed/sed-4.4-r1.ebuild
@@ -21,8 +21,8 @@ DEPEND="${RDEPEND}
        nls? ( sys-devel/gettext )"
 
 src_bootstrap_sed() {
-       # make sure system-sed works #40786
-       if ! type -p sed > /dev/null ; then
+       # make sure system-sed works #40786 #650052
+       if ! type -p sed > /dev/null || has_version 
'sys-apps/sed[forced-sandbox]' ; then
                mkdir -p "${T}/bootstrap"
                printf '#!/bin/sh\nexec busybox sed "$@"\n' > 
"${T}/bootstrap/sed" || die
                chmod a+rx "${T}/bootstrap/sed"

Reply via email to