diff options
Diffstat (limited to 'pym/_emerge/depgraph.py')
-rw-r--r-- | pym/_emerge/depgraph.py | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index e94b96ce8..543f4dc78 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -4889,6 +4889,9 @@ class depgraph(object): vardb = self._frozen_config.roots[root].trees["vartree"].dbapi bindb = self._frozen_config.roots[root].trees["bintree"].dbapi dbs = self._dynamic_config._filtered_trees[root]["dbs"] + use_ebuild_visibility = self._frozen_config.myopts.get( + '--use-ebuild-visibility', 'n') != 'n' + for db, pkg_type, built, installed, db_keys in dbs: if installed: continue @@ -4975,6 +4978,7 @@ class depgraph(object): eapi=pkg.eapi): required_use_unsatisfied.append(pkg) continue + root_slot = (pkg.root, pkg.slot_atom) if pkg.built and root_slot in self._rebuild.rebuild_list: mreasons = ["need to rebuild from source"] @@ -4988,6 +4992,21 @@ class depgraph(object): self._dynamic_config.ignored_binaries.get( pkg, {}).get("changed_deps")): mreasons = ["changed deps"] + elif (pkg.built and use_ebuild_visibility and + not self._equiv_ebuild_visible(pkg)): + equiv_ebuild = self._equiv_ebuild(pkg) + if equiv_ebuild is None: + if portdb.cpv_exists(pkg.cpv): + mreasons = ["ebuild corrupt"] + else: + mreasons = ["ebuild not available"] + elif not mreasons: + mreasons = get_masking_status( + equiv_ebuild, pkgsettings, root_config, + use=self._pkg_use_enabled(equiv_ebuild)) + if mreasons: + metadata = equiv_ebuild._metadata + masked_packages.append( (root_config, pkgsettings, cpv, repo, metadata, mreasons)) @@ -5548,6 +5567,14 @@ class depgraph(object): """ return depth + n if isinstance(depth, int) else depth + def _equiv_ebuild(self, pkg): + try: + return self._pkg( + pkg.cpv, "ebuild", pkg.root_config, myrepo=pkg.repo) + except portage.exception.PackageNotFound: + return next(self._iter_match_pkgs(pkg.root_config, + "ebuild", Atom("=%s" % (pkg.cpv,))), None) + def _equiv_ebuild_visible(self, pkg, autounmask_level=None): try: pkg_eb = self._pkg( @@ -6021,11 +6048,11 @@ class depgraph(object): # reinstall the same exact version only due # to a KEYWORDS mask. See bug #252167. + identical_binary = False if pkg.type_name != "ebuild" and matched_packages: # Don't re-install a binary package that is # identical to the currently installed package # (see bug #354441). - identical_binary = False if usepkg and pkg.installed: for selected_pkg in matched_packages: if selected_pkg.type_name == "binary" and \ @@ -6035,12 +6062,13 @@ class depgraph(object): identical_binary = True break - if not identical_binary: + if not identical_binary and pkg.built: # If the ebuild no longer exists or it's # keywords have been dropped, reject built # instances (installed or binary). # If --usepkgonly is enabled, assume that - # the ebuild status should be ignored. + # the ebuild status should be ignored unless + # --use-ebuild-visibility has been specified. if not use_ebuild_visibility and (usepkgonly or useoldpkg): if pkg.installed and pkg.masks: continue |