summaryrefslogtreecommitdiffstats
path: root/pym/_emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-13 12:14:06 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-13 12:14:06 -0700
commit612a8abf9995c593101b8344fda15acd8267c5e3 (patch)
tree41f74d2708d9b86dd12196baaf2975a7721880df /pym/_emerge
parent26744c1e52a05f7bdc9a14926eb15d7cd08cd354 (diff)
downloadportage-612a8abf9995c593101b8344fda15acd8267c5e3.tar.gz
portage-612a8abf9995c593101b8344fda15acd8267c5e3.tar.bz2
portage-612a8abf9995c593101b8344fda15acd8267c5e3.zip
Bug #315615 - Use EbuildIpcDaemon to implement has_version and best_version.
This provides performance benefits and also avoids permissions issues with FEATURES=userpriv.
Diffstat (limited to 'pym/_emerge')
-rw-r--r--pym/_emerge/AbstractEbuildProcess.py8
-rw-r--r--pym/_emerge/EbuildIpcDaemon.py1
-rw-r--r--pym/_emerge/actions.py2
3 files changed, 9 insertions, 2 deletions
diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 57f4c8f87..964095b2a 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -8,6 +8,7 @@ from _emerge.EbuildIpcDaemon import EbuildIpcDaemon
from portage.elog.messages import eerror
from portage.localization import _
from portage.package.ebuild._ipc.ExitCommand import ExitCommand
+from portage.package.ebuild._ipc.QueryCommand import QueryCommand
from portage import os
from portage import StringIO
from portage import _encodings
@@ -44,7 +45,12 @@ class AbstractEbuildProcess(SpawnProcess):
self.settings['PORTAGE_BUILDDIR'], '.ipc_in')
output_fifo = os.path.join(
self.settings['PORTAGE_BUILDDIR'], '.ipc_out')
- commands = {'exit' : self._exit_command}
+ query_command = QueryCommand()
+ commands = {
+ 'best_version' : query_command,
+ 'exit' : self._exit_command,
+ 'has_version' : query_command,
+ }
self._ipc_daemon = EbuildIpcDaemon(commands=commands,
input_fifo=input_fifo,
output_fifo=output_fifo,
diff --git a/pym/_emerge/EbuildIpcDaemon.py b/pym/_emerge/EbuildIpcDaemon.py
index 5f3d2ed01..68c68d28d 100644
--- a/pym/_emerge/EbuildIpcDaemon.py
+++ b/pym/_emerge/EbuildIpcDaemon.py
@@ -59,7 +59,6 @@ class EbuildIpcDaemon(FifoIpcDaemon):
if reply_hook is not None:
reply_hook()
- self._unregister_if_appropriate(event)
return self._registered
def _send_reply(self, reply):
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 7acc9e11d..fb692c363 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -33,6 +33,7 @@ from portage.output import blue, bold, colorize, create_color_func, darkgreen, \
red, yellow
good = create_color_func("GOOD")
bad = create_color_func("BAD")
+from portage.package.ebuild._ipc.QueryCommand import QueryCommand
from portage.sets import load_default_config, SETPREFIX
from portage.sets.base import InternalPackageSet
from portage.util import cmp_sort_key, writemsg, \
@@ -2774,6 +2775,7 @@ def load_emerge_config(trees=None):
mtimedbfile = os.path.join(os.path.sep, settings['ROOT'], portage.CACHE_PATH, "mtimedb")
mtimedb = portage.MtimeDB(mtimedbfile)
portage.output._init(config_root=settings['PORTAGE_CONFIGROOT'])
+ QueryCommand._db = trees
return settings, trees, mtimedb
def chk_updated_cfg_files(target_root, config_protect):