commit:     891926ba231380c4aa0768be0aa0ae1ed2bc6ae7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  3 21:49:26 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar  3 22:10:07 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=891926ba

_spawn_actionmap: simplify nosandbox logic

Remove a nosandbox assignment that never executes, since the condition for
the 'if' statement always evaluates to False:

nosandbox = ( "userpriv" in features and
              "usersandbox" not in features and
              "userpriv" not in restrict and
              "nouserpriv" not in restrict )

If nosandbox is True, it implies that the following expression is False:

            ( "userpriv" not in features or
              "userpriv" in restrict or
              "nouserpriv" in restrict )

Therefore, the condition for the 'if' statement always evaluates to False.

Reported-by: Douglas Freed <dwfreed <AT> mtu.edu>

 pym/portage/package/ebuild/doebuild.py | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/pym/portage/package/ebuild/doebuild.py 
b/pym/portage/package/ebuild/doebuild.py
index 17fc8ccf4..8c8f373bf 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1354,11 +1354,6 @@ def _spawn_actionmap(settings):
                ("usersandbox" not in features) and \
                "userpriv" not in restrict and \
                "nouserpriv" not in restrict)
-       if nosandbox and ("userpriv" not in features or \
-               "userpriv" in restrict or \
-               "nouserpriv" in restrict):
-               nosandbox = ("sandbox" not in features and \
-                       "usersandbox" not in features)
 
        if not portage.process.sandbox_capable:
                nosandbox = True

Reply via email to