Bug #197810 - Don't automatically downgrade packages for which available
authorZac Medico <zmedico@gentoo.org>
Tue, 8 Apr 2008 20:01:38 +0000 (20:01 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 8 Apr 2008 20:01:38 +0000 (20:01 -0000)
matching versions are masked by corruption, but do automatically downgrade
installed packages that themselves have a valid mask such as from
package.mask. (trunk r9756)

svn path=/main/branches/2.1.2/; revision=9758

RELEASE-NOTES
bin/emerge

index f3fe71e790e5d9d7f48d87314c4efeded77d3b19..611d1a3788dc1015695b8e0f578437ed69921f82 100644 (file)
@@ -1,13 +1,6 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
-portage-2.1.5
-==================================
-* In the event that a previously installed package has since been masked,
-  emerge will no longer perform an automatic downgrade as part of a "world"
-  update. You should either unmask such packages or else explicitly re-merge
-  them in order to have them dowgraded to an unmasked version.
-
 portage-2.1.4.1
 ==================================
 
index d50adaf43ddb5b419a114ffaa0fd1257f0b2d7b1..e4359ad130269119e2f94555e75aefd8ea545379 100755 (executable)
@@ -1572,6 +1572,11 @@ class DepcheckCompositeDB(object):
                                        arg = None
                                if arg:
                                        ret = []
+                       if ret is None and pkg.installed and \
+                               not visible(self._depgraph.pkgsettings[pkg.root], pkg):
+                               # For disjunctive || deps, this will cause alternative
+                               # atoms or packages to be selected if available.
+                               ret = []
                        if ret is None:
                                self._cpv_tree_map[pkg.cpv] = \
                                        self._depgraph.pkg_tree_map[pkg.type_name]
@@ -2689,9 +2694,15 @@ class depgraph(object):
                                                        if not installed:
                                                                # masked by corruption
                                                                continue
-                                       if not installed:
-                                               if myarg:
-                                                       found_available_arg = True
+                                       if not installed and myarg:
+                                               found_available_arg = True
+                                       if not installed or (installed and matched_packages):
+                                               # Only enforce visibility on installed packages
+                                               # if there is at least one other visible package
+                                               # available. By filtering installed masked packages
+                                               # here, packages that have been masked since they
+                                               # were installed can be automatically downgraded
+                                               # to an unmasked version.
                                                if not visible(pkgsettings, pkg):
                                                        continue
                                        if not built and not calculated_use: