Merged from trunk -r14820:14845
authorFabian Groffen <grobian@gentoo.org>
Thu, 19 Nov 2009 20:19:48 +0000 (20:19 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 19 Nov 2009 20:19:48 +0000 (20:19 -0000)
   | 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 <marduk@python.net> 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

bin/repoman
man/repoman.1
pym/_emerge/actions.py
pym/_emerge/depgraph.py
pym/_emerge/visible.py
pym/portage/mail.py

index 8033a76791bc6ba8661f8549ffeedda21e4fd8a8..0a858e907830b2311bffb1c35c49ad31139ea02d 100755 (executable)
@@ -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)
index 5fab376b605a63e71f7ea4b676dd48321d25b476..dd318a3f94edc564393ede96a87b4ae1b103fb1f 100644 (file)
@@ -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
index 6aa247c095691a1748f8175c5cca451db45bd3c1..5f3d388ff94d5dd38b11290be8fe6ecf506eb559 100644 (file)
@@ -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")
 
index 8b83cf7249fc3f72c4d37ad2636edae7691799fd..5228e0c55b598340fbcb0acbce54cf170953f4b9 100644 (file)
@@ -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
index 3978c171421de8e5d7602853843e8121c9fdeec0..04cfc00d8234180bcd3b7aff9b98ac506d16c3c7 100644 (file)
@@ -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
index 42ed43b83a1500a5b585faf8d46795d1d618e88b..0cc25008570fc13433ff764f23dbf4dbbe9a40e3 100644 (file)
@@ -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