summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/depgraph.py55
-rw-r--r--pym/_emerge/visible.py5
2 files changed, 53 insertions, 7 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 77248ea65..fe0276818 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -152,6 +152,7 @@ class _dynamic_depgraph_config(object):
self._pprovided_args = []
self._missing_args = []
self._masked_installed = set()
+ self._masked_license_updates = set()
self._unsatisfied_deps_for_display = []
self._unsatisfied_blockers_for_display = None
self._circular_deps_for_display = None
@@ -2773,7 +2774,9 @@ class depgraph(object):
"--nodeps" in self._frozen_config.myopts:
return True
- #if "deep" in self._dynamic_config.myparams:
+ complete = "complete" in self._dynamic_config.myparams
+ deep = "deep" in self._dynamic_config.myparams
+
if True:
# Pull in blockers from all installed packages that haven't already
# been pulled into the depgraph. This is not enabled by default
@@ -2785,6 +2788,8 @@ class depgraph(object):
vardb = self._frozen_config.trees[myroot]["vartree"].dbapi
portdb = self._frozen_config.trees[myroot]["porttree"].dbapi
pkgsettings = self._frozen_config.pkgsettings[myroot]
+ root_config = self._frozen_config.roots[myroot]
+ dbs = self._dynamic_config._filtered_trees[myroot]["dbs"]
final_db = self._dynamic_config.mydbapi[myroot]
blocker_cache = BlockerCache(myroot, vardb)
@@ -2797,10 +2802,34 @@ class depgraph(object):
# Check for masked installed packages. Only warn about
# packages that are in the graph in order to avoid warning
# about those that will be automatically uninstalled during
- # the merge process or by --depclean.
+ # the merge process or by --depclean. Always warn about
+ # packages masked by license, since the user likely wants
+ # to adjust ACCEPT_LICENSE.
if pkg in final_db:
if pkg_in_graph and not visible(pkgsettings, pkg):
self._dynamic_config._masked_installed.add(pkg)
+ elif pkgsettings._getMissingLicenses(pkg.cpv, pkg.metadata):
+ self._dynamic_config._masked_installed.add(pkg)
+ elif complete or deep:
+ # Check for upgrades in the same slot that are
+ # masked due to a LICENSE change in a newer
+ # version that is not masked for any other reason.
+ # Only do this for complete or deep graphs since
+ # otherwise it is likely a waste of time.
+ for db, pkg_type, built, installed, db_keys in dbs:
+ if installed:
+ continue
+ for upgrade_pkg in self._iter_match_pkgs(
+ root_config, pkg_type, pkg.slot_atom):
+ if upgrade_pkg <= pkg:
+ break
+ if not visible(pkgsettings,
+ upgrade_pkg, ignore=('LICENSE',)):
+ continue
+ if pkgsettings._getMissingLicenses(
+ upgrade_pkg.cpv, upgrade_pkg.metadata):
+ self._dynamic_config._masked_license_updates.add(upgrade_pkg)
+ break
blocker_atoms = None
blockers = None
@@ -4831,6 +4860,21 @@ class depgraph(object):
sys.stderr.write("".join(msg))
masked_packages = []
+ for pkg in self._dynamic_config._masked_license_updates:
+ root_config = pkg.root_config
+ pkgsettings = self._frozen_config.pkgsettings[pkg.root]
+ mreasons = get_masking_status(pkg, pkgsettings, root_config)
+ masked_packages.append((root_config, pkgsettings,
+ pkg.cpv, pkg.metadata, mreasons))
+ if masked_packages:
+ writemsg("\n" + colorize("BAD", "!!!") + \
+ " The following updates are masked by LICENSE changes:\n",
+ noiselevel=-1)
+ show_masked_packages(masked_packages)
+ show_mask_docs()
+ writemsg("\n", noiselevel=-1)
+
+ masked_packages = []
for pkg in self._dynamic_config._masked_installed:
root_config = pkg.root_config
pkgsettings = self._frozen_config.pkgsettings[pkg.root]
@@ -4838,11 +4882,12 @@ class depgraph(object):
masked_packages.append((root_config, pkgsettings,
pkg.cpv, pkg.metadata, mreasons))
if masked_packages:
- sys.stderr.write("\n" + colorize("BAD", "!!!") + \
- " The following installed packages are masked:\n")
+ writemsg("\n" + colorize("BAD", "!!!") + \
+ " The following installed packages are masked:\n",
+ noiselevel=-1)
show_masked_packages(masked_packages)
show_mask_docs()
- print()
+ writemsg("\n", noiselevel=-1)
def saveNomergeFavorites(self):
"""Find atoms in favorites that are not in the mergelist and add them
diff --git a/pym/_emerge/visible.py b/pym/_emerge/visible.py
index ee74910c2..c50768dfb 100644
--- a/pym/_emerge/visible.py
+++ b/pym/_emerge/visible.py
@@ -4,7 +4,7 @@
import portage
-def visible(pkgsettings, pkg):
+def visible(pkgsettings, pkg, ignore=None):
"""
Check if a package is visible. This can raise an InvalidDependString
exception if LICENSE is invalid.
@@ -38,7 +38,8 @@ def visible(pkgsettings, pkg):
return False
try:
if pkgsettings._getMissingLicenses(pkg.cpv, pkg.metadata):
- return False
+ if ignore is None or 'LICENSE' not in ignore:
+ return False
except portage.exception.InvalidDependString:
return False
return True