_show_unsatisfied_dep: avoid invalid, bug #394995
authorZac Medico <zmedico@gentoo.org>
Sat, 17 Dec 2011 19:32:59 +0000 (11:32 -0800)
committerZac Medico <zmedico@gentoo.org>
Sat, 17 Dec 2011 19:32:59 +0000 (11:32 -0800)
pym/_emerge/depgraph.py

index e7307c00c2333040e89c5f0778c55785a0bba4f3..63365cd9640cd9d1faa170eea6152b0c4ed42f27 100644 (file)
@@ -2985,12 +2985,20 @@ class depgraph(object):
                                                        repo = metadata.get('repository')
                                                pkg = self._pkg(cpv, pkg_type, root_config,
                                                        installed=installed, myrepo=repo)
-                                               if not atom_set.findAtomForPackage(pkg,
-                                                       modified_use=self._pkg_use_enabled(pkg)):
-                                                       continue
                                                # pkg.metadata contains calculated USE for ebuilds,
                                                # required later for getMissingLicenses.
                                                metadata = pkg.metadata
+                                               if pkg.invalid:
+                                                       # Avoid doing any operations with packages that
+                                                       # have invalid metadata. It would be unsafe at
+                                                       # least because it could trigger unhandled
+                                                       # exceptions in places like check_required_use().
+                                                       masked_packages.append(
+                                                               (root_config, pkgsettings, cpv, repo, metadata, mreasons))
+                                                       continue
+                                               if not atom_set.findAtomForPackage(pkg,
+                                                       modified_use=self._pkg_use_enabled(pkg)):
+                                                       continue
                                                if pkg in self._dynamic_config._runtime_pkg_mask:
                                                        backtrack_reasons = \
                                                                self._dynamic_config._runtime_pkg_mask[pkg]