From: Fabian Groffen Date: Thu, 19 Nov 2009 20:19:48 +0000 (-0000) Subject: Merged from trunk -r14820:14845 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=166402be603c02f92f6aa3913ea47535a3343854;p=portage.git Merged from trunk -r14820:14845 | 14821 | Bug #291200 - Make --quiet-build set PORTAGE_QUIET=1, so | | zmedico | that --unmerge is quiet. | | 14822 | Bug #288083 - Always warn about installed packages masked by | | zmedico | license, since the user likely wants to adjust | | | ACCEPT_LICENSE. For updates masked by license, warn if | | | --complete-graph or --deep is given, since otherwise it is | | | likely a waste of time. | | 14823 | In the code from bug #288083, only show one LICENSE masking | | zmedico | message per slot. | | 14824 | Remove SLOT.missing since SLOT.invalid handles that case | | zmedico | now. | | 14844 | Bug #293448 - Fix TypeError when sending mail with python3, | | zmedico | triggered by this issue: http://bugs.python.org/issue6521. | | | Thanks to Albert W. Hopkins for this | | | patch. | | 14845 | Check for updates masked by license for any installed | | zmedico | packages that have been added to the graph (regardless of | | | --deep or --complete-graph).. | svn path=/main/branches/prefix/; revision=14850 --- diff --git a/bin/repoman b/bin/repoman index 8033a7679..0a858e907 100755 --- a/bin/repoman +++ b/bin/repoman @@ -281,8 +281,7 @@ qahelp={ "EAPI.definition":"EAPI is defined after an inherit call (must be defined before)", "EAPI.incompatible":"Ebuilds that use features that are only available with a different EAPI", "EAPI.unsupported":"Ebuilds that have an unsupported EAPI version (you must upgrade portage)", - "SLOT.invalid":"Ebuilds that have an invalid SLOT variable value", - "SLOT.missing":"Ebuilds that have a missing or empty SLOT variable", + "SLOT.invalid":"Ebuilds that have a missing or invalid SLOT variable value", "HOMEPAGE.missing":"Ebuilds that have a missing or empty HOMEPAGE variable", "DEPEND.bad":"User-visible ebuilds with bad DEPEND settings (matched against *visible* ebuilds)", "RDEPEND.bad":"User-visible ebuilds with bad RDEPEND settings (matched against *visible* ebuilds)", @@ -388,7 +387,7 @@ qawarnings = set(( non_ascii_re = re.compile(r'[^\x00-\x7f]') -missingvars=["KEYWORDS","LICENSE","DESCRIPTION","HOMEPAGE","SLOT"] +missingvars = ["KEYWORDS", "LICENSE", "DESCRIPTION", "HOMEPAGE"] allvars = set(x for x in portage.auxdbkeys if not x.startswith("UNUSED_")) allvars.update(Package.metadata_keys) allvars = sorted(allvars) diff --git a/man/repoman.1 b/man/repoman.1 index 5fab376b6..dd318a3f9 100644 --- a/man/repoman.1 +++ b/man/repoman.1 @@ -207,10 +207,7 @@ Syntax error in PROPERTIES (usually an extra/missing space/parenthesis) .B RESTRICT.syntax Syntax error in RESTRICT (usually an extra/missing space/parenthesis) .B SLOT.invalid -Ebuilds that have an invalid SLOT variable value -.TP -.B SLOT.missing -Ebuilds that have a missing or empty SLOT variable +Ebuilds that have a missing or invalid SLOT variable value .TP .B SRC_URI.mirror A uri listed in profiles/thirdpartymirrors is found in SRC_URI diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 6aa247c09..5f3d388ff 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -2391,7 +2391,7 @@ def adjust_config(myopts, settings): settings["EMERGE_WARNING_DELAY"] = str(EMERGE_WARNING_DELAY) settings.backup_changes("EMERGE_WARNING_DELAY") - if "--quiet" in myopts: + if "--quiet" in myopts or "--quiet-build" in myopts: settings["PORTAGE_QUIET"]="1" settings.backup_changes("PORTAGE_QUIET") diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 8b83cf724..5228e0c55 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,39 @@ 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 pkg_in_graph or 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 packages that are already in + # the graph, or complete or deep graphs, since + # otherwise it is likely a waste of time. + got_mask = False + for db, pkg_type, built, installed, db_keys in dbs: + if installed: + continue + if got_mask: + break + 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) + got_mask = True + break blocker_atoms = None blockers = None @@ -4830,6 +4864,21 @@ class depgraph(object): msg.append("package.provided entry exists.\n\n") 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 @@ -4838,11 +4887,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 3978c1714..04cfc00d8 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. @@ -44,7 +44,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 diff --git a/pym/portage/mail.py b/pym/portage/mail.py index 42ed43b83..0cc250085 100644 --- a/pym/portage/mail.py +++ b/pym/portage/mail.py @@ -23,7 +23,9 @@ if sys.hexversion >= 0x3000000: if sys.hexversion >= 0x3000000: def TextMessage(_text): - return MIMEText(_text, _charset="UTF-8") + mimetext = MIMEText(_text) + mimetext.set_charset("UTF-8") + return mimetext else: TextMessage = MIMEText