--update: don't ignore higher versions because of missing IUSE
authorSebastian Luther <SebastianLuther@gmx.de>
Tue, 27 Apr 2010 20:33:02 +0000 (22:33 +0200)
committerZac Medico <zmedico@gentoo.org>
Tue, 27 Apr 2010 21:17:59 +0000 (14:17 -0700)
pym/_emerge/depgraph.py
pym/portage/dbapi/__init__.py
pym/portage/package/ebuild/config.py

index 65df15c5538beca6723d66f575e1733839ed07fa..4214abdfc14529e0d989f2c5b0400624ae3c23c9 100644 (file)
@@ -2442,7 +2442,7 @@ class depgraph(object):
                                        if want_reinstall and matched_packages:
                                                continue
 
-                               for pkg in self._iter_match_pkgs(root_config, pkg_type, atom, 
+                               for pkg in self._iter_match_pkgs(root_config, pkg_type, atom.without_use
                                        onlydeps=onlydeps):
                                        if pkg in self._dynamic_config._runtime_pkg_mask:
                                                # The package has been masked by the backtracking logic
@@ -2459,6 +2459,17 @@ class depgraph(object):
                                                if higher_version_rejected:
                                                        continue
 
+                                       if atom.use:
+                                               for x in atom.use.required:
+                                                       if x not in pkg.iuse.all and \
+                                                               pkg.root_config.settings.iuse_implicit_re.match(x) is None:
+                                                               missing_iuse = True
+                                                               break
+                                               if missing_iuse:
+                                                       if not pkg.installed:
+                                                               packages_with_invalid_use_config.append(pkg)
+                                                       continue
+
                                        cpv = pkg.cpv
                                        # Make --noreplace take precedence over --newuse.
                                        if not pkg.installed and noreplace and \
index c86616a95760ecdcbdabcbe6bc210576f821138e..f8fe8976915a19a9df3af05ea4247b4414bedc86 100644 (file)
@@ -23,7 +23,6 @@ class dbapi(object):
        _category_re = re.compile(r'^\w[-.+\w]*$')
        _pkg_dir_name_re = re.compile(r'^\w[-+\w]*$')
        _categories = None
-       _iuse_implicit_re = None
        _use_mutable = False
        _known_keys = frozenset(x for x in auxdbkeys
                if not x.startswith("UNUSED_0"))
@@ -146,10 +145,8 @@ class dbapi(object):
                1) Check for required IUSE intersection (need implicit IUSE here).
                2) Check enabled/disabled flag states.
                """
-               if self._iuse_implicit_re is None:
-                       self._iuse_implicit_re = re.compile("^(%s)$" % \
-                               "|".join(self.settings._get_implicit_iuse()))
-               iuse_implicit_re = self._iuse_implicit_re
+
+               iuse_implicit_re = self.settings.iuse_implicit_re
                for cpv in cpv_iter:
                        try:
                                iuse, slot, use = self.aux_get(cpv, ["IUSE", "SLOT", "USE"])
index a3998cc79a52d95bec67536d4866a8e3b3f65d83..239eced4a63470b6625ba131aafa6ce6548c5e3a 100644 (file)
@@ -426,6 +426,8 @@ class config(object):
                        self._license_groups = copy.deepcopy(clone._license_groups)
                        self._accept_properties = copy.deepcopy(clone._accept_properties)
                        self._ppropertiesdict = copy.deepcopy(clone._ppropertiesdict)
+
+                       self.iuse_implicit_re = clone.iuse_implicit_re
                else:
 
                        def check_var_directory(varname, var):
@@ -1011,6 +1013,9 @@ class config(object):
                                _validate_cache_for_unsupported_eapis = False
                                _glep_55_enabled = True
 
+                       self.iuse_implicit_re = re.compile("^(%s)$" % \
+                               "|".join(self._get_implicit_iuse()))
+
                for k in self._case_insensitive_vars:
                        if k in self:
                                self[k] = self[k].lower()