summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-12-06 11:01:05 +0000
committerZac Medico <zmedico@gentoo.org>2009-12-06 11:01:05 +0000
commit96bbd914fe5c6e5ec43445fd8b77a7ae885bd6d5 (patch)
tree52fc80582da1a1187f9a262d2bdcdaf979bf93ea
parentBug #295805 - Fix ValueError with python3 inside update_config_files(). (diff)
downloadportage-96bbd914fe5c6e5ec43445fd8b77a7ae885bd6d5.tar.gz
portage-96bbd914fe5c6e5ec43445fd8b77a7ae885bd6d5.tar.bz2
portage-96bbd914fe5c6e5ec43445fd8b77a7ae885bd6d5.zip
Move code for handling missing sandbox binary out of the config constructor.
(trunk r14930) svn path=/main/branches/2.1.7/; revision=14944
-rw-r--r--pym/portage/__init__.py33
1 files changed, 18 insertions, 15 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 62c4d3b36..d169ab114 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -2192,21 +2192,6 @@ class config(object):
# initialize self.features
self.regenerate()
- if not portage.process.sandbox_capable and \
- ("sandbox" in self.features or "usersandbox" in self.features):
- if self.profile_path is not None and \
- os.path.realpath(self.profile_path) == \
- os.path.realpath(os.path.join(config_root, PROFILE_PATH)):
- """ Don't show this warning when running repoman and the
- sandbox feature came from a profile that doesn't belong to
- the user."""
- writemsg(colorize("BAD", _("!!! Problem with sandbox"
- " binary. Disabling...\n\n")), noiselevel=-1)
- if "sandbox" in self.features:
- self.features.remove("sandbox")
- if "usersandbox" in self.features:
- self.features.remove("usersandbox")
-
if bsd_chflags:
self.features.add('chflags')
@@ -2340,6 +2325,18 @@ class config(object):
writemsg("!!! /etc/portage/profile/virtuals. Please move it to\n")
writemsg("!!! this new location.\n\n")
+ if not process.sandbox_capable and \
+ ("sandbox" in self.features or "usersandbox" in self.features):
+ if self.profile_path is not None and \
+ os.path.realpath(self.profile_path) == \
+ os.path.realpath(os.path.join(
+ self["PORTAGE_CONFIGROOT"], PROFILE_PATH)):
+ # Don't show this warning when running repoman and the
+ # sandbox feature came from a profile that doesn't belong
+ # to the user.
+ writemsg(colorize("BAD", _("!!! Problem with sandbox"
+ " binary. Disabling...\n\n")), noiselevel=-1)
+
if "fakeroot" in self.features and \
not portage.process.fakeroot_capable:
writemsg(_("!!! FEATURES=fakeroot is enabled, but the "
@@ -4103,6 +4100,9 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
(not droppriv and "sandbox" not in features and \
"usersandbox" not in features and not fakeroot))
+ if not free and not (fakeroot or process.sandbox_capable):
+ free = True
+
if free or "SANDBOX_ACTIVE" in os.environ:
keywords["opt_name"] += " bash"
spawn_func = portage.process.spawn_bash
@@ -7258,6 +7258,9 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
nosandbox = ("sandbox" not in features and \
"usersandbox" not in features)
+ if not process.sandbox_capable:
+ nosandbox = True
+
sesandbox = mysettings.selinux_enabled() and \
"sesandbox" in mysettings.features