Pass $USE via IPC in order to ensure that we have the correct value for
authorZac Medico <zmedico@gentoo.org>
Sat, 14 Aug 2010 18:13:01 +0000 (11:13 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 14 Aug 2010 18:13:01 +0000 (11:13 -0700)
built/installed packages, since the config class doesn't currently provide
a way to access built/installed $USE that would work in all possible
scenarios.

bin/ebuild.sh
pym/portage/package/ebuild/_ipc/QueryCommand.py

index 32cda5012ef2e840ee731adcb3a0ea41118b8a6a..18f96b6555cd4309a9c9258359fe7235739091ae 100755 (executable)
@@ -160,7 +160,7 @@ has_version() {
        fi
 
        if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-               "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1"
+               "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1" "$USE"
                return $?
        fi
 
@@ -203,7 +203,7 @@ best_version() {
        fi
 
        if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-               "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1"
+               "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1" "$USE"
                return $?
        fi
 
index 47095cb4c5e715403ad2be9b921f2f665300340e..ec52e400f26af81f70bdaa8d17d4d4f0635c499f 100644 (file)
@@ -23,14 +23,20 @@ class QueryCommand(IpcCommand):
                """
                @returns: tuple of (stdout, stderr, returncode)
                """
-               cmd, root, atom = argv
+
+               # Note that $USE is passed via IPC in order to ensure that
+               # we have the correct value for built/installed packages,
+               # since the config class doesn't currently provide a way
+               # to access built/installed $USE that would work in all
+               # possible scenarios.
+               cmd, root, atom, use = argv
 
                try:
                        atom = Atom(atom)
                except InvalidAtom:
                        return ('', 'invalid atom: %s\n' % atom, 2)
 
-               use = frozenset(self.settings['PORTAGE_USE'].split())
+               use = frozenset(use.split())
                atom = atom.evaluate_conditionals(use)
 
                db = self._db