summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-14 09:20:49 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-14 09:20:49 -0700
commite38aa7eef4b9ddf873cc0958ef4511e4577106ff (patch)
treef0f1e3713b2682bb8fc9873994eba78be2a58595
parent553c12294d16a652109d14a43ce4fdf7bc73ebea (diff)
downloadportage-e38aa7eef4b9ddf873cc0958ef4511e4577106ff.tar.gz
portage-e38aa7eef4b9ddf873cc0958ef4511e4577106ff.tar.bz2
portage-e38aa7eef4b9ddf873cc0958ef4511e4577106ff.zip
Add a QueryCommand.settings attribute and use it so that $USE
doesn't have to be passed to the daemon in has_version and best_version calls.
-rwxr-xr-xbin/ebuild.sh4
-rw-r--r--pym/_emerge/AbstractEbuildProcess.py2
-rw-r--r--pym/portage/package/ebuild/_ipc/QueryCommand.py9
3 files changed, 8 insertions, 7 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 18f96b655..32cda5012 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -160,7 +160,7 @@ has_version() {
fi
if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
- "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1" "$USE"
+ "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1"
return $?
fi
@@ -203,7 +203,7 @@ best_version() {
fi
if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
- "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1" "$USE"
+ "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1"
return $?
fi
diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 416babcfb..21fd88038 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -41,7 +41,7 @@ class AbstractEbuildProcess(SpawnProcess):
self.settings['PORTAGE_BUILDDIR'], '.ipc_in')
output_fifo = os.path.join(
self.settings['PORTAGE_BUILDDIR'], '.ipc_out')
- query_command = QueryCommand()
+ query_command = QueryCommand(self.settings)
commands = {
'best_version' : query_command,
'exit' : self._exit_command,
diff --git a/pym/portage/package/ebuild/_ipc/QueryCommand.py b/pym/portage/package/ebuild/_ipc/QueryCommand.py
index 684837456..47095cb4c 100644
--- a/pym/portage/package/ebuild/_ipc/QueryCommand.py
+++ b/pym/portage/package/ebuild/_ipc/QueryCommand.py
@@ -11,25 +11,26 @@ from portage.versions import best
class QueryCommand(IpcCommand):
- __slots__ = ()
+ __slots__ = ('settings',)
_db = None
- def __init__(self):
+ def __init__(self, settings):
IpcCommand.__init__(self)
+ self.settings = settings
def __call__(self, argv):
"""
@returns: tuple of (stdout, stderr, returncode)
"""
- cmd, root, atom, use = argv
+ cmd, root, atom = argv
try:
atom = Atom(atom)
except InvalidAtom:
return ('', 'invalid atom: %s\n' % atom, 2)
- use = frozenset(use.split())
+ use = frozenset(self.settings['PORTAGE_USE'].split())
atom = atom.evaluate_conditionals(use)
db = self._db