sys-apps/sed: use bootstrap logic with USE=forced-sandbox #650052
authorMike Frysinger <vapier@gentoo.org>
Sun, 11 Mar 2018 22:30:04 +0000 (18:30 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sun, 11 Mar 2018 22:36:28 +0000 (18:36 -0400)
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
sys-apps/sed/sed-4.4-r1.ebuild

index ea2a7bdbf75c336807708610730c541c0f5164bb..504b6a5e46497e54df5a44be59f5d5d6a61a3f9d 100644 (file)
@@ -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>
index 194b1b19369292ab7c3d0e805ae07eb72fd20930..39c3d130eacfe240e6ef8f81d02dd9e548aff0c6 100644 (file)
@@ -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"