Fix AttributeError from has_versions for atoms with no USE deps. Thanks to
authorZac Medico <zmedico@gentoo.org>
Thu, 28 Jan 2010 14:48:58 +0000 (14:48 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 28 Jan 2010 14:48:58 +0000 (14:48 -0000)
Arfrever for reporting.

svn path=/main/trunk/; revision=15214

bin/portageq
pym/portage/dep.py

index e02a9ddbb3a78027d0a18ec577f87304dd4755a3..8d6c12e23f8551ceea5600c182eddf9e12c4e096 100755 (executable)
@@ -47,8 +47,8 @@ from portage import os
 from portage.util import writemsg, writemsg_stdout
 
 def eval_atom_use(atom):
-       if atom.use.conditional and 'USE' in os.environ:
-               use = os.environ['USE'].split()
+       if 'USE' in os.environ:
+               use = frozenset(os.environ['USE'].split())
                atom = atom.evaluate_conditionals(use)
        return atom
 
index c241408a58a734383e0ed515d66e556f899f94d1..fe3f04f5972feb01aedcad5f33bec9f20cffe59f 100644 (file)
@@ -620,7 +620,7 @@ class Atom(_atom_base):
                @rtype: Atom
                @return: an atom instance with any USE conditionals evaluated
                """
-               if not self.use.conditional:
+               if not (self.use and self.use.conditional):
                        return self
                atom = remove_slot(self)
                if self.slot: