From 96bbd914fe5c6e5ec43445fd8b77a7ae885bd6d5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 6 Dec 2009 11:01:05 +0000 Subject: Move code for handling missing sandbox binary out of the config constructor. (trunk r14930) svn path=/main/branches/2.1.7/; revision=14944 --- pym/portage/__init__.py | 33 ++++++++++++++++++--------------- 1 file 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 -- cgit v1.2.3-65-gdbad