summaryrefslogtreecommitdiff
path: root/portato/backend
diff options
context:
space:
mode:
authornecoro <>2007-09-10 22:28:08 +0000
committernecoro <>2007-09-10 22:28:08 +0000
commit1fec1c9c791275d82ee34240c02c4abc92f9d5fe (patch)
treebc4fb396a1b79999436e5c6987fba6e78464b003 /portato/backend
parent14896261de02ff20a2bc6cef29be0aa51d55dafa (diff)
downloadportato-1fec1c9c791275d82ee34240c02c4abc92f9d5fe.tar.gz
portato-1fec1c9c791275d82ee34240c02c4abc92f9d5fe.tar.bz2
portato-1fec1c9c791275d82ee34240c02c4abc92f9d5fe.zip
fixed masked useflag bug
Diffstat (limited to '')
-rw-r--r--portato/backend/portage/package.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/portato/backend/portage/package.py b/portato/backend/portage/package.py
index eea0ec8..38dcb4b 100644
--- a/portato/backend/portage/package.py
+++ b/portato/backend/portage/package.py
@@ -10,7 +10,7 @@
#
# Written by René 'Necoro' Neumann <necoro@necoro.net>
-from __future__ import absolute_import
+from __future__ import absolute_import, with_statement
from ..package import Package
from .. import flags
@@ -40,8 +40,11 @@ class PortagePackage (Package):
self._trees = system.settings.trees
self.forced_flags = set()
- self.forced_flags.update(self._settings.settings.usemask)
- self.forced_flags.update(self._settings.settings.useforce)
+
+ with self._settingslock:
+ self._settings.settings.setcpv(self._cpv)
+ self.forced_flags.update(self._settings.settings.usemask)
+ self.forced_flags.update(self._settings.settings.useforce)
try:
self._status = portage.getmaskingstatus(self.get_cpv(), settings = self._settings.settings)
@@ -228,10 +231,10 @@ class PortagePackage (Package):
return dep_pkgs
def get_global_settings(self, key):
- self._settingslock.acquire()
- self._settings.settings.setcpv(self._cpv)
- v = self._settings.settings[key]
- self._settingslock.release()
+ with self._settingslock:
+ self._settings.settings.setcpv(self._cpv)
+ v = self._settings.settings[key]
+
return v
def get_ebuild_path(self):