From: Zac Medico Date: Sat, 14 Aug 2010 16:20:49 +0000 (-0700) Subject: Add a QueryCommand.settings attribute and use it so that $USE X-Git-Tag: v2.2_rc68~218 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e38aa7eef4b9ddf873cc0958ef4511e4577106ff;p=portage.git 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. --- 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