* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-06-21 8:15 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-06-21 8:15 UTC (permalink / raw
To: gentoo-commits
commit: a7a196924c936b51a2aac4f3536bf056c518c270
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 08:14:47 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 08:14:47 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a7a19692
use_reduce: less strict for installed
---
pym/_emerge/resolver/circular_dependency.py | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py
index aabc174..1789801 100644
--- a/pym/_emerge/resolver/circular_dependency.py
+++ b/pym/_emerge/resolver/circular_dependency.py
@@ -174,10 +174,16 @@ class circular_dependency_handler(object):
current_use.add(flag)
else:
current_use.discard(flag)
- reduced_dep = use_reduce(dep,
- uselist=current_use, flat=True)
-
- if parent_atom not in reduced_dep:
+ try:
+ reduced_dep = use_reduce(dep,
+ uselist=current_use, flat=True)
+ except InvalidDependString:
+ if not parent.installed:
+ raise
+ reduced_dep = None
+
+ if reduced_dep is not None and \
+ parent_atom not in reduced_dep:
#We found an assignment that removes the atom from 'dep'.
#Make sure it doesn't conflict with REQUIRED_USE.
required_use = parent.metadata["REQUIRED_USE"]
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2017-10-04 0:30 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2017-10-04 0:30 UTC (permalink / raw
To: gentoo-commits
commit: 8fba660fb08ddd468d934c7478dcfc8015330e9b
Author: Daniel Robbins <drobbins <AT> funtoo <DOT> org>
AuthorDate: Tue Oct 3 20:29:44 2017 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct 4 00:26:56 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8fba660f
resolver/package_tracker: new docs
Closes: https://github.com/gentoo/portage/pull/216
pym/_emerge/resolver/package_tracker.py | 87 ++++++++++++++++++++++++++-------
1 file changed, 69 insertions(+), 18 deletions(-)
diff --git a/pym/_emerge/resolver/package_tracker.py b/pym/_emerge/resolver/package_tracker.py
index 398d4cf46..06163574e 100644
--- a/pym/_emerge/resolver/package_tracker.py
+++ b/pym/_emerge/resolver/package_tracker.py
@@ -31,38 +31,89 @@ class PackageConflict(_PackageConflict):
class PackageTracker(object):
"""
- This class tracks packages which are currently
- installed and packages which have been pulled into
- the dependency graph.
+ **Behavior**
- It automatically tracks conflicts between packages.
+ This section is intended to give you a good conceptual overview of the ``PackageTracker`` class and its general
+ behavior -- how you can expect it to behave and how in turn expects to be used successfully by the programmer.
- Possible conflicts:
- 1) Packages that share the same SLOT.
- 2) Packages with the same cpv.
- Not yet implemented:
- 3) Packages that block each other.
+ This class is used to model the behavior of a real Gentoo or other system using Portage for package management,
+ along with the installed and to-be-installed packages. The installed packages are ones that are already on the
+ system and recorded in ``/var/db/pkg``, while the to-be-installed packages are a group of packages that Portage is
+ considering installing on the system, based on the information in Portage's dependency graph. Multiple roots are
+ supported, so that situations can be modeled where ROOT is set to a non-default value (non-``/``).
+
+ You can use the add_pkg() method to add a to-be-merged package to the PackageTracker, and ``add_installed_pkg()``
+ to add an already-installed package to the package tracker. Typical use of the package tracker involves the
+ depgraph.py code populating the package tracker with calls to ``add_installed_pkg()`` to add all installed packages
+ on the system, and then it is initialized and ready for use. At that point, ``depgraph.py`` can use ``add_pkg()``
+ to add to-be-installed packages to the system.
+
+ It's worth mentioning that PackageTracker uses ``Package`` objects as arguments, and stores these objects
+ internally. There are parts of the code that ensure that a ``Package`` instance is added to the PackageTracker
+ only once.
+
+ Note that when a to-be-merged package is added to the package tracker via ``add_pkg()``, it will "cover up"
+ (replace) any installed package that shares the same root-catpkg-slot or root-catpkg-version, meaning that calling
+ the ``all_pkgs()`` or ``match()`` method will not return the installed package in the list. And the code does
+ support the scenario where ``add_installed_pkg(pkg2)`` is called *after* a call to ``add_pkg(pkg1)`` -- in this
+ case, if ``pkg1`` would 'cover up' ``pkg2``, this will be identified and handled correctly.
+
+ But the package tracker is designed to have an important behavior in this regard -- because PackageTracker has a
+ ``remove()`` method, these replaced/covered-up packages are not permanently removed -- so if you ``remove()`` a
+ to-be-installed package that was "replacing" an installed package, the installed package will "reappear". This
+ removal functionality is used by the slot conflict code in ``depgraph.py`` to modify the list of to-be-installed
+ packages as it addresses slot conflicts.
+
+ One of the main purposes of the PackageTracker is to detect conflicts between packages. Conflicts are detected
+ on to-be-installed packages only.
+
+ A slot conflict is a situation where a to-be-installed package is added to the package tracker via ``add_pkg()``,
+ and there is already a to-be-installed package added that has the same root, catpkg and slot. These cannot co-exist.
+
+ A cpv conflict is a situation where a to-be-installed package is added to the package tracker via ``add_pkg()``, and
+ there is already a to-be-installed package add that has the same root, catpkg, and version+revision. These cannot
+ co-exist.
+
+ The package tracker does not prevent slot and cpv conflicts from occurring. Instead, it allows them to be recorded
+ and the ``conflicts()`` and ``slot_conflicts()`` method will cause the package tracker to look at its internal data
+ structures and generate ``PackageConflict()`` objects for each conflict it finds.
+
+ The ``match()`` method is used extensively by ``depgraph.py`` to find packages that match a particular dependency
+ atom. The code now also supports soname dependencies.
+
+ **Future Functionality**
+
+ The package tracker may be extended in the future to track additional useful information:
+
+ * Packages that block one another. This information is not currently injected into the package tracker.
+
+ * Sub-slot conflicts. It is possible to identify situations where a to-be-installed package is in a new sub-slot.
+ In this case, the depgraph can be queried for parents of this dependency, and these parents can be scheduled
+ to be rebuilt.
+
+ :ivar _cp_pkg_map: The collection of to-be-installed (not yet merged) packages. We care about conflicts in these
+ packages.
+ :ivar _cp_vdb_pkg_map: The collection of already-installed packages.
+ :ivar _multi_pkgs: A list of keys in ``self._cp_pkg_map`` that have potential slot and cpv conflicts.
+ :ivar _replacing: The mechanism by which ``PackageTracker`` records to-be-installed packages that 'cover up'
+ already-installed packages. ``self._replacing[cp_key] = [ new_pkg_that_replaced_cp_key... ]``.
+ :ivar _replaced_by: ``self.replaced_by[cp_key] == [ replaced_pkg_1, replaced_pkg_2 ]``
"""
def __init__(self, soname_deps=False):
+
"""
- @param soname_deps: enable soname match support
- @type soname_deps: bool
+ :param soname_deps bool: Determines whether support for soname deps should be enabled or not.
"""
- # Mapping from package keys to set of packages.
+
self._cp_pkg_map = collections.defaultdict(list)
self._cp_vdb_pkg_map = collections.defaultdict(list)
- # List of package keys that may contain conflicts.
- # The insetation order must be preserved.
self._multi_pkgs = []
# Cache for result of conflicts().
self._conflicts_cache = None
- # Records for each pulled package which installed package
- # are replaced.
self._replacing = collections.defaultdict(list)
- # Records which pulled packages replace this package.
self._replaced_by = collections.defaultdict(list)
self._match_cache = collections.defaultdict(dict)
@@ -258,7 +309,7 @@ class PackageTracker(object):
Iterates over present slot conflicts.
This is only intended for consumers that haven't been
updated to deal with other kinds of conflicts.
- This funcion should be removed once all consumers are updated.
+ This function should be removed once all consumers are updated.
"""
return (conflict for conflict in self.conflicts() \
if conflict.description == "slot conflict")
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2016-12-19 5:15 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2016-12-19 5:15 UTC (permalink / raw
To: gentoo-commits
commit: ddbe020d9385f8b70e4ec6f085d3afa7271949d7
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 18 12:39:59 2016 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 19 04:53:27 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ddbe020d
slot_conflict_handler: report packages that can't be rebuilt (bug 602964)
Report packages that need to be rebuilt in order to solve slot
conflicts, but cannot be rebuilt for some reason. The following
reasons will be detected:
* matched by --exclude argument
* matched by --useoldpkg-atoms argument
* ebuild is masked or unavailable
Example output:
!!! The slot conflict(s) shown above involve package(s) which may need to
!!! be rebuilt in order to solve the conflict(s). However, the following
!!! package(s) cannot be rebuilt for the reasons shown:
(sys-apps/less-480:0/0::gentoo, installed): ebuild is masked or unavailable
X-Gentoo-bug: 602964
X-Gentoo-bug-url: https://bugs.gentoo.org/602964
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/_emerge/resolver/slot_collision.py | 37 ++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index cfb5885..f676b38 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -241,6 +241,8 @@ class slot_conflict_handler(object):
Print all slot conflicts in a human readable way.
"""
_pkg_use_enabled = self.depgraph._pkg_use_enabled
+ usepkgonly = "--usepkgonly" in self.myopts
+ need_rebuild = {}
verboseconflicts = "--verbose-conflicts" in self.myopts
any_omitted_parents = False
msg = self.conflict_msg
@@ -394,6 +396,29 @@ class slot_conflict_handler(object):
selected_for_display.update(
best_matches.values())
elif type in ("soname", "slot"):
+ # Check for packages that might need to
+ # be rebuilt, but cannot be rebuilt for
+ # some reason.
+ for ppkg, atom, other_pkg in parents:
+ if not (isinstance(ppkg, Package) and ppkg.installed):
+ continue
+ if not (atom.soname or atom.slot_operator_built):
+ continue
+ if self.depgraph._frozen_config.excluded_pkgs.findAtomForPackage(ppkg,
+ modified_use=self.depgraph._pkg_use_enabled(ppkg)):
+ selected_for_display.add((ppkg, atom))
+ need_rebuild[ppkg] = 'matched by --exclude argument'
+ elif self.depgraph._frozen_config.useoldpkg_atoms.findAtomForPackage(ppkg,
+ modified_use=self.depgraph._pkg_use_enabled(ppkg)):
+ selected_for_display.add((ppkg, atom))
+ need_rebuild[ppkg] = 'matched by --useoldpkg-atoms argument'
+ elif usepkgonly:
+ # This case is tricky, so keep quiet in order to avoid false-positives.
+ pass
+ elif not self.depgraph._equiv_ebuild_visible(ppkg):
+ selected_for_display.add((ppkg, atom))
+ need_rebuild[ppkg] = 'ebuild is masked or unavailable'
+
for ppkg, atom, other_pkg in parents:
selected_for_display.add((ppkg, atom))
if not verboseconflicts:
@@ -611,10 +636,18 @@ class slot_conflict_handler(object):
msg.append(colorize("INFORM",
"NOTE: Use the '--verbose-conflicts'"
" option to display parents omitted above"))
- msg.append("\n\n")
- else:
msg.append("\n")
+ if need_rebuild:
+ msg.append("\n!!! The slot conflict(s) shown above involve package(s) which may need to\n")
+ msg.append("!!! be rebuilt in order to solve the conflict(s). However, the following\n")
+ msg.append("!!! package(s) cannot be rebuilt for the reason(s) shown:\n\n")
+ for ppkg, reason in need_rebuild.items():
+ msg.append("%s%s: %s\n" % (indent, ppkg, reason))
+ msg.append("\n")
+
+ msg.append("\n")
+
def get_explanation(self):
msg = ""
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2016-05-27 8:33 Alexander Berntsen
0 siblings, 0 replies; 62+ messages in thread
From: Alexander Berntsen @ 2016-05-27 8:33 UTC (permalink / raw
To: gentoo-commits
commit: 40cdc1c3f467ac94d3a966777eb6a0907c269550
Author: Adam Mills <adam <AT> armills <DOT> info>
AuthorDate: Wed May 25 16:12:57 2016 +0000
Commit: Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Fri May 27 08:23:14 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=40cdc1c3
Colorize packages in world_sets (bug 583164)
Packages belonging to a set listed in world_sets will now be colorized
as a world package.
X-Gentoo-bug: 583164
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=583164
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
pym/_emerge/resolver/output.py | 2 +-
pym/_emerge/resolver/output_helpers.py | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 400617d..ac979f6 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -707,7 +707,7 @@ class Display(object):
"""
root_config = self.conf.roots[pkg.root]
system_set = root_config.sets["system"]
- world_set = root_config.sets["selected"]
+ world_set = self.conf.selected_sets[pkg.root]
system = False
world = False
try:
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index 70f7bc0..b83717e 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -17,6 +17,7 @@ import sys
from portage import os
from portage import _encodings, _unicode_encode
from portage._sets.base import InternalPackageSet
+from portage.exception import PackageSetNotFound
from portage.localization import localized_size
from portage.output import (blue, bold, colorize, create_color_func,
green, red, teal, turquoise, yellow)
@@ -213,6 +214,16 @@ class _DisplayConfig(object):
self.running_root = frozen_config._running_root
self.roots = frozen_config.roots
+ # Create a set of selected packages for each root
+ self.selected_sets = {}
+ for root_name, root in self.roots.items():
+ try:
+ self.selected_sets[root_name] = InternalPackageSet(
+ initial_atoms=root.setconfig.getSetAtoms("selected"))
+ except PackageSetNotFound:
+ # A nested set could not be resolved, so ignore nested sets.
+ self.selected_sets[root_name] = root.sets["selected"]
+
self.blocker_parents = dynamic_config._blocker_parents
self.reinstall_nodes = dynamic_config._reinstall_nodes
self.digraph = dynamic_config.digraph
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2015-08-03 18:36 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2015-08-03 18:36 UTC (permalink / raw
To: gentoo-commits
commit: 024e2a5779e92fffbd0a0d30c8cff725c4552626
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 3 06:17:26 2015 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 3 18:35:04 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=024e2a57
circular_dependency_handler: limit USE combination search (bug 555698)
Limit the number of USE combinations searched to 1024 = 2 ** 10, where
10 is a constant named MAX_AFFECTING_USE, in order to avoid consuming
unreasonable amounts of time. First, discard irrelevent flags that are
not enabled. Since extract_affecting_use doesn't distinguish between
positive and negative effects (flag? vs. !flag?), assume a positive
relationship. If there are still too many combinations,then don't
bother to explore any of them.
X-Gentoo-Bug: 555698
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=555698
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/_emerge/resolver/circular_dependency.py | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py
index b710671..5c11956 100644
--- a/pym/_emerge/resolver/circular_dependency.py
+++ b/pym/_emerge/resolver/circular_dependency.py
@@ -14,7 +14,9 @@ from _emerge.DepPrioritySatisfiedRange import DepPrioritySatisfiedRange
from _emerge.Package import Package
class circular_dependency_handler(object):
-
+
+ MAX_AFFECTING_USE = 10
+
def __init__(self, depgraph, graph):
self.depgraph = depgraph
self.graph = graph
@@ -156,7 +158,7 @@ class circular_dependency_handler(object):
total_flags = set()
total_flags.update(affecting_use, required_use_flags)
total_flags.difference_update(untouchable_flags)
- if len(total_flags) <= 10:
+ if len(total_flags) <= self.MAX_AFFECTING_USE:
affecting_use = total_flags
affecting_use = tuple(affecting_use)
@@ -164,6 +166,21 @@ class circular_dependency_handler(object):
if not affecting_use:
continue
+ if len(affecting_use) > self.MAX_AFFECTING_USE:
+ # Limit the number of combinations explored (bug #555698).
+ # First, discard irrelevent flags that are not enabled.
+ # Since extract_affecting_use doesn't distinguish between
+ # positive and negative effects (flag? vs. !flag?), assume
+ # a positive relationship.
+ current_use = self.depgraph._pkg_use_enabled(parent)
+ affecting_use = tuple(flag for flag in affecting_use
+ if flag in current_use)
+
+ if len(affecting_use) > self.MAX_AFFECTING_USE:
+ # There are too many USE combinations to explore in
+ # a reasonable amount of time.
+ continue
+
#We iterate over all possible settings of these use flags and gather
#a set of possible changes
#TODO: Use the information encoded in REQUIRED_USE
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2015-07-29 18:44 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2015-07-29 18:44 UTC (permalink / raw
To: gentoo-commits
commit: 44971d397c63e16b134d9b93b06ce3b8db768aca
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 29 05:18:30 2015 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jul 29 18:43:21 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=44971d39
slot_conflict_handler: suggest --verbose-conflicts (bug 556172)
A suggestion to use --verbose-conflicts is now shown when relevant:
!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:
dev-libs/icu:0
(dev-libs/icu-54.1-r1:0/54a::gentoo, ebuild scheduled for merge) pulled in by
<dev-libs/icu-55.1 (Argument)
(dev-libs/icu-55.1:0/55::gentoo, installed) pulled in by
dev-libs/icu:0/55 required by (app-office/libreoffice-bin-4.4.3.2:0/0::gentoo, installed)
^^^^^
>=dev-libs/icu-51.2-r1:0/55=[abi_x86_32(-),abi_x86_64(-)] required by (dev-libs/libxml2-2.9.2-r1:2/2::gentoo, installed)
^^^^^^
(and 19 more with the same problems)
NOTE: Use the '--verbose-conflicts' option to display parents omitted above
X-Gentoo-Bug: 556172
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=556172
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>
pym/_emerge/resolver/slot_collision.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index 5473d72..cfb5885 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -242,6 +242,7 @@ class slot_conflict_handler(object):
"""
_pkg_use_enabled = self.depgraph._pkg_use_enabled
verboseconflicts = "--verbose-conflicts" in self.myopts
+ any_omitted_parents = False
msg = self.conflict_msg
indent = " "
msg.append("\n!!! Multiple package instances within a single " + \
@@ -596,6 +597,7 @@ class slot_conflict_handler(object):
omitted_parents = num_all_specific_atoms - len(selected_for_display)
if omitted_parents:
+ any_omitted_parents = True
msg.append(2*indent)
if len(selected_for_display) > 1:
msg.append("(and %d more with the same problems)\n" % omitted_parents)
@@ -604,7 +606,14 @@ class slot_conflict_handler(object):
else:
msg.append(" (no parents)\n")
msg.append("\n")
- msg.append("\n")
+
+ if any_omitted_parents:
+ msg.append(colorize("INFORM",
+ "NOTE: Use the '--verbose-conflicts'"
+ " option to display parents omitted above"))
+ msg.append("\n\n")
+ else:
+ msg.append("\n")
def get_explanation(self):
msg = ""
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2014-12-13 14:51 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 62+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-12-13 14:51 UTC (permalink / raw
To: gentoo-commits
commit: c2577dc8d625fae4a573b2d89a58951498fbd0f6
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Dec 13 14:49:39 2014 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sat Dec 13 14:49:39 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c2577dc8
emerge --verbose --quiet-repo-display: Delete deprecated code.
Use portage.repository.config.RepoConfigLoader.__iter__() instead of deprecated
PORTDIR and PORTDIR_OVERLAY.
1 call to deprecated portage.repository.config.RepoConfigLoader.mainRepoLocation()
function has been deleted.
---
pym/_emerge/resolver/output_helpers.py | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index eb8d97d..70f7bc0 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -21,7 +21,7 @@ from portage.localization import localized_size
from portage.output import (blue, bold, colorize, create_color_func,
green, red, teal, turquoise, yellow)
bad = create_color_func("BAD")
-from portage.util import shlex_split, writemsg
+from portage.util import writemsg
from portage.util.SlotObject import SlotObject
from portage.versions import catpkgsplit
@@ -39,24 +39,13 @@ class _RepoDisplay(object):
self._unknown_repo = False
repo_paths = set()
for root_config in roots.values():
- portdir = root_config.settings.get("PORTDIR")
- if portdir:
- repo_paths.add(portdir)
- overlays = root_config.settings.get("PORTDIR_OVERLAY")
- if overlays:
- repo_paths.update(shlex_split(overlays))
+ for repo in root_config.settings.repositories:
+ repo_paths.add(repo.location)
repo_paths = list(repo_paths)
self._repo_paths = repo_paths
self._repo_paths_real = [ os.path.realpath(repo_path) \
for repo_path in repo_paths ]
- # pre-allocate index for PORTDIR so that it always has index 0.
- for root_config in roots.values():
- portdb = root_config.trees["porttree"].dbapi
- portdir = portdb.repositories.mainRepoLocation()
- if portdir:
- self.repoStr(portdir)
-
def repoStr(self, repo_path_real):
real_index = -1
if repo_path_real:
@@ -80,7 +69,7 @@ class _RepoDisplay(object):
shown_repos = self._shown_repos
unknown_repo = self._unknown_repo
if shown_repos or self._unknown_repo:
- output.append("Portage tree and overlays:\n")
+ output.append("Repositories:\n")
show_repo_paths = list(shown_repos)
for repo_path, repo_index in shown_repos.items():
show_repo_paths[repo_index] = repo_path
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2014-08-23 7:21 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2014-08-23 7:21 UTC (permalink / raw
To: gentoo-commits
commit: 5c0f68017e9943f9486ee68005ea3ef7743244bd
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 22 22:32:18 2014 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 23 06:14:38 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5c0f6801
package_tracker.match: account for unevaluated_atom
This fixes the match cache to properly account for
atom.unevaluated_atom, which is required since match_from_list output
depends on atom.unevaluated_atom (for IUSE matching logic). Note that
similar issues were also fixed in commits
d603f1440c814377fbc1965729fd9b6b008cf76d and
5438bb29c996d777b6343515995176912a7c137f.
X-Gentoo-Bug: 515230
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=515230
---
pym/_emerge/resolver/package_tracker.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pym/_emerge/resolver/package_tracker.py b/pym/_emerge/resolver/package_tracker.py
index 5982750..406d5ce 100644
--- a/pym/_emerge/resolver/package_tracker.py
+++ b/pym/_emerge/resolver/package_tracker.py
@@ -152,7 +152,7 @@ class PackageTracker(object):
packages may also be returned.
"""
cp_key = root, atom.cp
- cache_key = root, atom, installed
+ cache_key = root, atom, atom.unevaluated_atom, installed
try:
return iter(self._match_cache.get(cp_key, {})[cache_key])
except KeyError:
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2014-02-23 21:38 Sebastian Luther
0 siblings, 0 replies; 62+ messages in thread
From: Sebastian Luther @ 2014-02-23 21:38 UTC (permalink / raw
To: gentoo-commits
commit: 8faaef43372b3a464a281b8e28314934ccc31866
Author: Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Sun Feb 23 21:33:54 2014 +0000
Commit: Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Sun Feb 23 21:37:27 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8faaef43
slot collision output: fix indent
---
pym/_emerge/resolver/slot_collision.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index c5936ad..baeab08 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -537,6 +537,7 @@ class slot_conflict_handler(object):
# redundant to display the atom attribute.
msg.append("%s\n" % (parent,))
elif isinstance(parent, AtomArg):
+ msg.append(2*indent)
msg.append("%s (Argument)\n" % (atom,))
else:
# Display the specific atom from SetArg or
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2014-02-05 19:42 Sebastian Luther
0 siblings, 0 replies; 62+ messages in thread
From: Sebastian Luther @ 2014-02-05 19:42 UTC (permalink / raw
To: gentoo-commits
commit: f9473424cb810bc946ff5a63fcce1e9ebfa86bf9
Author: Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Jan 27 23:00:49 2014 +0000
Commit: Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Wed Feb 5 19:39:21 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f9473424
Some small output fixes for the slot conflict handler
* unmatched atom printing now uses ^^ markers
* unmatched atom printing properly supports sub-slots
* Fix spurious "no parents" message caused by AtomArg parents
---
pym/_emerge/resolver/slot_collision.py | 119 ++++++++++++++++++++++++++-------
1 file changed, 96 insertions(+), 23 deletions(-)
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index ca3fb74..c5936ad 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function, unicode_literals
@@ -273,12 +273,14 @@ class slot_conflict_handler(object):
for ppkg, atom in parent_atoms:
atom_set = InternalPackageSet(initial_atoms=(atom,))
atom_without_use_set = InternalPackageSet(initial_atoms=(atom.without_use,))
+ atom_without_use_and_slot_set = InternalPackageSet(initial_atoms=(
+ atom.without_use.without_slot,))
for other_pkg in pkgs:
if other_pkg == pkg:
continue
- if not atom_without_use_set.findAtomForPackage(other_pkg, \
+ if not atom_without_use_and_slot_set.findAtomForPackage(other_pkg, \
modified_use=_pkg_use_enabled(other_pkg)):
if atom.operator is not None:
# The version range does not match.
@@ -295,9 +297,11 @@ class slot_conflict_handler(object):
atoms.add((ppkg, atom, other_pkg))
num_all_specific_atoms += 1
collision_reasons[key] = atoms
- else:
- # The sub_slot does not match.
- key = ("sub-slot", atom.sub_slot)
+
+ elif not atom_without_use_set.findAtomForPackage(other_pkg, \
+ modified_use=_pkg_use_enabled(other_pkg)):
+ # The slot and/or sub_slot does not match.
+ key = ("slot", (atom.slot, atom.sub_slot, atom.slot_operator))
atoms = collision_reasons.get(key, set())
atoms.add((ppkg, atom, other_pkg))
num_all_specific_atoms += 1
@@ -342,6 +346,11 @@ class slot_conflict_handler(object):
atoms.add((ppkg, atom, other_pkg))
collision_reasons[("use", flag)] = atoms
num_all_specific_atoms += 1
+ elif isinstance(ppkg, AtomArg) and other_pkg.installed:
+ parent_atoms = collision_reasons.get(("AtomArg", None), set())
+ parent_atoms.add((ppkg, atom))
+ collision_reasons[("AtomArg", None)] = parent_atoms
+ num_all_specific_atoms += 1
msg.append(" pulled in by\n")
@@ -372,9 +381,11 @@ class slot_conflict_handler(object):
if not verboseconflicts:
selected_for_display.update(
best_matches.values())
- elif type == "sub-slot":
+ elif type == "slot":
for ppkg, atom, other_pkg in parents:
selected_for_display.add((ppkg, atom))
+ if not verboseconflicts:
+ break
elif type == "use":
#Prefer atoms with unconditional use deps over, because it's
#not possible to change them on the parent, which means there
@@ -416,21 +427,50 @@ class slot_conflict_handler(object):
# If the list is long, people can simply
# use a pager.
selected_for_display.add((ppkg, atom))
+ elif type == "AtomArg":
+ for ppkg, atom in parents:
+ selected_for_display.add((ppkg, atom))
- def highlight_violations(atom, version, use=[]):
+ def highlight_violations(atom, version, use, slot_violated):
"""Colorize parts of an atom"""
atom_str = "%s" % (atom,)
+ colored_idx = set()
if version:
op = atom.operator
ver = None
if atom.cp != atom.cpv:
ver = cpv_getversion(atom.cpv)
slot = atom.slot
+ sub_slot = atom.sub_slot
+ slot_operator = atom.slot_operator
if op == "=*":
op = "="
ver += "*"
+ slot_str = ""
+ if slot:
+ slot_str = ":" + slot
+ if sub_slot:
+ slot_str += "/" + sub_slot
+ if slot_operator:
+ slot_str += slot_operator
+
+ # Compute color_idx before adding the color codes
+ # as these change the indices of the letters.
+ if op is not None:
+ colored_idx.update(range(len(op)))
+
+ if ver is not None:
+ start = atom_str.rfind(ver)
+ end = start + len(ver)
+ colored_idx.update(range(start, end))
+
+ if slot_str:
+ ii = atom_str.find(slot_str)
+ colored_idx.update(range(ii, ii + len(slot_str)))
+
+
if op is not None:
atom_str = atom_str.replace(op, colorize("BAD", op), 1)
@@ -440,25 +480,48 @@ class slot_conflict_handler(object):
atom_str = atom_str[:start] + \
colorize("BAD", ver) + \
atom_str[end:]
+
+ if slot_str:
+ atom_str = atom_str.replace(slot_str, colorize("BAD", slot_str), 1)
+
+ elif slot_violated:
+ slot = atom.slot
+ sub_slot = atom.sub_slot
+ slot_operator = atom.slot_operator
+
+ slot_str = ""
if slot:
- atom_str = atom_str.replace(":" + slot, colorize("BAD", ":" + slot))
+ slot_str = ":" + slot
+ if sub_slot:
+ slot_str += "/" + sub_slot
+ if slot_operator:
+ slot_str += slot_operator
+
+ if slot_str:
+ ii = atom_str.find(slot_str)
+ colored_idx.update(range(ii, ii + len(slot_str)))
+ atom_str = atom_str.replace(slot_str, colorize("BAD", slot_str), 1)
if use and atom.use.tokens:
use_part_start = atom_str.find("[")
use_part_end = atom_str.find("]")
new_tokens = []
+ # Compute start index in non-colored atom.
+ ii = str(atom).find("[") + 1
for token in atom.use.tokens:
if token.lstrip("-!").rstrip("=?") in use:
new_tokens.append(colorize("BAD", token))
+ colored_idx.update(range(ii, ii + len(token)))
else:
new_tokens.append(token)
+ ii += 1 + len(token)
atom_str = atom_str[:use_part_start] \
+ "[%s]" % (",".join(new_tokens),) + \
atom_str[use_part_end+1:]
- return atom_str
+ return atom_str, colored_idx
# Show unconditional use deps first, since those
# are more problematic than the conditional kind.
@@ -469,37 +532,48 @@ class slot_conflict_handler(object):
ordered_list.append(parent_atom)
for parent_atom in ordered_list:
parent, atom = parent_atom
- msg.append(2*indent)
- if isinstance(parent,
- (PackageArg, AtomArg)):
- # For PackageArg and AtomArg types, it's
+ if isinstance(parent, PackageArg):
+ # For PackageArg it's
# redundant to display the atom attribute.
- msg.append("%s" % (parent,))
+ msg.append("%s\n" % (parent,))
+ elif isinstance(parent, AtomArg):
+ msg.append("%s (Argument)\n" % (atom,))
else:
# Display the specific atom from SetArg or
# Package types.
version_violated = False
- sub_slot_violated = False
+ slot_violated = False
use = []
for (type, sub_type), parents in collision_reasons.items():
for x in parents:
if parent == x[0] and atom == x[1]:
if type == "version":
version_violated = True
- elif type == "sub-slot":
- sub_slot_violated = True
+ elif type == "slot":
+ slot_violated = True
elif type == "use":
use.append(sub_type)
break
- atom_str = highlight_violations(atom.unevaluated_atom, version_violated, use)
+ atom_str, colored_idx = highlight_violations(atom.unevaluated_atom,
+ version_violated, use, slot_violated)
- if version_violated or sub_slot_violated:
+ if version_violated or slot_violated:
self.is_a_version_conflict = True
- msg.append("%s required by %s" % (atom_str, parent))
- msg.append("\n")
-
+ cur_line = "%s required by %s\n" % (atom_str, parent)
+ marker_line = ""
+ for ii in range(len(cur_line)):
+ if ii in colored_idx:
+ marker_line += "^"
+ else:
+ marker_line += " "
+ marker_line += "\n"
+ msg.append(2*indent)
+ msg.append(cur_line)
+ msg.append(2*indent)
+ msg.append(marker_line)
+
if not selected_for_display:
msg.append(2*indent)
msg.append("(no parents that aren't satisfied by other packages in this slot)\n")
@@ -519,7 +593,6 @@ class slot_conflict_handler(object):
def get_explanation(self):
msg = ""
- _pkg_use_enabled = self.depgraph._pkg_use_enabled
if self.is_a_version_conflict:
return None
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2014-02-05 19:42 Sebastian Luther
0 siblings, 0 replies; 62+ messages in thread
From: Sebastian Luther @ 2014-02-05 19:42 UTC (permalink / raw
To: gentoo-commits
commit: c0051a11f714c49defbd63d82a507e592937f29f
Author: Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Jan 27 22:16:20 2014 +0000
Commit: Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Wed Feb 5 19:39:21 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c0051a11
format_unmatched_atom: Pretty printing for unmatched atoms
This is a split out from the slot conflict handler to be
used in other places.
---
pym/_emerge/resolver/output.py | 109 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 106 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 3e8552f..5f550be 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
"""Resolver output display operation.
@@ -7,7 +7,7 @@
from __future__ import unicode_literals
__all__ = (
- "Display",
+ "Display", "format_unmatched_atom",
)
import sys
@@ -23,8 +23,9 @@ from portage.package.ebuild._spawn_nofetch import spawn_nofetch
from portage.output import ( blue, colorize, create_color_func,
darkblue, darkgreen, green, nc_len, teal)
bad = create_color_func("BAD")
+from portage._sets.base import InternalPackageSet
from portage.util import writemsg_stdout
-from portage.versions import best
+from portage.versions import best, cpv_getversion
from _emerge.Blocker import Blocker
from _emerge.create_world_atom import create_world_atom
@@ -916,3 +917,105 @@ class Display(object):
self.print_changelog()
return os.EX_OK
+
+
+def format_unmatched_atom(pkg, atom, pkg_use_enabled):
+ """
+ Returns two strings. The first string contains the
+ 'atom' with parts of the atom colored, which 'pkg'
+ doesn't match. The second string has the same number
+ of characters as the first one, but consists of only
+ white space or ^. The ^ characters have the same position
+ as the colored parts of the first string.
+ """
+ # Things to check:
+ # 1. Version
+ # 2. cp
+ # 3. slot/sub_slot
+ # 4. repository
+ # 5. USE
+
+ highlight = set()
+
+ def perform_coloring():
+ atom_str = ""
+ marker_str = ""
+ for ii, x in enumerate(atom):
+ if ii in highlight:
+ atom_str += colorize("BAD", x)
+ marker_str += "^"
+ else:
+ atom_str += x
+ marker_str += " "
+ return atom_str, marker_str
+
+ if atom.cp != pkg.cp:
+ # Highlight the cp part only.
+ ii = atom.find(atom.cp)
+ highlight.update(range(ii, ii + len(atom.cp)))
+ return perform_coloring()
+
+ version_atom = atom.without_repo.without_slot.without_use
+ version_atom_set = InternalPackageSet(initial_atoms=(version_atom,))
+ highlight_version = not bool(version_atom_set.findAtomForPackage(pkg,
+ modified_use=pkg_use_enabled(pkg)))
+
+ highlight_slot = False
+ if (atom.slot and atom.slot != pkg.slot) or \
+ (atom.sub_slot and atom.sub_slot != pkg.sub_slot):
+ highlight_slot = True
+
+ if highlight_version:
+ op = atom.operator
+ ver = None
+ if atom.cp != atom.cpv:
+ ver = cpv_getversion(atom.cpv)
+
+ if op == "=*":
+ op = "="
+ ver += "*"
+
+ if op is not None:
+ highlight.update(range(len(op)))
+
+ if ver is not None:
+ start = atom.rfind(ver)
+ end = start + len(ver)
+ highlight.update(range(start, end))
+
+ if highlight_slot:
+ slot_str = ":" + atom.slot
+ if atom.sub_slot:
+ slot_str += "/" + atom.sub_slot
+ if atom.slot_operator:
+ slot_str += atom.slot_operator
+ start = atom.find(slot_str)
+ end = start + len(slot_str)
+ highlight.update(range(start, end))
+
+ highlight_use = set()
+ if atom.use:
+ use_atom = "%s[%s]" % (atom.cp, str(atom.use))
+ use_atom_set = InternalPackageSet(initial_atoms=(use_atom,))
+ if not use_atom_set.findAtomForPackage(pkg, \
+ modified_use=pkg_use_enabled(pkg)):
+ missing_iuse = pkg.iuse.get_missing_iuse(
+ atom.unevaluated_atom.use.required)
+ if missing_iuse:
+ highlight_use = set(missing_iuse)
+ else:
+ #Use conditionals not met.
+ violated_atom = atom.violated_conditionals(
+ pkg_use_enabled(pkg), pkg.iuse.is_valid_flag)
+ if violated_atom.use is not None:
+ highlight_use = set(violated_atom.use.enabled.union(
+ violated_atom.use.disabled))
+
+ if highlight_use:
+ ii = atom.find("[") + 1
+ for token in atom.use.tokens:
+ if token.lstrip("-!").rstrip("=?") in highlight_use:
+ highlight.update(range(ii, ii + len(token)))
+ ii += len(token) + 1
+
+ return perform_coloring()
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2013-03-20 20:32 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2013-03-20 20:32 UTC (permalink / raw
To: gentoo-commits
commit: 77df7ad2311f8d30533b89d4560651f3eac72cef
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 20 20:32:27 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 20:32:27 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=77df7ad2
Fix --verbose-main-repo-display missing PORTDIR.
---
pym/_emerge/resolver/output.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index a14478e..3e8552f 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -385,7 +385,8 @@ class Display(object):
if old_pkg.slot != old_pkg.sub_slot or \
old_pkg.slot == pkg.slot and old_pkg.sub_slot != pkg.sub_slot:
key += "/" + old_pkg.sub_slot
- if not self.quiet_repo_display and self.portdb.repositories.mainRepo() and (self.verbose_main_repo_display or
+ if not self.quiet_repo_display and (self.verbose_main_repo_display or
+ self.portdb.repositories.mainRepo() is None or
any(x.repo != self.portdb.repositories.mainRepo().name for x in myoldbest + [pkg])):
key += _repo_separator + old_pkg.repo
versions.append(key)
@@ -419,7 +420,8 @@ class Display(object):
@param pkg_info: dictionary
@rtype string
"""
- if not self.quiet_repo_display and self.portdb.repositories.mainRepo() and (self.verbose_main_repo_display or
+ if not self.quiet_repo_display and (self.verbose_main_repo_display or
+ self.portdb.repositories.mainRepo() is None or
any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
pkg_str += _repo_separator + pkg.repo
return pkg_str
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2013-03-20 19:23 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2013-03-20 19:23 UTC (permalink / raw
To: gentoo-commits
commit: 35798ff1b1b6b5c0de4141b5440b0fe0bd750da8
Author: Brandon Philips <brandon <AT> ifup <DOT> co>
AuthorDate: Wed Mar 20 18:13:53 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 19:23:10 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=35798ff1
resolver: output: check for None mainRepo()
mainRepo() can return none when we are on a machine that is only using
PORTAGE_BINHOST and not a normal PORTAGE. Make sure we don't crash here.
---
pym/_emerge/resolver/output.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 46a13bf..a14478e 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -385,7 +385,7 @@ class Display(object):
if old_pkg.slot != old_pkg.sub_slot or \
old_pkg.slot == pkg.slot and old_pkg.sub_slot != pkg.sub_slot:
key += "/" + old_pkg.sub_slot
- if not self.quiet_repo_display and (self.verbose_main_repo_display or
+ if not self.quiet_repo_display and self.portdb.repositories.mainRepo() and (self.verbose_main_repo_display or
any(x.repo != self.portdb.repositories.mainRepo().name for x in myoldbest + [pkg])):
key += _repo_separator + old_pkg.repo
versions.append(key)
@@ -419,7 +419,7 @@ class Display(object):
@param pkg_info: dictionary
@rtype string
"""
- if not self.quiet_repo_display and (self.verbose_main_repo_display or
+ if not self.quiet_repo_display and self.portdb.repositories.mainRepo() and (self.verbose_main_repo_display or
any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
pkg_str += _repo_separator + pkg.repo
return pkg_str
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2013-03-18 21:28 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2013-03-18 21:28 UTC (permalink / raw
To: gentoo-commits
commit: a95dc1d79de9560833df93d46918446a7f10367c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 21:27:57 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 21:27:57 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a95dc1d7
Display._blockers(): distinguish hard blocking
---
pym/_emerge/resolver/output.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 93a896d..46a13bf 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -100,13 +100,18 @@ class Display(object):
block_parents = self.conf.blocker_parents.parent_nodes(blocker)
block_parents = set(_unicode(pnode.cpv) for pnode in block_parents)
block_parents = ", ".join(block_parents)
+ if blocker.atom.blocker.overlap.forbid:
+ blocking_desc = "hard blocking"
+ else:
+ blocking_desc = "blocking"
if self.resolved != blocker.atom:
addl += colorize(self.blocker_style,
- " (\"%s\" is blocking %s)") % \
- (_unicode(blocker.atom).lstrip("!"), block_parents)
+ " (\"%s\" is %s %s)" %
+ (_unicode(blocker.atom).lstrip("!"),
+ blocking_desc, block_parents))
else:
addl += colorize(self.blocker_style,
- " (is blocking %s)") % block_parents
+ " (is %s %s)" % (blocking_desc, block_parents))
if blocker.satisfied:
if not self.conf.columns:
self.print_msg.append(addl)
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2013-03-18 21:12 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2013-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: 10eaee904811c2037a9380446f92f7677ed2ada9
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 21:12:26 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 21:12:26 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=10eaee90
resolver/output: rename Display._blockers() param
---
pym/_emerge/resolver/output.py | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 8072c1f..93a896d 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -69,16 +69,16 @@ class Display(object):
self.blocker_style = None
- def _blockers(self, pkg):
- """Processes pkg for blockers and adds colorized strings to
+ def _blockers(self, blocker):
+ """Adds colorized strings to
self.print_msg and self.blockers
- @param pkg: _emerge.Package.Package instance
+ @param blocker: _emerge.Blocker.Blocker instance
@rtype: bool
Modifies class globals: self.blocker_style, self.resolved,
self.print_msg
"""
- if pkg.satisfied:
+ if blocker.satisfied:
self.blocker_style = "PKG_BLOCKER_SATISFIED"
addl = "%s " % (colorize(self.blocker_style, "b"),)
else:
@@ -86,7 +86,7 @@ class Display(object):
addl = "%s " % (colorize(self.blocker_style, "B"),)
addl += self.empty_space_in_brackets()
self.resolved = dep_expand(
- _unicode(pkg.atom).lstrip("!"), mydb=self.vardb,
+ _unicode(blocker.atom).lstrip("!"), mydb=self.vardb,
settings=self.pkgsettings
)
if self.conf.columns and self.conf.quiet:
@@ -97,17 +97,17 @@ class Display(object):
addl, self.indent,
colorize(self.blocker_style, _unicode(self.resolved))
)
- block_parents = self.conf.blocker_parents.parent_nodes(pkg)
- block_parents = set([pnode[2] for pnode in block_parents])
+ block_parents = self.conf.blocker_parents.parent_nodes(blocker)
+ block_parents = set(_unicode(pnode.cpv) for pnode in block_parents)
block_parents = ", ".join(block_parents)
- if self.resolved != pkg[2]:
+ if self.resolved != blocker.atom:
addl += colorize(self.blocker_style,
" (\"%s\" is blocking %s)") % \
- (_unicode(pkg.atom).lstrip("!"), block_parents)
+ (_unicode(blocker.atom).lstrip("!"), block_parents)
else:
addl += colorize(self.blocker_style,
" (is blocking %s)") % block_parents
- if isinstance(pkg, Blocker) and pkg.satisfied:
+ if blocker.satisfied:
if not self.conf.columns:
self.print_msg.append(addl)
else:
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2013-03-18 20:58 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2013-03-18 20:58 UTC (permalink / raw
To: gentoo-commits
commit: 9c7dfbe244da364b07e8556580716155d3bd6a97
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 20:57:50 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 20:57:50 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9c7dfbe2
resolver/output: unicode(), not str() for python2
---
pym/_emerge/resolver/output.py | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 9e383e2..8072c1f 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -34,7 +34,9 @@ from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice
if sys.hexversion >= 0x3000000:
basestring = str
-
+ _unicode = str
+else:
+ _unicode = unicode
class Display(object):
"""Formats and outputs the depgrah supplied it for merge/re-merge, etc.
@@ -84,16 +86,16 @@ class Display(object):
addl = "%s " % (colorize(self.blocker_style, "B"),)
addl += self.empty_space_in_brackets()
self.resolved = dep_expand(
- str(pkg.atom).lstrip("!"), mydb=self.vardb,
+ _unicode(pkg.atom).lstrip("!"), mydb=self.vardb,
settings=self.pkgsettings
)
if self.conf.columns and self.conf.quiet:
- addl += " " + colorize(self.blocker_style, str(self.resolved))
+ addl += " " + colorize(self.blocker_style, _unicode(self.resolved))
else:
addl = "[%s %s] %s%s" % \
(colorize(self.blocker_style, "blocks"),
addl, self.indent,
- colorize(self.blocker_style, str(self.resolved))
+ colorize(self.blocker_style, _unicode(self.resolved))
)
block_parents = self.conf.blocker_parents.parent_nodes(pkg)
block_parents = set([pnode[2] for pnode in block_parents])
@@ -101,7 +103,7 @@ class Display(object):
if self.resolved != pkg[2]:
addl += colorize(self.blocker_style,
" (\"%s\" is blocking %s)") % \
- (str(pkg.atom).lstrip("!"), block_parents)
+ (_unicode(pkg.atom).lstrip("!"), block_parents)
else:
addl += colorize(self.blocker_style,
" (is blocking %s)") % block_parents
@@ -308,7 +310,7 @@ class Display(object):
depstr, = db.aux_get(pkg.cpv,
["SRC_URI"], myrepo=pkg.repo)
show_invalid_depstring_notice(
- pkg, depstr, str(e))
+ pkg, depstr, _unicode(e))
raise
except SignatureException:
# missing/invalid binary package SIZE signature
@@ -429,7 +431,7 @@ class Display(object):
ver_str = self._append_slot(ver_str, pkg, pkg_info)
ver_str = self._append_repository(ver_str, pkg, pkg_info)
if self.conf.quiet:
- myprint = str(pkg_info.attr_display) + " " + self.indent + \
+ myprint = _unicode(pkg_info.attr_display) + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
myprint = myprint+darkblue(" "+ver_str)+" "
myprint = myprint+pkg_info.oldbest
@@ -468,7 +470,7 @@ class Display(object):
ver_str = self._append_slot(ver_str, pkg, pkg_info)
ver_str = self._append_repository(ver_str, pkg, pkg_info)
if self.conf.quiet:
- myprint = str(pkg_info.attr_display) + " " + self.indent + \
+ myprint = _unicode(pkg_info.attr_display) + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
myprint = myprint+" "+green(ver_str)+" "
myprint = myprint+pkg_info.oldbest
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2013-02-28 0:25 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2013-02-28 0:25 UTC (permalink / raw
To: gentoo-commits
commit: 3507aa783cdf93fd28a58fb32df2fe7e03c46330
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 28 00:24:54 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 28 00:24:54 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3507aa78
_display_use: use local variables
---
pym/_emerge/resolver/output.py | 35 +++++++++++++++--------------------
1 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 1ebb248..9e383e2 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -58,11 +58,6 @@ class Display(object):
self.oldlp = None
self.myfetchlist = None
self.indent = ''
- self.is_new = True
- self.cur_use = None
- self.cur_iuse = None
- self.old_use = ''
- self.old_iuse = ''
self.use_expand = None
self.use_expand_hidden = None
self.pkgsettings = None
@@ -185,28 +180,28 @@ class Display(object):
@param pkg: _emerge.Package.Package instance
@param pkg_info: PkgInfo instance
Modifies self.use_expand_hidden, self.use_expand, self.verboseadd,
- self.forced_flags, self.cur_iuse, self.old_iuse, self.old_use
+ self.forced_flags
"""
self.forced_flags = set()
self.forced_flags.update(pkg.use.force)
self.forced_flags.update(pkg.use.mask)
- self.cur_use = [flag for flag in self.conf.pkg_use_enabled(pkg) \
+ cur_use = [flag for flag in self.conf.pkg_use_enabled(pkg) \
if flag in pkg.iuse.all]
- self.cur_iuse = sorted(pkg.iuse.all)
+ cur_iuse = sorted(pkg.iuse.all)
if pkg_info.previous_pkg is not None:
previous_pkg = pkg_info.previous_pkg
- self.old_iuse = sorted(previous_pkg.iuse.all)
- self.old_use = previous_pkg.use.enabled
- self.is_new = False
+ old_iuse = sorted(previous_pkg.iuse.all)
+ old_use = previous_pkg.use.enabled
+ is_new = False
else:
- self.old_iuse = []
- self.old_use = []
- self.is_new = True
+ old_iuse = []
+ old_use = []
+ is_new = True
- self.old_use = [flag for flag in self.old_use if flag in self.old_iuse]
+ old_use = [flag for flag in old_use if flag in old_iuse]
self.use_expand = pkg.use.expand
self.use_expand_hidden = pkg.use.expand_hidden
@@ -233,10 +228,10 @@ class Display(object):
reinst_expand_map)
cur_iuse_map, iuse_forced = \
- self.map_to_use_expand(self.cur_iuse, forced_flags=True)
- cur_use_map = self.map_to_use_expand(self.cur_use)
- old_iuse_map = self.map_to_use_expand(self.old_iuse)
- old_use_map = self.map_to_use_expand(self.old_use)
+ self.map_to_use_expand(cur_iuse, forced_flags=True)
+ cur_use_map = self.map_to_use_expand(cur_use)
+ old_iuse_map = self.map_to_use_expand(old_iuse)
+ old_use_map = self.map_to_use_expand(old_use)
use_expand = sorted(self.use_expand)
use_expand.insert(0, "USE")
@@ -248,7 +243,7 @@ class Display(object):
self.verboseadd += _create_use_string(self.conf, key.upper(),
cur_iuse_map[key], iuse_forced[key],
cur_use_map[key], old_iuse_map[key],
- old_use_map[key], self.is_new, feature_flags,
+ old_use_map[key], is_new, feature_flags,
reinst_flags_map.get(key))
return
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2013-02-28 0:12 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2013-02-28 0:12 UTC (permalink / raw
To: gentoo-commits
commit: b2660f0560e1867f05841a00b6cd287cd5d8e0f0
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 28 00:12:42 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 28 00:12:42 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b2660f05
Display: unsplit _display_use method parts
---
pym/_emerge/resolver/output.py | 68 ++++++++++++++++++---------------------
1 files changed, 31 insertions(+), 37 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 335cf27..1ebb248 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -116,38 +116,6 @@ class Display(object):
else:
self.blockers.append(addl)
- def _display_use(self, pkg, pkg_info):
- """ USE flag display
-
- @param pkg: _emerge.Package.Package instance
- Modifies class globals: self.forced_flags, self.cur_iuse,
- self.old_iuse, self.old_use, self.use_expand
- """
-
- self.forced_flags = set()
- self.forced_flags.update(pkg.use.force)
- self.forced_flags.update(pkg.use.mask)
-
- self.cur_use = [flag for flag in self.conf.pkg_use_enabled(pkg) \
- if flag in pkg.iuse.all]
- self.cur_iuse = sorted(pkg.iuse.all)
-
- if pkg_info.previous_pkg is not None:
- previous_pkg = pkg_info.previous_pkg
- self.old_iuse = sorted(previous_pkg.iuse.all)
- self.old_use = previous_pkg.use.enabled
- self.is_new = False
- else:
- self.old_iuse = []
- self.old_use = []
- self.is_new = True
-
- self.old_use = [flag for flag in self.old_use if flag in self.old_iuse]
-
- self.use_expand = pkg.use.expand
- self.use_expand_hidden = pkg.use.expand_hidden
- return
-
def include_mask_str(self):
return self.conf.verbosity > 1
@@ -211,13 +179,40 @@ class Display(object):
return ret
- def recheck_hidden(self, pkg):
- """ Prevent USE_EXPAND_HIDDEN flags from being hidden if they
- are the only thing that triggered reinstallation.
+ def _display_use(self, pkg, pkg_info):
+ """ USE flag display
@param pkg: _emerge.Package.Package instance
- Modifies self.use_expand_hidden, self.use_expand, self.verboseadd
+ @param pkg_info: PkgInfo instance
+ Modifies self.use_expand_hidden, self.use_expand, self.verboseadd,
+ self.forced_flags, self.cur_iuse, self.old_iuse, self.old_use
"""
+
+ self.forced_flags = set()
+ self.forced_flags.update(pkg.use.force)
+ self.forced_flags.update(pkg.use.mask)
+
+ self.cur_use = [flag for flag in self.conf.pkg_use_enabled(pkg) \
+ if flag in pkg.iuse.all]
+ self.cur_iuse = sorted(pkg.iuse.all)
+
+ if pkg_info.previous_pkg is not None:
+ previous_pkg = pkg_info.previous_pkg
+ self.old_iuse = sorted(previous_pkg.iuse.all)
+ self.old_use = previous_pkg.use.enabled
+ self.is_new = False
+ else:
+ self.old_iuse = []
+ self.old_use = []
+ self.is_new = True
+
+ self.old_use = [flag for flag in self.old_use if flag in self.old_iuse]
+
+ self.use_expand = pkg.use.expand
+ self.use_expand_hidden = pkg.use.expand_hidden
+
+ # Prevent USE_EXPAND_HIDDEN flags from being hidden if they
+ # are the only thing that triggered reinstallation.
reinst_flags_map = {}
reinstall_for_flags = self.conf.reinstall_nodes.get(pkg)
reinst_expand_map = None
@@ -845,7 +840,6 @@ class Display(object):
if self.quiet_repo_display:
self.repoadd = None
self._display_use(pkg, pkg_info)
- self.recheck_hidden(pkg)
if self.conf.verbosity == 3:
if self.quiet_repo_display:
self.verbose_size(pkg, repoadd_set, pkg_info)
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2013-02-27 23:39 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2013-02-27 23:39 UTC (permalink / raw
To: gentoo-commits
commit: 25c7d335991f9ca7a60b2fbf091f553419a75296
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 27 23:39:33 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 27 23:39:33 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=25c7d335
Display: eliminate duplicate vardb.match() calls
---
pym/_emerge/resolver/output.py | 37 ++++++++++++++++---------------
pym/_emerge/resolver/output_helpers.py | 3 +-
2 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 6aeadee..335cf27 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -116,12 +116,10 @@ class Display(object):
else:
self.blockers.append(addl)
- def _display_use(self, pkg, myoldbest, myinslotlist):
+ def _display_use(self, pkg, pkg_info):
""" USE flag display
@param pkg: _emerge.Package.Package instance
- @param myoldbest: list of installed versions
- @param myinslotlist: list of installed slots
Modifies class globals: self.forced_flags, self.cur_iuse,
self.old_iuse, self.old_use, self.use_expand
"""
@@ -134,12 +132,8 @@ class Display(object):
if flag in pkg.iuse.all]
self.cur_iuse = sorted(pkg.iuse.all)
- if myoldbest and myinslotlist:
- previous_cpv = myoldbest[0].cpv
- else:
- previous_cpv = pkg.cpv
- if self.vardb.cpv_exists(previous_cpv):
- previous_pkg = self.vardb.match_pkgs('=' + previous_cpv)[0]
+ if pkg_info.previous_pkg is not None:
+ previous_pkg = pkg_info.previous_pkg
self.old_iuse = sorted(previous_pkg.iuse.all)
self.old_use = previous_pkg.use.enabled
self.is_new = False
@@ -343,14 +337,13 @@ class Display(object):
if self.quiet_repo_display:
# overlay verbose
# assign index for a previous version in the same slot
- slot_matches = self.vardb.match_pkgs(pkg.slot_atom)
- if slot_matches:
- repo_name_prev = slot_matches[0].repo
+ if pkg_info.previous_pkg is not None:
+ repo_name_prev = pkg_info.previous_pkg.repo
else:
repo_name_prev = None
# now use the data to generate output
- if pkg.installed or not slot_matches:
+ if pkg.installed or pkg_info.previous_pkg is None:
self.repoadd = self.conf.repo_display.repoStr(
pkg_info.repo_path_real)
else:
@@ -666,6 +659,15 @@ class Display(object):
else:
if pkg_info.ebuild_path is not None:
self.restrict_fetch_list[pkg] = pkg_info
+
+ if self.vardb.cpv_exists(pkg.cpv):
+ # Do a cpv match first, in case the SLOT has changed.
+ pkg_info.previous_pkg = self.vardb.match_pkgs('=' + pkg.cpv)[0]
+ else:
+ slot_matches = self.vardb.match_pkgs(pkg.slot_atom)
+ if slot_matches:
+ pkg_info.previous_pkg = slot_matches[0]
+
return pkg_info
@@ -676,15 +678,14 @@ class Display(object):
@param pkg_info: dictionay
Modifies self.changelogs
"""
- inst_matches = self.vardb.match(pkg.slot_atom)
- if inst_matches:
+ if pkg_info.previous_pkg is not None:
ebuild_path_cl = pkg_info.ebuild_path
if ebuild_path_cl is None:
# binary package
ebuild_path_cl = self.portdb.findname(pkg.cpv, myrepo=pkg.repo)
if ebuild_path_cl is not None:
self.changelogs.extend(_calc_changelog(
- ebuild_path_cl, inst_matches[0], pkg.cpv))
+ ebuild_path_cl, pkg_info.previous_pkg, pkg.cpv))
return
@@ -747,7 +748,7 @@ class Display(object):
installed_versions = self.vardb.match_pkgs(pkg.cp)
if self.vardb.cpv_exists(pkg.cpv):
pkg_info.attr_display.replace = True
- installed_version = self.vardb.match_pkgs(pkg.cpv)[0]
+ installed_version = pkg_info.previous_pkg
if installed_version.slot != pkg.slot or installed_version.sub_slot != pkg.sub_slot or \
not self.quiet_repo_display and installed_version.repo != pkg.repo:
myoldbest = [installed_version]
@@ -843,7 +844,7 @@ class Display(object):
self.verboseadd = ""
if self.quiet_repo_display:
self.repoadd = None
- self._display_use(pkg, pkg_info.oldbest_list, myinslotlist)
+ self._display_use(pkg, pkg_info)
self.recheck_hidden(pkg)
if self.conf.verbosity == 3:
if self.quiet_repo_display:
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index ccaa0f2..cfa6910 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -619,7 +619,7 @@ class PkgInfo(object):
__slots__ = ("attr_display", "built", "cp",
"ebuild_path", "fetch_symbol", "merge",
- "oldbest", "oldbest_list", "operation", "ordered",
+ "oldbest", "oldbest_list", "operation", "ordered", "previous_pkg",
"repo_name", "repo_path_real", "slot", "sub_slot", "system", "use", "ver", "world")
@@ -633,6 +633,7 @@ class PkgInfo(object):
self.oldbest_list = []
self.operation = ''
self.ordered = False
+ self.previous_pkg = None
self.repo_path_real = ''
self.repo_name = ''
self.slot = ''
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2013-01-24 1:18 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2013-01-24 1:18 UTC (permalink / raw
To: gentoo-commits
commit: f75b03c8f14c484f5016696e48241f8932353c91
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 24 01:18:10 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 24 01:18:10 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f75b03c8
Add debug output for cases like bug #453400.
---
pym/_emerge/resolver/slot_collision.py | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index f07b01a..f8e1e4e 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -317,6 +317,26 @@ class slot_conflict_handler(object):
#Use conditionals not met.
violated_atom = atom.violated_conditionals(_pkg_use_enabled(other_pkg), \
other_pkg.iuse.is_valid_flag)
+ if violated_atom.use is None:
+ # Something like bug #453400 caused the
+ # above findAtomForPackage call to
+ # to return None unexpectedly.
+ msg = ("\n\n!!! BUG: Detected "
+ "USE dep match inconsistency:\n"
+ "\tppkg: %s\n"
+ "\tviolated_atom: %s\n"
+ "\tatom: %s unevaluated: %s\n"
+ "\tother_pkg: %s IUSE: %s USE: %s\n" %
+ (ppkg,
+ violated_atom,
+ atom,
+ atom.unevaluated_atom,
+ other_pkg,
+ sorted(other_pkg.iuse.all),
+ sorted(_pkg_use_enabled(other_pkg))))
+ writemsg(msg, noiselevel=-2)
+ raise AssertionError(
+ 'BUG: USE dep match inconsistency')
for flag in violated_atom.use.enabled.union(violated_atom.use.disabled):
atoms = collision_reasons.get(("use", flag), set())
atoms.add((ppkg, atom, other_pkg))
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-10-15 17:17 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 62+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-10-15 17:17 UTC (permalink / raw
To: gentoo-commits
commit: 54e206ac6901b2f469638378e039d207f5024622
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Oct 15 17:16:22 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Oct 15 17:16:22 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=54e206ac
Add Display._append_repository() to avoid duplication of some code.
---
pym/_emerge/resolver/output.py | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 7035b55..130ba2d 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -419,6 +419,19 @@ class Display(object):
pkg_str += "/" + pkg_info.sub_slot
return pkg_str
+ def _append_repository(self, pkg_str, pkg, pkg_info):
+ """Potentially appends repository to package string.
+
+ @param pkg_str: string
+ @param pkg: _emerge.Package.Package instance
+ @param pkg_info: dictionary
+ @rtype string
+ """
+ if not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
+ pkg_str += _repo_separator + pkg.repo
+ return pkg_str
+
def _set_non_root_columns(self, pkg, pkg_info):
"""sets the indent level and formats the output
@@ -429,9 +442,7 @@ class Display(object):
ver_str = pkg_info.ver
if self.conf.verbosity == 3:
ver_str = self._append_slot(ver_str, pkg, pkg_info)
- if not self.quiet_repo_display and (self.verbose_main_repo_display or
- any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
- ver_str += _repo_separator + pkg.repo
+ ver_str = self._append_repository(ver_str, pkg, pkg_info)
if self.conf.quiet:
myprint = str(pkg_info.attr_display) + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
@@ -470,9 +481,7 @@ class Display(object):
ver_str = pkg_info.ver
if self.conf.verbosity == 3:
ver_str = self._append_slot(ver_str, pkg, pkg_info)
- if not self.quiet_repo_display and (self.verbose_main_repo_display or
- any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
- ver_str += _repo_separator + pkg.repo
+ ver_str = self._append_repository(ver_str, pkg, pkg_info)
if self.conf.quiet:
myprint = str(pkg_info.attr_display) + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
@@ -509,9 +518,7 @@ class Display(object):
pkg_str = pkg.cpv
if self.conf.verbosity == 3:
pkg_str = self._append_slot(pkg_str, pkg, pkg_info)
- if not self.quiet_repo_display and (self.verbose_main_repo_display or
- any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
- pkg_str += _repo_separator + pkg.repo
+ pkg_str = self._append_repository(pkg_str, pkg, pkg_info)
if not pkg_info.merge:
addl = self.empty_space_in_brackets()
myprint = "[%s%s] %s%s %s" % \
@@ -802,7 +809,7 @@ class Display(object):
# files to fetch list - avoids counting a same file twice
# in size display (verbose mode)
self.myfetchlist = set()
-
+
self.quiet_repo_display = "--quiet-repo-display" in depgraph._frozen_config.myopts
if self.quiet_repo_display:
# Use this set to detect when all the "repoadd" strings are "[0]"
@@ -866,9 +873,7 @@ class Display(object):
pkg_str = pkg.cpv
if self.conf.verbosity == 3:
pkg_str = self._append_slot(pkg_str, pkg, pkg_info)
- if not self.quiet_repo_display and (self.verbose_main_repo_display or
- any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
- pkg_str += _repo_separator + pkg.repo
+ pkg_str = self._append_repository(pkg_str, pkg, pkg_info)
if not pkg_info.merge:
addl = self.empty_space_in_brackets()
myprint = "[%s%s] " % (
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-10-15 4:06 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 62+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-10-15 4:06 UTC (permalink / raw
To: gentoo-commits
commit: 374ddd242394d510beea46013281de8d9ec50671
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Oct 15 04:04:58 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Oct 15 04:04:58 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=374ddd24
Display slots and subslots in output of `emerge -pv ${package}`.
---
pym/_emerge/resolver/output.py | 83 ++++++++++++++++++++++++--------
pym/_emerge/resolver/output_helpers.py | 4 +-
2 files changed, 65 insertions(+), 22 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 5b297ef..7035b55 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -13,7 +13,7 @@ import sys
from portage import os
from portage import _unicode_decode
from portage.dbapi.dep_expand import dep_expand
-from portage.dep import cpvequal, _repo_separator
+from portage.dep import cpvequal, _repo_separator, _slot_separator
from portage.eapi import _get_eapi_attrs
from portage.exception import InvalidDependString, SignatureException
from portage.package.ebuild.config import _get_feature_flags
@@ -367,13 +367,14 @@ class Display(object):
repoadd_set.add(self.repoadd)
- def convert_myoldbest(self, pkg, myoldbest):
+ def convert_myoldbest(self, pkg, pkg_info):
"""converts and colorizes a version list to a string
@param pkg: _emerge.Package.Package instance
- @param myoldbest: list
+ @param pkg_info: dictionary
@rtype string.
"""
+ myoldbest = pkg_info.oldbest_list
# Convert myoldbest from a list to a string.
myoldbest_str = ""
if myoldbest:
@@ -382,13 +383,42 @@ class Display(object):
key = old_pkg.version
if key[-3:] == "-r0":
key = key[:-3]
- if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
- any(x.repo != self.portdb.repositories.mainRepo().name for x in myoldbest + [pkg])):
- key += _repo_separator + old_pkg.repo
+ if self.conf.verbosity == 3:
+ if pkg_info.attr_display.new_slot:
+ key += _slot_separator + old_pkg.slot
+ if old_pkg.slot != old_pkg.sub_slot:
+ key += "/" + old_pkg.sub_slot
+ elif any(x.slot + "/" + x.sub_slot != "0/0" for x in myoldbest + [pkg]):
+ key += _slot_separator + old_pkg.slot
+ if old_pkg.slot != old_pkg.sub_slot or \
+ old_pkg.slot == pkg.slot and old_pkg.sub_slot != pkg.sub_slot:
+ key += "/" + old_pkg.sub_slot
+ if not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in myoldbest + [pkg])):
+ key += _repo_separator + old_pkg.repo
versions.append(key)
myoldbest_str = blue("["+", ".join(versions)+"]")
return myoldbest_str
+ def _append_slot(self, pkg_str, pkg, pkg_info):
+ """Potentially appends slot and subslot to package string.
+
+ @param pkg_str: string
+ @param pkg: _emerge.Package.Package instance
+ @param pkg_info: dictionary
+ @rtype string
+ """
+ if pkg_info.attr_display.new_slot:
+ pkg_str += _slot_separator + pkg_info.slot
+ if pkg_info.slot != pkg_info.sub_slot:
+ pkg_str += "/" + pkg_info.sub_slot
+ elif any(x.slot + "/" + x.sub_slot != "0/0" for x in pkg_info.oldbest_list + [pkg]):
+ pkg_str += _slot_separator + pkg_info.slot
+ if pkg_info.slot != pkg_info.sub_slot or \
+ any(x.slot == pkg_info.slot and x.sub_slot != pkg_info.sub_slot for x in pkg_info.oldbest_list):
+ pkg_str += "/" + pkg_info.sub_slot
+ return pkg_str
+
def _set_non_root_columns(self, pkg, pkg_info):
"""sets the indent level and formats the output
@@ -397,9 +427,11 @@ class Display(object):
@rtype string
"""
ver_str = pkg_info.ver
- if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
- any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
- ver_str += _repo_separator + pkg.repo
+ if self.conf.verbosity == 3:
+ ver_str = self._append_slot(ver_str, pkg, pkg_info)
+ if not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
+ ver_str += _repo_separator + pkg.repo
if self.conf.quiet:
myprint = str(pkg_info.attr_display) + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
@@ -436,9 +468,11 @@ class Display(object):
Modifies self.verboseadd
"""
ver_str = pkg_info.ver
- if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
- any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
- ver_str += _repo_separator + pkg.repo
+ if self.conf.verbosity == 3:
+ ver_str = self._append_slot(ver_str, pkg, pkg_info)
+ if not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
+ ver_str += _repo_separator + pkg.repo
if self.conf.quiet:
myprint = str(pkg_info.attr_display) + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
@@ -473,9 +507,11 @@ class Display(object):
@rtype the updated addl
"""
pkg_str = pkg.cpv
- if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
- any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
- pkg_str += _repo_separator + pkg.repo
+ if self.conf.verbosity == 3:
+ pkg_str = self._append_slot(pkg_str, pkg, pkg_info)
+ if not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
+ pkg_str += _repo_separator + pkg.repo
if not pkg_info.merge:
addl = self.empty_space_in_brackets()
myprint = "[%s%s] %s%s %s" % \
@@ -581,6 +617,9 @@ class Display(object):
pkg_info = PkgInfo()
pkg_info.cp = pkg.cp
pkg_info.ver = self.get_ver_str(pkg)
+ pkg_info.slot = pkg.slot
+ pkg_info.sub_slot = pkg.sub_slot
+ pkg_info.repo_name = pkg.repo
pkg_info.ordered = ordered
pkg_info.operation = pkg.operation
pkg_info.merge = ordered and pkg_info.operation == "merge"
@@ -588,7 +627,6 @@ class Display(object):
pkg_info.operation = "nomerge"
pkg_info.built = pkg.type_name != "ebuild"
pkg_info.ebuild_path = None
- pkg_info.repo_name = pkg.repo
if ordered:
if pkg_info.merge:
if pkg.type_name == "binary":
@@ -702,7 +740,8 @@ class Display(object):
if self.vardb.cpv_exists(pkg.cpv):
pkg_info.attr_display.replace = True
installed_version = self.vardb.match_pkgs(pkg.cpv)[0]
- if not self.quiet_repo_display and installed_version.repo != pkg.repo:
+ if installed_version.slot != pkg.slot or installed_version.sub_slot != pkg.sub_slot or \
+ not self.quiet_repo_display and installed_version.repo != pkg.repo:
myoldbest = [installed_version]
if pkg_info.ordered:
if pkg_info.merge:
@@ -806,7 +845,7 @@ class Display(object):
self.oldlp = self.conf.columnwidth - 30
self.newlp = self.oldlp - 30
- pkg_info.oldbest = self.convert_myoldbest(pkg, pkg_info.oldbest_list)
+ pkg_info.oldbest = self.convert_myoldbest(pkg, pkg_info)
pkg_info.system, pkg_info.world = \
self.check_system_world(pkg)
if 'interactive' in pkg.metadata.properties and \
@@ -825,9 +864,11 @@ class Display(object):
myprint = self._set_non_root_columns(pkg, pkg_info)
else:
pkg_str = pkg.cpv
- if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
- any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
- pkg_str += _repo_separator + pkg.repo
+ if self.conf.verbosity == 3:
+ pkg_str = self._append_slot(pkg_str, pkg, pkg_info)
+ if not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
+ pkg_str += _repo_separator + pkg.repo
if not pkg_info.merge:
addl = self.empty_space_in_brackets()
myprint = "[%s%s] " % (
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index 7016ec2..1fc083a 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -617,7 +617,7 @@ class PkgInfo(object):
__slots__ = ("attr_display", "built", "cp",
"ebuild_path", "fetch_symbol", "merge",
"oldbest", "oldbest_list", "operation", "ordered",
- "repo_name", "repo_path_real", "system", "use", "ver", "world")
+ "repo_name", "repo_path_real", "slot", "sub_slot", "system", "use", "ver", "world")
def __init__(self):
@@ -632,6 +632,8 @@ class PkgInfo(object):
self.ordered = False
self.repo_path_real = ''
self.repo_name = ''
+ self.slot = ''
+ self.sub_slot = ''
self.system = False
self.use = ''
self.ver = ''
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-10-14 20:02 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 62+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-10-14 20:02 UTC (permalink / raw
To: gentoo-commits
commit: e7f0157b952a5eb9d77464d40b27748c226f580b
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Oct 14 20:00:19 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Oct 14 20:00:19 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e7f0157b
Invert order of arguments in Display._set_non_root_columns() and
Display._set_root_columns() for consistency with Display._set_no_columns().
---
pym/_emerge/resolver/output.py | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 92c9b4a..5b297ef 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -389,11 +389,11 @@ class Display(object):
myoldbest_str = blue("["+", ".join(versions)+"]")
return myoldbest_str
- def _set_non_root_columns(self, pkg_info, pkg):
+ def _set_non_root_columns(self, pkg, pkg_info):
"""sets the indent level and formats the output
- @param pkg_info: dictionary
@param pkg: _emerge.Package.Package instance
+ @param pkg_info: dictionary
@rtype string
"""
ver_str = pkg_info.ver
@@ -427,11 +427,11 @@ class Display(object):
return myprint
- def _set_root_columns(self, pkg_info, pkg):
+ def _set_root_columns(self, pkg, pkg_info):
"""sets the indent level and formats the output
- @param pkg_info: dictionary
@param pkg: _emerge.Package.Package instance
+ @param pkg_info: dictionary
@rtype string
Modifies self.verboseadd
"""
@@ -822,7 +822,7 @@ class Display(object):
if pkg_info.oldbest:
pkg_info.oldbest += " "
if self.conf.columns:
- myprint = self._set_non_root_columns(pkg_info, pkg)
+ myprint = self._set_non_root_columns(pkg, pkg_info)
else:
pkg_str = pkg.cpv
if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
@@ -843,7 +843,7 @@ class Display(object):
pkg_info.oldbest + darkgreen("to " + pkg.root)
else:
if self.conf.columns:
- myprint = self._set_root_columns(pkg_info, pkg)
+ myprint = self._set_root_columns(pkg, pkg_info)
else:
myprint = self._set_no_columns(pkg, pkg_info)
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-10-14 19:54 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 62+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-10-14 19:54 UTC (permalink / raw
To: gentoo-commits
commit: 86385b9747e6cd4a23bd01eb7b8628fd3e158f76
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Oct 14 19:53:40 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Oct 14 19:53:40 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=86385b97
Display.set_pkg_info(): Set cp and ver attributes.
---
pym/_emerge/resolver/output.py | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 275a053..92c9b4a 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -579,6 +579,8 @@ class Display(object):
self.counters.restrict_fetch_satisfied
"""
pkg_info = PkgInfo()
+ pkg_info.cp = pkg.cp
+ pkg_info.ver = self.get_ver_str(pkg)
pkg_info.ordered = ordered
pkg_info.operation = pkg.operation
pkg_info.merge = ordered and pkg_info.operation == "merge"
@@ -802,9 +804,6 @@ class Display(object):
else:
self.verbose_size(pkg, None, pkg_info)
- pkg_info.cp = pkg.cp
- pkg_info.ver = self.get_ver_str(pkg)
-
self.oldlp = self.conf.columnwidth - 30
self.newlp = self.oldlp - 30
pkg_info.oldbest = self.convert_myoldbest(pkg, pkg_info.oldbest_list)
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-10-14 2:53 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-10-14 2:53 UTC (permalink / raw
To: gentoo-commits
commit: f3324a8779f331a6ac663244221c760f991aca07
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 14 02:53:09 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 14 02:53:09 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f3324a87
simplify Display.convert_myoldbest().
---
pym/_emerge/resolver/output.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 8a1e63a..275a053 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -22,7 +22,7 @@ from portage.output import ( blue, colorize, create_color_func,
darkblue, darkgreen, green, nc_len, teal)
bad = create_color_func("BAD")
from portage.util import writemsg_stdout
-from portage.versions import best, catpkgsplit
+from portage.versions import best
from _emerge.Blocker import Blocker
from _emerge.create_world_atom import create_world_atom
@@ -379,7 +379,7 @@ class Display(object):
if myoldbest:
versions = []
for pos, old_pkg in enumerate(myoldbest):
- key = catpkgsplit(old_pkg.cpv)[2] + "-" + catpkgsplit(old_pkg.cpv)[3]
+ key = old_pkg.version
if key[-3:] == "-r0":
key = key[:-3]
if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-10-14 2:44 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-10-14 2:44 UTC (permalink / raw
To: gentoo-commits
commit: 6d6868206d5109fbbda9b716b597adb3440666bb
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 14 02:44:18 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 14 02:44:18 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6d686820
Simplify Display.get_ver_str().
---
pym/_emerge/resolver/output.py | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 6ae022e..8a1e63a 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -676,12 +676,10 @@ class Display(object):
@param pkg: _emerge.Package.Package instance
@rtype string
"""
- ver_str = list(catpkgsplit(pkg.cpv)[2:])
- if ver_str[1] == "r0":
- ver_str[1] = ""
- else:
- ver_str[1] = "-" + ver_str[1]
- return ver_str[0]+ver_str[1]
+ ver_str = pkg.cpv.version
+ if ver_str.endswith("-r0"):
+ ver_str = ver_str[:-3]
+ return ver_str
def _get_installed_best(self, pkg, pkg_info):
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-09-25 2:00 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-09-25 2:00 UTC (permalink / raw
To: gentoo-commits
commit: d66dae55640ab98e81353325ba1daba5ba31017e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 25 02:00:14 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 25 02:00:14 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d66dae55
circular_dependency: handle HDEPEND
---
pym/_emerge/resolver/circular_dependency.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py
index 1433f41..d60f185 100644
--- a/pym/_emerge/resolver/circular_dependency.py
+++ b/pym/_emerge/resolver/circular_dependency.py
@@ -113,7 +113,8 @@ class circular_dependency_handler(object):
parent_atoms = self.all_parent_atoms.get(pkg)
if priorities[-1].buildtime:
- dep = parent.metadata["DEPEND"]
+ dep = parent.metadata["DEPEND"] + \
+ " " + parent.metadata["HDEPEND"]
elif priorities[-1].runtime:
dep = parent.metadata["RDEPEND"]
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-09-24 3:12 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-09-24 3:12 UTC (permalink / raw
To: gentoo-commits
commit: a8b9e099d08e72c10046639a15c3c7c02045c4da
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 24 03:12:14 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 24 03:12:14 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a8b9e099
_create_use_string: pass in feature_flags arg
This allows them to be looked up outside of the USE_EXPAND loop.
---
pym/_emerge/resolver/output.py | 7 +++++--
pym/_emerge/resolver/output_helpers.py | 8 +++-----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 0f2111f..6ae022e 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -14,7 +14,9 @@ from portage import os
from portage import _unicode_decode
from portage.dbapi.dep_expand import dep_expand
from portage.dep import cpvequal, _repo_separator
+from portage.eapi import _get_eapi_attrs
from portage.exception import InvalidDependString, SignatureException
+from portage.package.ebuild.config import _get_feature_flags
from portage.package.ebuild._spawn_nofetch import spawn_nofetch
from portage.output import ( blue, colorize, create_color_func,
darkblue, darkgreen, green, nc_len, teal)
@@ -247,14 +249,15 @@ class Display(object):
use_expand = sorted(self.use_expand)
use_expand.insert(0, "USE")
+ feature_flags = _get_feature_flags(_get_eapi_attrs(pkg.metadata["EAPI"]))
for key in use_expand:
if key in self.use_expand_hidden:
continue
- self.verboseadd += _create_use_string(pkg, self.conf, key.upper(),
+ self.verboseadd += _create_use_string(self.conf, key.upper(),
cur_iuse_map[key], iuse_forced[key],
cur_use_map[key], old_iuse_map[key],
- old_use_map[key], self.is_new,
+ old_use_map[key], self.is_new, feature_flags,
reinst_flags_map.get(key))
return
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index 23b056c..7016ec2 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -14,11 +14,9 @@ import sys
from portage import os
from portage import _encodings, _unicode_encode
from portage._sets.base import InternalPackageSet
-from portage.eapi import _get_eapi_attrs
from portage.output import (blue, bold, colorize, create_color_func,
green, red, teal, turquoise, yellow)
bad = create_color_func("BAD")
-from portage.package.ebuild.config import _get_feature_flags
from portage.util import shlex_split, writemsg
from portage.util.SlotObject import SlotObject
from portage.versions import catpkgsplit
@@ -248,9 +246,9 @@ def _format_size(mysize):
mystr=mystr[:mycount]+","+mystr[mycount:]
return mystr+" kB"
-def _create_use_string(pkg, conf, name, cur_iuse, iuse_forced, cur_use,
+def _create_use_string(conf, name, cur_iuse, iuse_forced, cur_use,
old_iuse, old_use,
- is_new, reinst_flags):
+ is_new, feature_flags, reinst_flags):
if not conf.print_use_string:
return ""
@@ -268,7 +266,7 @@ def _create_use_string(pkg, conf, name, cur_iuse, iuse_forced, cur_use,
any_iuse = cur_iuse.union(old_iuse)
any_iuse = list(any_iuse)
any_iuse.sort()
- feature_flags = _get_feature_flags(_get_eapi_attrs(pkg.metadata["EAPI"]))
+
for flag in any_iuse:
flag_str = None
isEnabled = False
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-09-14 2:08 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-09-14 2:08 UTC (permalink / raw
To: gentoo-commits
commit: 482c3de43f4af8e4ca835fe4febabe0415ad3f8f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 14 02:08:23 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 14 02:08:23 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=482c3de4
Display: simplify _blockers
The fetch_symbol variable was always just a space, and no return value
was really needed.
---
pym/_emerge/resolver/output.py | 19 ++++++-------------
1 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 3325a42..05a3e82 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -68,24 +68,21 @@ class Display(object):
self.blocker_style = None
- def _blockers(self, pkg, fetch_symbol):
+ def _blockers(self, pkg):
"""Processes pkg for blockers and adds colorized strings to
self.print_msg and self.blockers
@param pkg: _emerge.Package.Package instance
- @param fetch_symbol: string
@rtype: bool
Modifies class globals: self.blocker_style, self.resolved,
self.print_msg
"""
if pkg.satisfied:
self.blocker_style = "PKG_BLOCKER_SATISFIED"
- addl = "%s %s " % (colorize(self.blocker_style, "b"),
- fetch_symbol)
+ addl = "%s " % (colorize(self.blocker_style, "b"),)
else:
self.blocker_style = "PKG_BLOCKER"
- addl = "%s %s " % (colorize(self.blocker_style, "B"),
- fetch_symbol)
+ addl = "%s " % (colorize(self.blocker_style, "B"),)
addl += self.empty_space_in_brackets()
self.resolved = dep_expand(
str(pkg.atom).lstrip("!"), mydb=self.vardb,
@@ -110,13 +107,10 @@ class Display(object):
addl += colorize(self.blocker_style,
" (is blocking %s)") % block_parents
if isinstance(pkg, Blocker) and pkg.satisfied:
- if self.conf.columns:
- return True
- self.print_msg.append(addl)
+ if not self.conf.columns:
+ self.print_msg.append(addl)
else:
self.blockers.append(addl)
- return False
-
def _display_use(self, pkg, myoldbest, myinslotlist):
""" USE flag display
@@ -784,8 +778,7 @@ class Display(object):
self.indent = " " * depth
if isinstance(pkg, Blocker):
- if self._blockers(pkg, fetch_symbol=" "):
- continue
+ self._blockers(pkg)
else:
pkg_info = self.set_pkg_info(pkg, ordered)
pkg_info.oldbest_list, myinslotlist = \
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-09-14 1:04 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-09-14 1:04 UTC (permalink / raw
To: gentoo-commits
commit: 156bf1b09a263217e9de5d0d14934cc295121f0a
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 14 01:03:54 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 14 01:03:54 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=156bf1b0
Refactor merge list attribute display.
This should not change the behavior at all, but it makes the display
much easier to modify or extend.
---
pym/_emerge/resolver/output.py | 126 +++++++++++---------------------
pym/_emerge/resolver/output_helpers.py | 64 ++++++++++++++++-
2 files changed, 106 insertions(+), 84 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 61cfe9e..11e668b 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -17,7 +17,7 @@ from portage.dep import cpvequal, _repo_separator
from portage.exception import InvalidDependString, SignatureException
from portage.package.ebuild._spawn_nofetch import spawn_nofetch
from portage.output import ( blue, colorize, create_color_func,
- darkblue, darkgreen, green, nc_len, red, teal, turquoise, yellow )
+ darkblue, darkgreen, green, nc_len, teal)
bad = create_color_func("BAD")
from portage.util import writemsg_stdout
from portage.versions import best, catpkgsplit
@@ -392,26 +392,9 @@ class Display(object):
myoldbest_str = blue("["+", ".join(versions)+"]")
return myoldbest_str
-
- def set_interactive(self, pkg, ordered, addl):
- """Increments counters.interactive if the pkg is to
- be merged and it's metadata has interactive set True
-
- @param pkg: _emerge.Package.Package instance
- @param ordered: boolean
- @param addl: already defined string to add to
- """
- if 'interactive' in pkg.metadata.properties and \
- pkg.operation == 'merge':
- addl = colorize("WARN", "I") + addl[1:]
- if ordered:
- self.counters.interactive += 1
- return addl
-
- def _set_non_root_columns(self, addl, pkg_info, pkg):
+ def _set_non_root_columns(self, pkg_info, pkg):
"""sets the indent level and formats the output
- @param addl: already defined string to add to
@param pkg_info: dictionary
@param pkg: _emerge.Package.Package instance
@rtype string
@@ -421,7 +404,7 @@ class Display(object):
any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
ver_str += _repo_separator + pkg.repo
if self.conf.quiet:
- myprint = addl + " " + self.indent + \
+ myprint = str(pkg_info.attr_display) + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
myprint = myprint+darkblue(" "+ver_str)+" "
myprint = myprint+pkg_info.oldbest
@@ -434,7 +417,8 @@ class Display(object):
self.indent, self.pkgprint(pkg.cp, pkg_info))
else:
myprint = "[%s %s] %s%s" % \
- (self.pkgprint(pkg.type_name, pkg_info), addl,
+ (self.pkgprint(pkg.type_name, pkg_info),
+ pkg_info.attr_display,
self.indent, self.pkgprint(pkg.cp, pkg_info))
if (self.newlp-nc_len(myprint)) > 0:
myprint = myprint+(" "*(self.newlp-nc_len(myprint)))
@@ -446,10 +430,9 @@ class Display(object):
return myprint
- def _set_root_columns(self, addl, pkg_info, pkg):
+ def _set_root_columns(self, pkg_info, pkg):
"""sets the indent level and formats the output
- @param addl: already defined string to add to
@param pkg_info: dictionary
@param pkg: _emerge.Package.Package instance
@rtype string
@@ -460,7 +443,7 @@ class Display(object):
any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
ver_str += _repo_separator + pkg.repo
if self.conf.quiet:
- myprint = addl + " " + self.indent + \
+ myprint = str(pkg_info.attr_display) + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
myprint = myprint+" "+green(ver_str)+" "
myprint = myprint+pkg_info.oldbest
@@ -473,7 +456,8 @@ class Display(object):
addl, self.indent, self.pkgprint(pkg.cp, pkg_info))
else:
myprint = "[%s %s] %s%s" % \
- (self.pkgprint(pkg.type_name, pkg_info), addl,
+ (self.pkgprint(pkg.type_name, pkg_info),
+ pkg_info.attr_display,
self.indent, self.pkgprint(pkg.cp, pkg_info))
if (self.newlp-nc_len(myprint)) > 0:
myprint = myprint+(" "*(self.newlp-nc_len(myprint)))
@@ -484,12 +468,11 @@ class Display(object):
return myprint
- def _set_no_columns(self, pkg, pkg_info, addl):
+ def _set_no_columns(self, pkg, pkg_info):
"""prints pkg info without column indentation.
@param pkg: _emerge.Package.Package instance
@param pkg_info: dictionary
- @param addl: the current text to add for the next line to output
@rtype the updated addl
"""
pkg_str = pkg.cpv
@@ -506,46 +489,10 @@ class Display(object):
else:
myprint = "[%s %s] %s%s %s" % \
(self.pkgprint(pkg.type_name, pkg_info),
- addl, self.indent,
+ pkg_info.attr_display, self.indent,
self.pkgprint(pkg_str, pkg_info), pkg_info.oldbest)
return myprint
-
- def _insert_slot(self, pkg, pkg_info, myinslotlist):
- """Adds slot info to the message
-
- @return addl: formatted slot info
- @return myoldbest: installed version list
- Modifies self.counters.downgrades, self.counters.upgrades
- """
- addl = " " + pkg_info.fetch_symbol
- if not cpvequal(pkg.cpv,
- best([pkg.cpv] + [x.cpv for x in myinslotlist])):
- # Downgrade in slot
- addl += turquoise("U")+blue("D")
- if pkg_info.ordered:
- self.counters.downgrades += 1
- else:
- # Update in slot
- addl += turquoise("U") + " "
- if pkg_info.ordered:
- self.counters.upgrades += 1
- return addl
-
-
- def _new_slot(self, pkg, pkg_info):
- """New slot, mark it new.
-
- @return addl: formatted slot info
- @return myoldbest: installed version list
- Modifies self.counters.newslot
- """
- addl = " " + green("NS") + pkg_info.fetch_symbol + " "
- if pkg_info.ordered:
- self.counters.newslot += 1
- return addl
-
-
def print_messages(self, show_repos):
"""Performs the actual output printing of the pre-formatted
messages
@@ -636,7 +583,6 @@ class Display(object):
"""
pkg_info = PkgInfo()
pkg_info.ordered = ordered
- pkg_info.fetch_symbol = " "
pkg_info.operation = pkg.operation
pkg_info.merge = ordered and pkg_info.operation == "merge"
if not pkg_info.merge and pkg_info.operation == "merge":
@@ -666,13 +612,13 @@ class Display(object):
'fetch' in pkg.metadata.restrict:
if pkg_info.ordered:
self.counters.restrict_fetch += 1
+ pkg_info.attr_display.fetch_restrict = True
if not self.portdb.getfetchsizes(pkg.cpv,
useflags=pkg_info.use, myrepo=pkg.repo):
- pkg_info.fetch_symbol = green("f")
+ pkg_info.attr_display.fetch_restrict_satisfied = True
if pkg_info.ordered:
self.counters.restrict_fetch_satisfied += 1
else:
- pkg_info.fetch_symbol = red("F")
if pkg_info.ebuild_path is not None:
self.restrict_fetch_list[pkg] = pkg_info
return pkg_info
@@ -757,7 +703,7 @@ class Display(object):
myinslotlist = None
installed_versions = self.vardb.match_pkgs(pkg.cp)
if self.vardb.cpv_exists(pkg.cpv):
- addl = " "+yellow("R")+pkg_info.fetch_symbol+" "
+ pkg_info.attr_display.replace = True
installed_version = self.vardb.match_pkgs(pkg.cpv)[0]
if not self.quiet_repo_display and installed_version.repo != pkg.repo:
myoldbest = [installed_version]
@@ -775,17 +721,31 @@ class Display(object):
myinslotlist = None
if myinslotlist:
myoldbest = myinslotlist[:]
- addl = self._insert_slot(pkg, pkg_info, myinslotlist)
+ if not cpvequal(pkg.cpv,
+ best([pkg.cpv] + [x.cpv for x in myinslotlist])):
+ # Downgrade in slot
+ pkg_info.attr_display.new_version = True
+ pkg_info.attr_display.downgrade = True
+ if pkg_info.ordered:
+ self.counters.downgrades += 1
+ else:
+ # Update in slot
+ pkg_info.attr_display.new_version = True
+ if pkg_info.ordered:
+ self.counters.upgrades += 1
else:
myoldbest = installed_versions
- addl = self._new_slot(pkg, pkg_info)
+ pkg_info.attr_display.new = True
+ pkg_info.attr_display.new_slot = True
+ if pkg_info.ordered:
+ self.counters.newslot += 1
if self.conf.changelog:
self.do_changelog(pkg, pkg_info)
else:
- addl = " " + green("N") + " " + pkg_info.fetch_symbol + " "
+ pkg_info.attr_display.new = True
if pkg_info.ordered:
self.counters.new += 1
- return addl, myoldbest, myinslotlist
+ return myoldbest, myinslotlist
def __call__(self, depgraph, mylist, favorites=None, verbosity=None):
@@ -828,7 +788,7 @@ class Display(object):
continue
else:
pkg_info = self.set_pkg_info(pkg, ordered)
- addl, pkg_info.oldbest_list, myinslotlist = \
+ pkg_info.oldbest_list, myinslotlist = \
self._get_installed_best(pkg, pkg_info)
self.verboseadd = ""
if self.quiet_repo_display:
@@ -849,17 +809,20 @@ class Display(object):
pkg_info.oldbest = self.convert_myoldbest(pkg, pkg_info.oldbest_list)
pkg_info.system, pkg_info.world = \
self.check_system_world(pkg)
- addl = self.set_interactive(pkg, pkg_info.ordered, addl)
+ if 'interactive' in pkg.metadata.properties and \
+ pkg.operation == 'merge':
+ pkg_info.attr_display.interactive = True
+ if ordered:
+ self.counters.interactive += 1
if self.include_mask_str():
- addl += self.gen_mask_str(pkg)
+ pkg_info.attr_display.mask = self.gen_mask_str(pkg)
if pkg.root_config.settings["ROOT"] != "/":
if pkg_info.oldbest:
pkg_info.oldbest += " "
if self.conf.columns:
- myprint = self._set_non_root_columns(
- addl, pkg_info, pkg)
+ myprint = self._set_non_root_columns(pkg_info, pkg)
else:
pkg_str = pkg.cpv
if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
@@ -873,17 +836,16 @@ class Display(object):
)
else:
myprint = "[%s %s] " % (
- self.pkgprint(pkg.type_name, pkg_info), addl)
+ self.pkgprint(pkg.type_name, pkg_info),
+ pkg_info.attr_display)
myprint += self.indent + \
self.pkgprint(pkg_str, pkg_info) + " " + \
pkg_info.oldbest + darkgreen("to " + pkg.root)
else:
if self.conf.columns:
- myprint = self._set_root_columns(
- addl, pkg_info, pkg)
+ myprint = self._set_root_columns(pkg_info, pkg)
else:
- myprint = self._set_no_columns(
- pkg, pkg_info, addl)
+ myprint = self._set_no_columns(pkg, pkg_info)
if self.conf.columns and pkg.operation == "uninstall":
continue
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index dc622bd..41dc324 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -15,10 +15,11 @@ from portage import os
from portage import _encodings, _unicode_encode
from portage._sets.base import InternalPackageSet
from portage.output import (blue, bold, colorize, create_color_func,
- green, red, teal, yellow)
+ green, red, teal, turquoise, yellow)
bad = create_color_func("BAD")
from portage.package.ebuild.config import _feature_flags
from portage.util import shlex_split, writemsg
+from portage.util.SlotObject import SlotObject
from portage.versions import catpkgsplit
from _emerge.Blocker import Blocker
@@ -613,7 +614,8 @@ class PkgInfo(object):
information about the pkg being printed.
"""
- __slots__ = ("built", "cp", "ebuild_path", "fetch_symbol", "merge",
+ __slots__ = ("attr_display", "built", "cp",
+ "ebuild_path", "fetch_symbol", "merge",
"oldbest", "oldbest_list", "operation", "ordered",
"repo_name", "repo_path_real", "system", "use", "ver", "world")
@@ -634,3 +636,61 @@ class PkgInfo(object):
self.use = ''
self.ver = ''
self.world = False
+ self.attr_display = PkgAttrDisplay()
+
+class PkgAttrDisplay(SlotObject):
+
+ __slots__ = ("downgrade", "fetch_restrict", "fetch_restrict_satisfied",
+ "interactive", "mask", "new", "new_slot", "new_version", "replace")
+
+ def __str__(self):
+ output = []
+
+ if self.interactive:
+ output.append(colorize("WARN", "I"))
+ else:
+ output.append(" ")
+
+ if self.new:
+ output.append(green("N"))
+ else:
+ output.append(" ")
+
+ if self.new_slot or self.replace:
+ if self.replace:
+ output.append(yellow("R"))
+ else:
+ output.append(green("S"))
+ else:
+ output.append(" ")
+
+ if self.fetch_restrict or self.fetch_restrict_satisfied:
+ if self.fetch_restrict_satisfied:
+ output.append(green("f"))
+ else:
+ output.append(red("F"))
+ else:
+ output.append(" ")
+
+ if self.new_version:
+ output.append(turquoise("U"))
+ else:
+ output.append(" ")
+
+ if self.downgrade:
+ output.append(blue("D"))
+ else:
+ output.append(" ")
+
+ if self.mask is not None:
+ output.append(self.mask)
+
+ return "".join(output)
+
+ if sys.hexversion < 0x3000000:
+
+ __unicode__ = __str__
+
+ def __str__(self):
+ return _unicode_encode(self.__unicode__(),
+ encoding=_encodings['content'])
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-06-27 21:56 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-06-27 21:56 UTC (permalink / raw
To: gentoo-commits
commit: 69ae09d8fce2ed23c4eca7b7af83a3b47626795e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 27 21:55:49 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 27 21:55:49 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=69ae09d8
BacktrackParameter: fix runtime_pkg_mask copy
This caused the backtracker to bail out too early sometimes.
---
pym/_emerge/resolver/backtracking.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/resolver/backtracking.py b/pym/_emerge/resolver/backtracking.py
index 00a07bc..d8f49c6 100644
--- a/pym/_emerge/resolver/backtracking.py
+++ b/pym/_emerge/resolver/backtracking.py
@@ -31,13 +31,17 @@ class BacktrackParameter(object):
#to our sets and dicts. The existing content is immutable.
result.needed_unstable_keywords = copy.copy(self.needed_unstable_keywords)
result.needed_p_mask_changes = copy.copy(self.needed_p_mask_changes)
- result.runtime_pkg_mask = copy.copy(self.runtime_pkg_mask)
result.needed_use_config_changes = copy.copy(self.needed_use_config_changes)
result.needed_license_changes = copy.copy(self.needed_license_changes)
result.rebuild_list = copy.copy(self.rebuild_list)
result.reinstall_list = copy.copy(self.reinstall_list)
result.slot_abi_replace_installed = copy.copy(self.slot_abi_replace_installed)
+ # runtime_pkg_mask contains nested dicts that must also be copied
+ result.runtime_pkg_mask = {}
+ for k, v in self.runtime_pkg_mask.items():
+ result.runtime_pkg_mask[k] = copy.copy(v)
+
return result
def __eq__(self, other):
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-06-23 6:00 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-06-23 6:00 UTC (permalink / raw
To: gentoo-commits
commit: d15e3dded958eebdb52c7370e28a62002b70dfe3
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 05:59:51 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 05:59:51 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d15e3dde
slot_abi_mask_built: don't discard other masks
---
pym/_emerge/resolver/backtracking.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/resolver/backtracking.py b/pym/_emerge/resolver/backtracking.py
index 09df9c8..f39bad4 100644
--- a/pym/_emerge/resolver/backtracking.py
+++ b/pym/_emerge/resolver/backtracking.py
@@ -187,7 +187,9 @@ class Backtracker(object):
for pkg, (new_use, new_changes) in data:
para.needed_use_config_changes[pkg] = (new_use, new_changes)
elif change == "slot_abi_mask_built":
- para.runtime_pkg_mask.update(data)
+ for pkg, mask_reasons in data.items():
+ para.runtime_pkg_mask.setdefault(pkg,
+ {}).update(mask_reasons)
elif change == "slot_abi_replace_installed":
para.slot_abi_replace_installed.update(data)
elif change == "rebuild_list":
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-06-21 4:43 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-06-21 4:43 UTC (permalink / raw
To: gentoo-commits
commit: e232dfec84dbd2506616ffd39b3d11fa7b2f1d22
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 21 04:42:49 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 21 04:42:49 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e232dfec
resolver/output: cleanup counters
---
pym/_emerge/resolver/output.py | 25 +++++++++----------------
1 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 1208bf9..61cfe9e 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -516,8 +516,7 @@ class Display(object):
@return addl: formatted slot info
@return myoldbest: installed version list
- Modifies self.counters.downgrades, self.counters.upgrades,
- self.counters.binary
+ Modifies self.counters.downgrades, self.counters.upgrades
"""
addl = " " + pkg_info.fetch_symbol
if not cpvequal(pkg.cpv,
@@ -526,15 +525,11 @@ class Display(object):
addl += turquoise("U")+blue("D")
if pkg_info.ordered:
self.counters.downgrades += 1
- if pkg.type_name == "binary":
- self.counters.binary += 1
else:
# Update in slot
addl += turquoise("U") + " "
if pkg_info.ordered:
self.counters.upgrades += 1
- if pkg.type_name == "binary":
- self.counters.binary += 1
return addl
@@ -543,13 +538,11 @@ class Display(object):
@return addl: formatted slot info
@return myoldbest: installed version list
- Modifies self.counters.newslot, self.counters.binary
+ Modifies self.counters.newslot
"""
addl = " " + green("NS") + pkg_info.fetch_symbol + " "
if pkg_info.ordered:
self.counters.newslot += 1
- if pkg.type_name == "binary":
- self.counters.binary += 1
return addl
@@ -651,6 +644,12 @@ class Display(object):
pkg_info.built = pkg.type_name != "ebuild"
pkg_info.ebuild_path = None
pkg_info.repo_name = pkg.repo
+ if ordered:
+ if pkg_info.merge:
+ if pkg.type_name == "binary":
+ self.counters.binary += 1
+ elif pkg_info.operation == "uninstall":
+ self.counters.uninst += 1
if pkg.type_name == "ebuild":
pkg_info.ebuild_path = self.portdb.findname(
pkg.cpv, myrepo=pkg_info.repo_name)
@@ -751,7 +750,7 @@ class Display(object):
@param pkg: _emerge.Package.Package instance
@param pkg_info: dictionay
@rtype addl, myoldbest: list, myinslotlist: list
- Modifies self.counters.reinst, self.counters.binary, self.counters.new
+ Modifies self.counters.reinst, self.counters.new
"""
myoldbest = []
@@ -765,10 +764,6 @@ class Display(object):
if pkg_info.ordered:
if pkg_info.merge:
self.counters.reinst += 1
- if pkg.type_name == "binary":
- self.counters.binary += 1
- elif pkg_info.operation == "uninstall":
- self.counters.uninst += 1
# filter out old-style virtual matches
elif installed_versions and \
installed_versions[0].cp == pkg.cp:
@@ -790,8 +785,6 @@ class Display(object):
addl = " " + green("N") + " " + pkg_info.fetch_symbol + " "
if pkg_info.ordered:
self.counters.new += 1
- if pkg.type_name == "binary":
- self.counters.binary += 1
return addl, myoldbest, myinslotlist
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-06-20 21:24 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-06-20 21:24 UTC (permalink / raw
To: gentoo-commits
commit: e1395684931a0c5991248435f1d47ff0425d326d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 20 21:23:47 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 20 21:23:47 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e1395684
backtracking: only feedback first slot conflict
Only create BacktrackNode instances for the first conflict which
occurred, since the conflicts that occurred later may have been
caused by the first conflict.
---
pym/_emerge/resolver/backtracking.py | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/pym/_emerge/resolver/backtracking.py b/pym/_emerge/resolver/backtracking.py
index 2f8b6d0..e3c5c7d 100644
--- a/pym/_emerge/resolver/backtracking.py
+++ b/pym/_emerge/resolver/backtracking.py
@@ -132,12 +132,11 @@ class Backtracker(object):
return True
def _feedback_slot_conflicts(self, conflicts_data):
- # This should be ordered such that the backtracker will
- # attempt to solve conflicts which occurred earlier first,
- # since an earlier conflict can be the cause of a conflict
- # which occurs later.
- for slot_data in reversed(conflicts_data):
- self._feedback_slot_conflict(slot_data)
+ # Only create BacktrackNode instances for the first
+ # conflict which occurred, since the conflicts that
+ # occurred later may have been caused by the first
+ # conflict.
+ self._feedback_slot_conflict(conflicts_data[0])
def _feedback_slot_conflict(self, conflict_data):
for pkg, parent_atoms in conflict_data:
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-04-05 19:37 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-04-05 19:37 UTC (permalink / raw
To: gentoo-commits
commit: eba99d86fe3bf43488c5df09419218d4b2941e90
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 5 19:37:40 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 5 19:37:40 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eba99d86
Limit long slot conflict loop for bug #410801.
---
pym/_emerge/resolver/slot_collision.py | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index 1d522aa..a1c8714 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -80,6 +80,8 @@ class slot_conflict_handler(object):
the needed USE changes and prepare the message for the user.
"""
+ _check_configuration_max = 1024
+
def __init__(self, depgraph):
self.depgraph = depgraph
self.myopts = depgraph._frozen_config.myopts
@@ -663,14 +665,24 @@ class slot_conflict_handler(object):
solutions = []
sol_gen = _solution_candidate_generator(all_involved_flags)
- while(True):
+ checked = 0
+ while True:
candidate = sol_gen.get_candidate()
if not candidate:
break
solution = self._check_solution(config, candidate, all_conflict_atoms_by_slotatom)
+ checked += 1
if solution:
solutions.append(solution)
-
+
+ if checked >= self._check_configuration_max:
+ # TODO: Implement early elimination for candidates that would
+ # change forced or masked flags, and don't count them here.
+ if self.debug:
+ writemsg("\nAborting _check_configuration due to "
+ "excessive number of candidates.\n", noiselevel=-1)
+ break
+
if self.debug:
if not solutions:
writemsg("No viable solutions. Rejecting configuration.\n", noiselevel=-1)
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-03-22 19:00 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-03-22 19:00 UTC (permalink / raw
To: gentoo-commits
commit: fffa9fcef6b65f4c299f393d49396e275d78245b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 22 19:00:39 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 22 19:00:39 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fffa9fce
emerge --changelog: show some log entries above
This will fix bug #373009.
---
pym/_emerge/resolver/output_helpers.py | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index ae84158..e751dd8 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -534,10 +534,25 @@ def _calc_changelog(ebuildpath,current,next):
#print 'XX from',current,'to',next
#for div,text in divisions: print 'XX',div
# skip entries for all revisions above the one we are about to emerge
- for i in range(len(divisions)):
- if divisions[i][0]==next:
- divisions = divisions[i:]
+ later_rev_index = None
+ for i, node in enumerate(divisions):
+ if node[0] == next:
+ if later_rev_index is not None:
+ first_node = divisions[later_rev_index]
+ # Discard the later revision and the first ChangeLog entry
+ # that follows it. We want to display all the entries after
+ # that first entry, as discussed in bug #373009.
+ trimmed_lines = []
+ iterator = iter(first_node[1])
+ for l in iterator:
+ if not l:
+ # end of the first entry that's discarded
+ break
+ first_node = (None, list(iterator))
+ divisions = [first_node] + divisions[later_rev_index+1:]
break
+ if node[0] is not None:
+ later_rev_index = i
output = []
prev_blank = False
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-03-22 18:10 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-03-22 18:10 UTC (permalink / raw
To: gentoo-commits
commit: 3a5f7f4993134022c094cb9247f9486061732b99
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 22 17:15:10 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 22 18:10:02 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3a5f7f49
emerge --changelog: fix split ChangeLog bugs
This should fix possible missing content when displaying split
ChangeLogs (bug #389611), and also normalizes blank lines.
---
pym/_emerge/resolver/output.py | 10 ++----
pym/_emerge/resolver/output_helpers.py | 55 +++++++++++++++++++++++++-------
2 files changed, 46 insertions(+), 19 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index bec6619..a97658a 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -16,7 +16,7 @@ from portage.dbapi.dep_expand import dep_expand
from portage.dep import cpvequal, _repo_separator
from portage.exception import InvalidDependString, SignatureException
from portage.package.ebuild._spawn_nofetch import spawn_nofetch
-from portage.output import ( blue, bold, colorize, create_color_func,
+from portage.output import ( blue, colorize, create_color_func,
darkblue, darkgreen, green, nc_len, red, teal, turquoise, yellow )
bad = create_color_func("BAD")
from portage.util import writemsg_stdout
@@ -598,13 +598,9 @@ class Display(object):
def print_changelog(self):
"""Prints the changelog text to std_out
"""
- if not self.changelogs:
- return
- writemsg_stdout('\n', noiselevel=-1)
- for revision, text in self.changelogs:
- writemsg_stdout(bold('*'+revision) + '\n' + text,
+ for chunk in self.changelogs:
+ writemsg_stdout(chunk,
noiselevel=-1)
- return
def get_display_list(self, mylist):
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index cda0b08..ae84158 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -14,8 +14,8 @@ import sys
from portage import os
from portage import _encodings, _unicode_encode
from portage._sets.base import InternalPackageSet
-from portage.output import blue, colorize, create_color_func, green, red, \
- teal, yellow
+from portage.output import (blue, bold, colorize, create_color_func,
+ green, red, teal, yellow)
bad = create_color_func("BAD")
from portage.util import shlex_split, writemsg
from portage.versions import catpkgsplit
@@ -539,26 +539,57 @@ def _calc_changelog(ebuildpath,current,next):
divisions = divisions[i:]
break
- return divisions
+ output = []
+ prev_blank = False
+ prev_rev = False
+ for rev, lines in divisions:
+ if rev is not None:
+ if not (prev_blank or prev_rev):
+ output.append("\n")
+ output.append(bold('*' + rev) + '\n')
+ prev_rev = True
+ prev_blank = False
+ if lines:
+ prev_rev = False
+ if not prev_blank:
+ output.append("\n")
+ for l in lines:
+ output.append(l + "\n")
+ output.append("\n")
+ prev_blank = True
+ return output
+
+def _strip_header_comments(lines):
+ # strip leading and trailing blank or header/comment lines
+ i = 0
+ while i < len(lines) and (not lines[i] or lines[i][:1] == "#"):
+ i += 1
+ if i:
+ lines = lines[i:]
+ while lines and (not lines[-1] or lines[-1][:1] == "#"):
+ lines.pop()
+ return lines
def _find_changelog_tags(changelog):
divs = []
+ if not changelog:
+ return divs
release = None
- while 1:
- match = re.search(r'^\*\ ?([-a-zA-Z0-9_.+]*)(?:\ .*)?\n',changelog,re.M)
- if match is None:
- if release is not None:
- divs.append((release,changelog))
- return divs
- if release is not None:
- divs.append((release,changelog[:match.start()]))
- changelog = changelog[match.end():]
+ release_end = 0
+ for match in re.finditer(r'^\*\ ?([-a-zA-Z0-9_.+]*)(?:\ .*)?$',
+ changelog, re.M):
+ divs.append((release, _strip_header_comments(
+ changelog[release_end:match.start()].splitlines())))
+ release_end = match.end()
release = match.group(1)
if release.endswith('.ebuild'):
release = release[:-7]
if release.endswith('-r0'):
release = release[:-3]
+ divs.append((release,
+ _strip_header_comments(changelog[release_end:].splitlines())))
+ return divs
class PkgInfo(object):
"""Simple class to hold instance attributes for current
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-03-22 17:38 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-03-22 17:38 UTC (permalink / raw
To: gentoo-commits
commit: abe4b1bcbcfc29accff92e02ad9a7ed7d6f00a1e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 22 17:15:10 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 22 17:37:37 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=abe4b1bc
emerge --changelog: fix split ChangeLog bugs
This should fix possible missing content when displaying split
ChangeLogs (bug #389611), and also normalizes blank lines.
---
pym/_emerge/resolver/output.py | 10 ++----
pym/_emerge/resolver/output_helpers.py | 53 ++++++++++++++++++++++++-------
2 files changed, 44 insertions(+), 19 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index bec6619..a97658a 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -16,7 +16,7 @@ from portage.dbapi.dep_expand import dep_expand
from portage.dep import cpvequal, _repo_separator
from portage.exception import InvalidDependString, SignatureException
from portage.package.ebuild._spawn_nofetch import spawn_nofetch
-from portage.output import ( blue, bold, colorize, create_color_func,
+from portage.output import ( blue, colorize, create_color_func,
darkblue, darkgreen, green, nc_len, red, teal, turquoise, yellow )
bad = create_color_func("BAD")
from portage.util import writemsg_stdout
@@ -598,13 +598,9 @@ class Display(object):
def print_changelog(self):
"""Prints the changelog text to std_out
"""
- if not self.changelogs:
- return
- writemsg_stdout('\n', noiselevel=-1)
- for revision, text in self.changelogs:
- writemsg_stdout(bold('*'+revision) + '\n' + text,
+ for chunk in self.changelogs:
+ writemsg_stdout(chunk,
noiselevel=-1)
- return
def get_display_list(self, mylist):
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index cda0b08..d33f6b9 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -14,8 +14,8 @@ import sys
from portage import os
from portage import _encodings, _unicode_encode
from portage._sets.base import InternalPackageSet
-from portage.output import blue, colorize, create_color_func, green, red, \
- teal, yellow
+from portage.output import (blue, bold, colorize, create_color_func,
+ green, red, teal, yellow)
bad = create_color_func("BAD")
from portage.util import shlex_split, writemsg
from portage.versions import catpkgsplit
@@ -539,26 +539,55 @@ def _calc_changelog(ebuildpath,current,next):
divisions = divisions[i:]
break
- return divisions
+ output = []
+ prev_blank = False
+ prev_rev = False
+ for rev, lines in divisions:
+ if rev is not None:
+ if not (prev_blank or prev_rev):
+ output.append("\n")
+ output.append(bold('*' + rev) + '\n')
+ prev_rev = True
+ prev_blank = False
+ if lines:
+ prev_rev = False
+ if not prev_blank:
+ output.append("\n")
+ for l in lines:
+ output.append(l + "\n")
+ output.append("\n")
+ prev_blank = True
+ return output
+
+def _strip_header_comments(lines):
+ # strip leading and trailing blank or header/comment lines
+ i = 0
+ while i < len(lines) and (not lines[i] or lines[i][:1] == "#"):
+ i += 1
+ if i:
+ lines = lines[i:]
+ while lines and (not lines[-1] or lines[-1][:1] == "#"):
+ lines.pop()
+ return lines
def _find_changelog_tags(changelog):
divs = []
release = None
- while 1:
- match = re.search(r'^\*\ ?([-a-zA-Z0-9_.+]*)(?:\ .*)?\n',changelog,re.M)
- if match is None:
- if release is not None:
- divs.append((release,changelog))
- return divs
- if release is not None:
- divs.append((release,changelog[:match.start()]))
- changelog = changelog[match.end():]
+ release_end = 0
+ for match in re.finditer(r'^\*\ ?([-a-zA-Z0-9_.+]*)(?:\ .*)?$',
+ changelog, re.M):
+ divs.append((release, _strip_header_comments(
+ changelog[release_end:match.start()].splitlines())))
+ release_end = match.end()
release = match.group(1)
if release.endswith('.ebuild'):
release = release[:-7]
if release.endswith('-r0'):
release = release[:-3]
+ divs.append((release,
+ _strip_header_comments(changelog[release_end:].splitlines())))
+ return divs
class PkgInfo(object):
"""Simple class to hold instance attributes for current
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-03-22 17:15 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-03-22 17:15 UTC (permalink / raw
To: gentoo-commits
commit: 56cdc6d12ab7559e8cb6a1762b8125f09f4a7647
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 22 17:15:10 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 22 17:15:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=56cdc6d1
emerge --changelog: fix split ChangeLog bugs
This should fix possible missing content when displaying split
ChangeLogs (bug #389611), and also normalizes blank lines.
---
pym/_emerge/resolver/output.py | 10 ++----
pym/_emerge/resolver/output_helpers.py | 57 +++++++++++++++++++++++++-------
2 files changed, 48 insertions(+), 19 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index bec6619..a97658a 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -16,7 +16,7 @@ from portage.dbapi.dep_expand import dep_expand
from portage.dep import cpvequal, _repo_separator
from portage.exception import InvalidDependString, SignatureException
from portage.package.ebuild._spawn_nofetch import spawn_nofetch
-from portage.output import ( blue, bold, colorize, create_color_func,
+from portage.output import ( blue, colorize, create_color_func,
darkblue, darkgreen, green, nc_len, red, teal, turquoise, yellow )
bad = create_color_func("BAD")
from portage.util import writemsg_stdout
@@ -598,13 +598,9 @@ class Display(object):
def print_changelog(self):
"""Prints the changelog text to std_out
"""
- if not self.changelogs:
- return
- writemsg_stdout('\n', noiselevel=-1)
- for revision, text in self.changelogs:
- writemsg_stdout(bold('*'+revision) + '\n' + text,
+ for chunk in self.changelogs:
+ writemsg_stdout(chunk,
noiselevel=-1)
- return
def get_display_list(self, mylist):
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index cda0b08..feebb6c 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -14,8 +14,8 @@ import sys
from portage import os
from portage import _encodings, _unicode_encode
from portage._sets.base import InternalPackageSet
-from portage.output import blue, colorize, create_color_func, green, red, \
- teal, yellow
+from portage.output import (blue, bold, colorize, create_color_func,
+ green, red, teal, yellow)
bad = create_color_func("BAD")
from portage.util import shlex_split, writemsg
from portage.versions import catpkgsplit
@@ -539,26 +539,59 @@ def _calc_changelog(ebuildpath,current,next):
divisions = divisions[i:]
break
- return divisions
+ output = []
+ prev_blank = False
+ prev_rev = False
+ for rev, lines in divisions:
+ if rev is not None:
+ if not (prev_blank or prev_rev):
+ output.append("\n")
+ output.append(bold('*' + rev) + '\n')
+ prev_rev = True
+ prev_blank = False
+ if lines:
+ prev_rev = False
+ if not prev_blank:
+ output.append("\n")
+ for l in lines:
+ output.append(l + "\n")
+ output.append("\n")
+ prev_blank = True
+ return output
+
+def _strip_header_comments(lines):
+ # strip leading and trailing blank or header/comment lines
+ i = 0
+ while i < len(lines) and (not lines[i] or lines[i][:1] == "#"):
+ i += 1
+ if i:
+ lines[:] = lines[i:]
+ while lines and (not lines[-1] or lines[-1][:1] == "#"):
+ lines.pop()
+ return lines
def _find_changelog_tags(changelog):
divs = []
release = None
- while 1:
- match = re.search(r'^\*\ ?([-a-zA-Z0-9_.+]*)(?:\ .*)?\n',changelog,re.M)
- if match is None:
- if release is not None:
- divs.append((release,changelog))
- return divs
- if release is not None:
- divs.append((release,changelog[:match.start()]))
- changelog = changelog[match.end():]
+ release_end = None
+ for match in re.finditer(r'^\*\ ?([-a-zA-Z0-9_.+]*)(?:\ .*)?$',
+ changelog, re.M):
+ if release_end is None:
+ release_end = 0
+ divs.append((release, _strip_header_comments(
+ changelog[release_end:match.start()].splitlines())))
+ release_end = match.end()
release = match.group(1)
if release.endswith('.ebuild'):
release = release[:-7]
if release.endswith('-r0'):
release = release[:-3]
+ if release_end is None:
+ release_end = 0
+ divs.append((release,
+ _strip_header_comments(changelog[release_end:].splitlines())))
+ return divs
class PkgInfo(object):
"""Simple class to hold instance attributes for current
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-03-13 17:22 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2012-03-13 17:22 UTC (permalink / raw
To: gentoo-commits
commit: 970ab392337a0584c9a329c55c58e3b930ae4af1
Author: Martin von Gagern <Martin.vGagern <AT> gmx <DOT> net>
AuthorDate: Tue Mar 13 17:15:26 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 13 17:19:03 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=970ab392
Display: spawn pkg_nofetch when appropriate
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
---
pym/_emerge/resolver/output.py | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index ef000d6..53ec4f0 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -15,6 +15,7 @@ from portage import _unicode_decode
from portage.dbapi.dep_expand import dep_expand
from portage.dep import cpvequal, _repo_separator
from portage.exception import InvalidDependString, SignatureException
+from portage.package.ebuild._spawn_nofetch import spawn_nofetch
from portage.output import ( blue, bold, colorize, create_color_func,
darkblue, darkgreen, green, nc_len, red, teal, turquoise, yellow )
bad = create_color_func("BAD")
@@ -668,7 +669,6 @@ class Display(object):
pkg_info.use = list(self.conf.pkg_use_enabled(pkg))
if not pkg.built and pkg.operation == 'merge' and \
'fetch' in pkg.metadata.restrict:
- pkg_info.fetch_symbol = red("F")
if pkg_info.ordered:
self.counters.restrict_fetch += 1
if not self.portdb.getfetchsizes(pkg.cpv,
@@ -676,6 +676,10 @@ class Display(object):
pkg_info.fetch_symbol = green("f")
if pkg_info.ordered:
self.counters.restrict_fetch_satisfied += 1
+ else:
+ pkg_info.fetch_symbol = red("F")
+ if pkg_info.ebuild_path is not None:
+ self.restrict_fetch_list[pkg] = pkg_info
return pkg_info
@@ -821,6 +825,7 @@ class Display(object):
repoadd_set = set()
self.verbose_main_repo_display = "--verbose-main-repo-display" in depgraph._frozen_config.myopts
+ self.restrict_fetch_list = {}
for mylist_index in range(len(mylist)):
pkg, depth, ordered = mylist[mylist_index]
@@ -905,6 +910,12 @@ class Display(object):
self.print_blockers()
if self.conf.verbosity == 3:
self.print_verbose(show_repos)
+ for pkg, pkg_info in self.restrict_fetch_list.items():
+ writemsg_stdout("\nFetch instructions for %s:\n" % (pkg.cpv,),
+ noiselevel=-1)
+ spawn_nofetch(self.conf.trees[pkg.root]["porttree"].dbapi,
+ pkg_info.ebuild_path,
+ settings=self.conf.pkgsettings[pkg.root])
if self.conf.changelog:
self.print_changelog()
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-01-28 2:23 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 62+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-28 2:23 UTC (permalink / raw
To: gentoo-commits
commit: 45e9d6db3e1af8303ba724e3b857b3e461f705fc
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sat Jan 28 02:20:25 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sat Jan 28 02:20:25 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=45e9d6db
Use consistent indentation in output of `emerge -p --columns ${package}`
regardless of ROOT.
---
pym/_emerge/resolver/output.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index d1c1658..ef000d6 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -437,7 +437,7 @@ class Display(object):
self.indent, self.pkgprint(pkg.cp, pkg_info))
if (self.newlp-nc_len(myprint)) > 0:
myprint = myprint+(" "*(self.newlp-nc_len(myprint)))
- myprint = myprint+"["+darkblue(ver_str)+"] "
+ myprint = myprint+" "+darkblue("["+ver_str+"]")+" "
if (self.oldlp-nc_len(myprint)) > 0:
myprint = myprint+" "*(self.oldlp-nc_len(myprint))
myprint = myprint+pkg_info.oldbest
@@ -476,7 +476,7 @@ class Display(object):
self.indent, self.pkgprint(pkg.cp, pkg_info))
if (self.newlp-nc_len(myprint)) > 0:
myprint = myprint+(" "*(self.newlp-nc_len(myprint)))
- myprint = myprint+green(" ["+ver_str+"] ")
+ myprint = myprint+" "+green("["+ver_str+"]")+" "
if (self.oldlp-nc_len(myprint)) > 0:
myprint = myprint+(" "*(self.oldlp-nc_len(myprint)))
myprint += pkg_info.oldbest
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-01-28 1:51 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 62+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-28 1:51 UTC (permalink / raw
To: gentoo-commits
commit: 7a0f34a7c2e8c4d7e14674171aefef1576d767dd
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sat Jan 28 01:50:11 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sat Jan 28 01:50:11 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7a0f34a7
Delete needless parentheses.
---
pym/_emerge/resolver/output.py | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index d3fe1d7..d1c1658 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -385,7 +385,7 @@ class Display(object):
if key[-3:] == "-r0":
key = key[:-3]
if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
- (any(x.repo != self.portdb.repositories.mainRepo().name for x in myoldbest + [pkg]))):
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in myoldbest + [pkg])):
key += _repo_separator + old_pkg.repo
versions.append(key)
myoldbest_str = blue("["+", ".join(versions)+"]")
@@ -417,7 +417,7 @@ class Display(object):
"""
ver_str = pkg_info.ver
if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
- (any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg]))):
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
ver_str += _repo_separator + pkg.repo
if self.conf.quiet:
myprint = addl + " " + self.indent + \
@@ -456,7 +456,7 @@ class Display(object):
"""
ver_str = pkg_info.ver
if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
- (any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg]))):
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
ver_str += _repo_separator + pkg.repo
if self.conf.quiet:
myprint = addl + " " + self.indent + \
@@ -493,7 +493,7 @@ class Display(object):
"""
pkg_str = pkg.cpv
if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
- (any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg]))):
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
pkg_str += _repo_separator + pkg.repo
if not pkg_info.merge:
addl = self.empty_space_in_brackets()
@@ -869,7 +869,7 @@ class Display(object):
else:
pkg_str = pkg.cpv
if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
- (any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg]))):
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
pkg_str += _repo_separator + pkg.repo
if not pkg_info.merge:
addl = self.empty_space_in_brackets()
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-01-23 17:13 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 62+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-23 17:13 UTC (permalink / raw
To: gentoo-commits
commit: b0f0f253ac206a0ae0800777fca97375107458a9
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Mon Jan 23 17:07:40 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Mon Jan 23 17:07:40 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b0f0f253
Fix display of installed version for packages, which have multiple slots
installed. Follow-up to commit 8118be36842a2db2eb72538e21a3b343773b3365.
---
pym/_emerge/resolver/output.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index b10e802..ed72b23 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -755,8 +755,9 @@ class Display(object):
installed_versions = self.vardb.match_pkgs(pkg.cp)
if self.vardb.cpv_exists(pkg.cpv):
addl = " "+yellow("R")+pkg_info.fetch_symbol+" "
- if not self.quiet_repo_display and installed_versions[0].repo != pkg.repo:
- myoldbest = installed_versions
+ installed_version = self.vardb.match_pkgs(pkg.cpv)[0]
+ if not self.quiet_repo_display and installed_version.repo != pkg.repo:
+ myoldbest = [installed_version]
if pkg_info.ordered:
if pkg_info.merge:
self.counters.reinst += 1
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-01-22 3:57 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 62+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-22 3:57 UTC (permalink / raw
To: gentoo-commits
commit: 47f16923b2f90ed589f21f44cf04abf5663b76f6
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Jan 22 03:53:59 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Jan 22 03:53:59 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=47f16923
Make the second part of_emerge.resolver.output.Display.verbose_size()
conditional on self.quiet_repo_display instead of earlier returning
if self.quiet_repo_display is False. No functional changes.
---
pym/_emerge/resolver/output.py | 50 +++++++++++++++++++--------------------
1 files changed, 24 insertions(+), 26 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index c912443..b10e802 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -339,36 +339,34 @@ class Display(object):
self.counters.totalsize += mysize
self.verboseadd += _format_size(mysize)
- if not self.quiet_repo_display:
- return
-
- # overlay verbose
- # assign index for a previous version in the same slot
- slot_matches = self.vardb.match(pkg.slot_atom)
- if slot_matches:
- repo_name_prev = self.vardb.aux_get(slot_matches[0],
- ["repository"])[0]
- else:
- repo_name_prev = None
+ if self.quiet_repo_display:
+ # overlay verbose
+ # assign index for a previous version in the same slot
+ slot_matches = self.vardb.match(pkg.slot_atom)
+ if slot_matches:
+ repo_name_prev = self.vardb.aux_get(slot_matches[0],
+ ["repository"])[0]
+ else:
+ repo_name_prev = None
- # now use the data to generate output
- if pkg.installed or not slot_matches:
- self.repoadd = self.conf.repo_display.repoStr(
- pkg_info.repo_path_real)
- else:
- repo_path_prev = None
- if repo_name_prev:
- repo_path_prev = self.portdb.getRepositoryPath(
- repo_name_prev)
- if repo_path_prev == pkg_info.repo_path_real:
+ # now use the data to generate output
+ if pkg.installed or not slot_matches:
self.repoadd = self.conf.repo_display.repoStr(
pkg_info.repo_path_real)
else:
- self.repoadd = "%s=>%s" % (
- self.conf.repo_display.repoStr(repo_path_prev),
- self.conf.repo_display.repoStr(pkg_info.repo_path_real))
- if self.repoadd:
- repoadd_set.add(self.repoadd)
+ repo_path_prev = None
+ if repo_name_prev:
+ repo_path_prev = self.portdb.getRepositoryPath(
+ repo_name_prev)
+ if repo_path_prev == pkg_info.repo_path_real:
+ self.repoadd = self.conf.repo_display.repoStr(
+ pkg_info.repo_path_real)
+ else:
+ self.repoadd = "%s=>%s" % (
+ self.conf.repo_display.repoStr(repo_path_prev),
+ self.conf.repo_display.repoStr(pkg_info.repo_path_real))
+ if self.repoadd:
+ repoadd_set.add(self.repoadd)
def convert_myoldbest(self, myoldbest):
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2012-01-22 3:47 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 62+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-22 3:47 UTC (permalink / raw
To: gentoo-commits
commit: 8118be36842a2db2eb72538e21a3b343773b3365
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Jan 22 03:43:03 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Jan 22 03:43:03 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8118be36
Print [${old_version}::${old_repository}] in output of `emerge -pv ${package}`
when ${old_version} is the same as ${new_version}, but ${old_repository} is
different than ${new_repository}.
---
pym/_emerge/resolver/output.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 15f9225..c912443 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
"""Resolver output display operation.
@@ -757,6 +757,8 @@ class Display(object):
installed_versions = self.vardb.match_pkgs(pkg.cp)
if self.vardb.cpv_exists(pkg.cpv):
addl = " "+yellow("R")+pkg_info.fetch_symbol+" "
+ if not self.quiet_repo_display and installed_versions[0].repo != pkg.repo:
+ myoldbest = installed_versions
if pkg_info.ordered:
if pkg_info.merge:
self.counters.reinst += 1
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-11-18 5:58 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-11-18 5:58 UTC (permalink / raw
To: gentoo-commits
commit: d47f28881fcdd57d239e9b6e57ccb2755855d4ca
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 18 05:57:58 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 18 05:57:58 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d47f2888
resolver/output: unused imports
---
pym/_emerge/resolver/output.py | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 6f1c76c..b73b190 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -13,14 +13,13 @@ import sys
from portage import os
from portage import _unicode_decode
from portage.dbapi.dep_expand import dep_expand
-from portage.const import PORTAGE_PACKAGE_ATOM
-from portage.dep import cpvequal, match_from_list
+from portage.dep import cpvequal
from portage.exception import InvalidDependString, SignatureException
from portage.output import ( blue, bold, colorize, create_color_func,
darkblue, darkgreen, green, nc_len, red, teal, turquoise, yellow )
bad = create_color_func("BAD")
-from portage.util import writemsg_stdout, writemsg_level
-from portage.versions import best, catpkgsplit, cpv_getkey
+from portage.util import writemsg_stdout
+from portage.versions import best, catpkgsplit
from _emerge.Blocker import Blocker
from _emerge.create_world_atom import create_world_atom
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-11-18 1:43 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-11-18 1:43 UTC (permalink / raw
To: gentoo-commits
commit: 3a60d4637ce9c69936f977a79d636c51257cc886
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 18 01:43:20 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 18 01:43:20 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3a60d463
emerge --changelog: omit entry for current ver
This is a regression from commit
69d7f169ba2e27cf56746791331c63a019357100, reported in bug #390893.
---
pym/_emerge/resolver/output_helpers.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index dd26534..4587661 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -519,10 +519,11 @@ def _calc_changelog(ebuildpath,current,next):
except EnvironmentError:
return []
for node in _find_changelog_tags(changelog):
- divisions.append(node)
if node[0] == current:
found_current = True
break
+ else:
+ divisions.append(node)
if found_current:
break
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-11-07 18:34 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-11-07 18:34 UTC (permalink / raw
To: gentoo-commits
commit: c88e394bfeafa16ac5dc75232b9b9b139f76e59c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 7 18:33:47 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 7 18:34:28 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c88e394b
Fix breakage from last commit.
---
pym/_emerge/resolver/circular_dependency.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py
index 62d5556..aca81fa 100644
--- a/pym/_emerge/resolver/circular_dependency.py
+++ b/pym/_emerge/resolver/circular_dependency.py
@@ -186,7 +186,7 @@ class circular_dependency_handler(object):
parent_atom not in reduced_dep:
#We found an assignment that removes the atom from 'dep'.
#Make sure it doesn't conflict with REQUIRED_USE.
- required_use = parent.metadata.get("REQUIRED_USE", "")]
+ required_use = parent.metadata.get("REQUIRED_USE", "")
if check_required_use(required_use, current_use, parent.iuse.is_valid_flag):
use = self.depgraph._pkg_use_enabled(parent)
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-11-07 7:37 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-11-07 7:37 UTC (permalink / raw
To: gentoo-commits
commit: 69d7f169ba2e27cf56746791331c63a019357100
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 7 07:37:33 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 7 07:37:33 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=69d7f169
emerge --changelog: ChangeLog-YYYY, bug #389611
---
pym/_emerge/resolver/output_helpers.py | 49 +++++++++++++++++++------------
1 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index 151c505..b3cdbc4 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -500,17 +500,36 @@ def _calc_changelog(ebuildpath,current,next):
next = '-'.join(catpkgsplit(next)[1:])
if next.endswith('-r0'):
next = next[:-3]
- changelogpath = os.path.join(os.path.split(ebuildpath)[0],'ChangeLog')
- try:
- changelog = io.open(_unicode_encode(changelogpath,
- encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['repo.content'], errors='replace'
- ).read()
- except SystemExit:
- raise # Needed else can't exit
- except:
+
+ changelogdir = os.path.dirname(ebuildpath)
+ changelogs = ['ChangeLog']
+ # ChangeLog-YYYY (see bug #389611)
+ changelogs.extend(sorted((fn for fn in os.listdir(changelogdir)
+ if fn.startswith('ChangeLog-')), reverse=True))
+
+ divisions = []
+ found_current = False
+ for fn in changelogs:
+ changelogpath = os.path.join(changelogdir, fn)
+ try:
+ with io.open(_unicode_encode(changelogpath,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'],
+ errors='replace') as f:
+ changelog = f.read()
+ except EnvironmentError:
+ return []
+ for node in _find_changelog_tags(changelog):
+ divisions.append(node)
+ if node[0] == current:
+ found_current = True
+ break
+ if found_current:
+ break
+
+ if not found_current:
return []
- divisions = _find_changelog_tags(changelog)
+
#print 'XX from',current,'to',next
#for div,text in divisions: print 'XX',div
# skip entries for all revisions above the one we are about to emerge
@@ -518,16 +537,8 @@ def _calc_changelog(ebuildpath,current,next):
if divisions[i][0]==next:
divisions = divisions[i:]
break
- # find out how many entries we are going to display
- for i in range(len(divisions)):
- if divisions[i][0]==current:
- divisions = divisions[:i]
- break
- else:
- # couldnt find the current revision in the list. display nothing
- return []
- return divisions
+ return divisions
def _find_changelog_tags(changelog):
divs = []
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-10-19 21:32 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-10-19 21:32 UTC (permalink / raw
To: gentoo-commits
commit: 36fd75fbc3f6b0f3dbae655c0b1b125735f8d90b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 19 21:32:40 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct 19 21:32:40 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=36fd75fb
resolver/output: use set for myfetchlist hashing
---
pym/_emerge/resolver/output.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 7bfe007..eed3019 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -335,7 +335,7 @@ class Display(object):
for myfetchfile in myfilesdict:
if myfetchfile not in self.myfetchlist:
mysize += myfilesdict[myfetchfile]
- self.myfetchlist.append(myfetchfile)
+ self.myfetchlist.add(myfetchfile)
if pkg_info.ordered:
self.counters.totalsize += mysize
self.verboseadd += _format_size(mysize)
@@ -795,7 +795,7 @@ class Display(object):
mylist = self.get_display_list(self.conf.mylist)
# files to fetch list - avoids counting a same file twice
# in size display (verbose mode)
- self.myfetchlist = []
+ self.myfetchlist = set()
# Use this set to detect when all the "repoadd" strings are "[0]"
# and disable the entire repo display in this case.
repoadd_set = set()
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-10-19 21:25 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-10-19 21:25 UTC (permalink / raw
To: gentoo-commits
commit: 3824bdfdaa848d266320d47f22f27498c3d300b5
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 19 21:25:35 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct 19 21:25:35 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3824bdfd
resolver/output: display binary fetch size
---
pym/_emerge/resolver/output.py | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index f74d13a..7bfe007 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -15,7 +15,7 @@ from portage import _unicode_decode
from portage.dbapi.dep_expand import dep_expand
from portage.const import PORTAGE_PACKAGE_ATOM
from portage.dep import cpvequal, match_from_list
-from portage.exception import InvalidDependString
+from portage.exception import InvalidDependString, SignatureException
from portage.output import ( blue, bold, colorize, create_color_func,
darkblue, darkgreen, green, nc_len, red, teal, turquoise, yellow )
bad = create_color_func("BAD")
@@ -309,17 +309,26 @@ class Display(object):
self.verboseadd, repoadd_set.
"""
mysize = 0
- if pkg.type_name == "ebuild" and pkg_info.merge:
+ if pkg.type_name in ("binary", "ebuild") and pkg_info.merge:
+ db = pkg.root_config.trees[
+ pkg.root_config.pkg_tree_map[pkg.type_name]].dbapi
+ kwargs = {}
+ if pkg.type_name == "ebuild":
+ kwargs["useflags"] = pkg_info.use
+ kwargs["myrepo"] = pkg.repo
+ myfilesdict = None
try:
- myfilesdict = self.portdb.getfetchsizes(pkg.cpv,
- useflags=pkg_info.use, myrepo=pkg.repo)
+ myfilesdict = db.getfetchsizes(pkg.cpv, **kwargs)
except InvalidDependString as e:
# FIXME: validate SRC_URI earlier
- depstr, = self.portdb.aux_get(pkg.cpv,
+ depstr, = db.aux_get(pkg.cpv,
["SRC_URI"], myrepo=pkg.repo)
show_invalid_depstring_notice(
pkg, depstr, str(e))
raise
+ except SignatureException:
+ # missing/invalid binary package SIZE signature
+ pass
if myfilesdict is None:
myfilesdict = "[empty/missing/bad digest]"
else:
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-10-02 20:11 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-10-02 20:11 UTC (permalink / raw
To: gentoo-commits
commit: 053ce10dcaa85a61d0049cd08b4e725d67a271f6
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 2 20:09:52 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 2 20:09:52 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=053ce10d
print_changelog: if no changelogs, no newline
This will fix bug #385413.
---
pym/_emerge/resolver/output.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 05e316a..f74d13a 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -574,6 +574,8 @@ class Display(object):
def print_changelog(self):
"""Prints the changelog text to std_out
"""
+ if not self.changelogs:
+ return
writemsg_stdout('\n', noiselevel=-1)
for revision, text in self.changelogs:
writemsg_stdout(bold('*'+revision) + '\n' + text,
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-09-17 17:51 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-09-17 17:51 UTC (permalink / raw
To: gentoo-commits
commit: c5ffb546b7833dfcefffe7c68ab3a3f040139a91
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 17 17:51:26 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 17 17:51:26 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c5ffb546
_RepoDisplay: split PORTDIR_OVERLAY with shlex
This fixes the issue in bug #383269, comment #8.
---
pym/_emerge/resolver/output_helpers.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py
index b7e7376..151c505 100644
--- a/pym/_emerge/resolver/output_helpers.py
+++ b/pym/_emerge/resolver/output_helpers.py
@@ -17,7 +17,7 @@ from portage._sets.base import InternalPackageSet
from portage.output import blue, colorize, create_color_func, green, red, \
teal, yellow
bad = create_color_func("BAD")
-from portage.util import writemsg
+from portage.util import shlex_split, writemsg
from portage.versions import catpkgsplit
from _emerge.Blocker import Blocker
@@ -39,7 +39,7 @@ class _RepoDisplay(object):
repo_paths.add(portdir)
overlays = root_config.settings.get("PORTDIR_OVERLAY")
if overlays:
- repo_paths.update(overlays.split())
+ repo_paths.update(shlex_split(overlays))
repo_paths = list(repo_paths)
self._repo_paths = repo_paths
self._repo_paths_real = [ os.path.realpath(repo_path) \
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-07-27 10:34 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-07-27 10:34 UTC (permalink / raw
To: gentoo-commits
commit: 7bc0f420943278f3efcbb2e33c949c393ab99a09
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 27 10:34:09 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jul 27 10:34:09 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7bc0f420
depgraph: handle invalid SRC_URI
This is a minimal fix for bug #376577.
---
pym/_emerge/resolver/output.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index 69a30cc..05e316a 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -26,6 +26,7 @@ from _emerge.Blocker import Blocker
from _emerge.create_world_atom import create_world_atom
from _emerge.resolver.output_helpers import ( _DisplayConfig, _tree_display,
_PackageCounters, _create_use_string, _format_size, _calc_changelog, PkgInfo)
+from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice
if sys.hexversion >= 0x3000000:
basestring = str
@@ -312,8 +313,12 @@ class Display(object):
try:
myfilesdict = self.portdb.getfetchsizes(pkg.cpv,
useflags=pkg_info.use, myrepo=pkg.repo)
- except InvalidDependString:
- # should have been masked before it was selected
+ except InvalidDependString as e:
+ # FIXME: validate SRC_URI earlier
+ depstr, = self.portdb.aux_get(pkg.cpv,
+ ["SRC_URI"], myrepo=pkg.repo)
+ show_invalid_depstring_notice(
+ pkg, depstr, str(e))
raise
if myfilesdict is None:
myfilesdict = "[empty/missing/bad digest]"
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-07-10 13:35 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-07-10 13:35 UTC (permalink / raw
To: gentoo-commits
commit: c36a0214d9690f893341d199a834c8ffc506d5bd
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 13:33:23 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 13:33:23 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c36a0214
circular_dependency: fix total_flags calc
---
pym/_emerge/resolver/circular_dependency.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py
index e4d679f..d113c5e 100644
--- a/pym/_emerge/resolver/circular_dependency.py
+++ b/pym/_emerge/resolver/circular_dependency.py
@@ -152,9 +152,9 @@ class circular_dependency_handler(object):
# exponentially related (see bug #374397).
total_flags = set()
total_flags.update(affecting_use, required_use_flags)
+ total_flags.difference_update(untouchable_flags)
if len(total_flags) <= 10:
- affecting_use.update(required_use_flags)
- affecting_use.difference_update(untouchable_flags)
+ affecting_use = total_flags
affecting_use = tuple(affecting_use)
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-07-10 12:23 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-07-10 12:23 UTC (permalink / raw
To: gentoo-commits
commit: 0dfe36c463f2aeca4bbdb15f8aa3bdb2fd60ef86
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 12:05:58 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 12:05:58 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0dfe36c4
slot_collision: fix more for bug 374423
---
pym/_emerge/resolver/slot_collision.py | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index 0069d17..0df8f20 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -588,6 +588,15 @@ class slot_conflict_handler(object):
else:
violated_atom = atom.unevaluated_atom.violated_conditionals(_pkg_use_enabled(pkg), \
pkg.iuse.is_valid_flag, parent_use=_pkg_use_enabled(ppkg))
+ if violated_atom.use is None:
+ # It's possible for autounmask to change
+ # parent_use such that the unevaluated form
+ # of the atom now matches, even though the
+ # earlier evaluated form (from before
+ # autounmask changed parent_use) does not.
+ # In this case (see bug #374423), it's
+ # expected that violated_atom.use is None.
+ continue
if pkg.installed and (violated_atom.use.enabled or violated_atom.use.disabled):
#We can't change USE of an installed package (only of an ebuild, but that is already
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-07-10 10:41 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-07-10 10:41 UTC (permalink / raw
To: gentoo-commits
commit: f085533e820e7dac48c5192aa0ae3b7fb887059d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 10:40:59 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 10:40:59 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f085533e
slot_collision: fix AttributeError for bug 374423
---
pym/_emerge/resolver/slot_collision.py | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index 0042997..0069d17 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -349,6 +349,20 @@ class slot_conflict_handler(object):
_pkg_use_enabled(other_pkg),
other_pkg.iuse.is_valid_flag,
parent_use=parent_use)
+ # It's possible for autounmask to change
+ # parent_use such that the unevaluated form
+ # of the atom now matches, even though the
+ # earlier evaluated form (from before
+ # autounmask changed parent_use) does not.
+ # In this case (see bug #374423), it's
+ # expected that violated_atom.use is None.
+ # Since the atom now matches, we don't want
+ # to display it in the slot conflict
+ # message, so we simply ignore it and rely
+ # on the autounmask display to communicate
+ # the necessary USE change to the user.
+ if violated_atom.use is None:
+ continue
if use in violated_atom.use.enabled or \
use in violated_atom.use.disabled:
unconditional_use_deps.add((ppkg, atom))
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-07-10 1:58 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-07-10 1:58 UTC (permalink / raw
To: gentoo-commits
commit: 05a8d3512c5880d45f2e44b95127c2cac676be9d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 01:57:50 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 01:57:50 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=05a8d351
circular_dependency: fix REQUIRED_USE test
---
pym/_emerge/resolver/circular_dependency.py | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py
index cb64962..e4d679f 100644
--- a/pym/_emerge/resolver/circular_dependency.py
+++ b/pym/_emerge/resolver/circular_dependency.py
@@ -138,7 +138,24 @@ class circular_dependency_handler(object):
usemask, useforce = self._get_use_mask_and_force(parent)
autounmask_changes = self._get_autounmask_changes(parent)
untouchable_flags = frozenset(chain(usemask, useforce, autounmask_changes))
+
affecting_use.difference_update(untouchable_flags)
+
+ #If any of the flags we're going to touch is in REQUIRED_USE, add all
+ #other flags in REQUIRED_USE to affecting_use, to not lose any solution.
+ required_use_flags = get_required_use_flags(parent.metadata["REQUIRED_USE"])
+
+ if affecting_use.intersection(required_use_flags):
+ # TODO: Find out exactly which REQUIRED_USE flags are
+ # entangled with affecting_use. We have to limit the
+ # number of flags since the number of loops is
+ # exponentially related (see bug #374397).
+ total_flags = set()
+ total_flags.update(affecting_use, required_use_flags)
+ if len(total_flags) <= 10:
+ affecting_use.update(required_use_flags)
+ affecting_use.difference_update(untouchable_flags)
+
affecting_use = tuple(affecting_use)
if not affecting_use:
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-07-10 1:31 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-07-10 1:31 UTC (permalink / raw
To: gentoo-commits
commit: 58766559735c0d643bf1a9e5f2979ec6548fff94
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 01:26:26 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 01:26:26 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=58766559
circular_dependency: fix ridiculously long loop
The flags from REQUIRED_USE were added to affecting_use, which was not
really necessary and was a bad idea because a number of flags in
affecting_use affects our number of loops exponentially. This will fix
bug #374397 in which the large number of flags in the REQUIRED_USE of
dev-lang/php-5.3.6-r1 triggered execution of 2 ^ 45 loops.
---
pym/_emerge/resolver/circular_dependency.py | 10 ----------
1 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py
index 994e202..cb64962 100644
--- a/pym/_emerge/resolver/circular_dependency.py
+++ b/pym/_emerge/resolver/circular_dependency.py
@@ -138,17 +138,7 @@ class circular_dependency_handler(object):
usemask, useforce = self._get_use_mask_and_force(parent)
autounmask_changes = self._get_autounmask_changes(parent)
untouchable_flags = frozenset(chain(usemask, useforce, autounmask_changes))
-
affecting_use.difference_update(untouchable_flags)
-
- #If any of the flags we're going to touch is in REQUIRED_USE, add all
- #other flags in REQUIRED_USE to affecting_use, to not lose any solution.
- required_use_flags = get_required_use_flags(parent.metadata["REQUIRED_USE"])
-
- if affecting_use.intersection(required_use_flags):
- affecting_use.update(required_use_flags)
- affecting_use.difference_update(untouchable_flags)
-
affecting_use = tuple(affecting_use)
if not affecting_use:
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-07-09 22:24 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-07-09 22:24 UTC (permalink / raw
To: gentoo-commits
commit: 50da885309a3a69f0927a730e19026734523b090
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 9 22:23:52 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul 9 22:23:52 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=50da8853
circular_dependency: use itertools.product()
Python's cartesian product function does exactly what we want, so use
it to simplify our code.
---
pym/_emerge/resolver/circular_dependency.py | 27 +++------------------------
1 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py
index 1789801..9a3286c 100644
--- a/pym/_emerge/resolver/circular_dependency.py
+++ b/pym/_emerge/resolver/circular_dependency.py
@@ -3,7 +3,7 @@
from __future__ import print_function
-from itertools import chain
+from itertools import chain, product
from portage.dep import use_reduce, extract_affecting_use, check_required_use, get_required_use_flags
from portage.exception import InvalidDependString
@@ -147,27 +147,9 @@ class circular_dependency_handler(object):
#We iterate over all possible settings of these use flags and gather
#a set of possible changes
#TODO: Use the information encoded in REQUIRED_USE
- use_state = []
- for flag in affecting_use:
- use_state.append("disabled")
-
- def _next_use_state(state, id=None):
- if id is None:
- id = len(state)-1
-
- if id == 0 and state[0] == "enabled":
- return False
-
- if state[id] == "disabled":
- state[id] = "enabled"
- for i in range(id+1,len(state)):
- state[i] = "disabled"
- return True
- else:
- return _next_use_state(state, id-1)
-
solutions = set()
- while(True):
+ for use_state in product(("disabled", "enabled"),
+ repeat=len(affecting_use)):
current_use = set(self.depgraph._pkg_use_enabled(parent))
for flag, state in zip(affecting_use, use_state):
if state == "enabled":
@@ -200,9 +182,6 @@ class circular_dependency_handler(object):
solution.add((flag, False))
solutions.add(frozenset(solution))
- if not _next_use_state(use_state):
- break
-
for solution in solutions:
ignore_solution = False
for other_solution in solutions:
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-06-11 1:31 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-06-11 1:31 UTC (permalink / raw
To: gentoo-commits
commit: 6d3bae4d1d48033668107863bf30d483792350e9
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 01:30:37 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 01:30:37 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6d3bae4d
slot_collision_notice: don't omit any use dep
When USE flags are removed, it can be essential to see all broken
reverse dependencies here, so don't omit any. If the list is long,
people can simply use a pager.
---
pym/_emerge/resolver/slot_collision.py | 30 ++++++++++++++++--------------
1 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index 8847659..d43b889 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -309,6 +309,7 @@ class slot_conflict_handler(object):
msg.append(" pulled in by\n")
selected_for_display = set()
+ unconditional_use_deps = set()
for (type, sub_type), parents in collision_reasons.items():
#From each (type, sub_type) pair select at least one atom.
@@ -335,8 +336,6 @@ class slot_conflict_handler(object):
#not possible to change them on the parent, which means there
#are fewer possible solutions.
use = sub_type
- hard_matches = set()
- conditional_matches = set()
for ppkg, atom, other_pkg in parents:
parent_use = None
if isinstance(ppkg, Package):
@@ -345,17 +344,13 @@ class slot_conflict_handler(object):
_pkg_use_enabled(other_pkg), other_pkg.iuse.is_valid_flag,
parent_use=parent_use)
if use in violated_atom.use.enabled.union(violated_atom.use.disabled):
- hard_matches.add((ppkg, atom))
- else:
- conditional_matches.add((ppkg, atom))
-
- if hard_matches:
- matches = hard_matches
- else:
- matches = conditional_matches
-
- if not selected_for_display.intersection(matches):
- selected_for_display.add(matches.pop())
+ unconditional_use_deps.add((ppkg, atom))
+ # When USE flags are removed, it can be
+ # essential to see all broken reverse
+ # dependencies here, so don't omit any.
+ # If the list is long, people can simply
+ # use a pager.
+ selected_for_display.add((ppkg, atom))
def highlight_violations(atom, version, use=[]):
"""Colorize parts of an atom"""
@@ -400,7 +395,14 @@ class slot_conflict_handler(object):
return atom_str
- for parent_atom in selected_for_display:
+ # Show unconditional use deps first, since those
+ # are more problematic than the conditional kind.
+ ordered_list = list(unconditional_use_deps)
+ if len(selected_for_display) > len(unconditional_use_deps):
+ for parent_atom in selected_for_display:
+ if parent_atom not in unconditional_use_deps:
+ ordered_list.append(parent_atom)
+ for parent_atom in ordered_list:
parent, atom = parent_atom
msg.append(2*indent)
if isinstance(parent,
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
@ 2011-03-15 22:59 Zac Medico
0 siblings, 0 replies; 62+ messages in thread
From: Zac Medico @ 2011-03-15 22:59 UTC (permalink / raw
To: gentoo-commits
commit: 07cd002a0e2a32eaa672a5f3e2e070f1aac18daf
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 15 22:58:02 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 15 22:58:02 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=07cd002a
slot_conflict: tweak message and fix grammar
---
pym/_emerge/resolver/slot_collision.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index b3d816b..f130422 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -457,7 +457,7 @@ class slot_conflict_handler(object):
if self.conflict_is_unspecific and \
not ("--newuse" in self.myopts and "--update" in self.myopts):
msg += "!!! Enabling --newuse and --update might solve this conflict.\n"
- msg += "!!! If not, it might at least allow emerge to give a suggestions.\n\n"
+ msg += "!!! If not, it might help emerge to give a more specific suggestion.\n\n"
return msg
solutions = self.solutions
^ permalink raw reply related [flat|nested] 62+ messages in thread
end of thread, other threads:[~2017-10-04 0:30 UTC | newest]
Thread overview: 62+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-21 8:15 [gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2017-10-04 0:30 Zac Medico
2016-12-19 5:15 Zac Medico
2016-05-27 8:33 Alexander Berntsen
2015-08-03 18:36 Zac Medico
2015-07-29 18:44 Zac Medico
2014-12-13 14:51 Arfrever Frehtes Taifersar Arahesis
2014-08-23 7:21 Zac Medico
2014-02-23 21:38 Sebastian Luther
2014-02-05 19:42 Sebastian Luther
2014-02-05 19:42 Sebastian Luther
2013-03-20 20:32 Zac Medico
2013-03-20 19:23 Zac Medico
2013-03-18 21:28 Zac Medico
2013-03-18 21:12 Zac Medico
2013-03-18 20:58 Zac Medico
2013-02-28 0:25 Zac Medico
2013-02-28 0:12 Zac Medico
2013-02-27 23:39 Zac Medico
2013-01-24 1:18 Zac Medico
2012-10-15 17:17 Arfrever Frehtes Taifersar Arahesis
2012-10-15 4:06 Arfrever Frehtes Taifersar Arahesis
2012-10-14 20:02 Arfrever Frehtes Taifersar Arahesis
2012-10-14 19:54 Arfrever Frehtes Taifersar Arahesis
2012-10-14 2:53 Zac Medico
2012-10-14 2:44 Zac Medico
2012-09-25 2:00 Zac Medico
2012-09-24 3:12 Zac Medico
2012-09-14 2:08 Zac Medico
2012-09-14 1:04 Zac Medico
2012-06-27 21:56 Zac Medico
2012-06-23 6:00 Zac Medico
2012-06-21 4:43 Zac Medico
2012-06-20 21:24 Zac Medico
2012-04-05 19:37 Zac Medico
2012-03-22 19:00 Zac Medico
2012-03-22 18:10 Zac Medico
2012-03-22 17:38 Zac Medico
2012-03-22 17:15 Zac Medico
2012-03-13 17:22 Zac Medico
2012-01-28 2:23 Arfrever Frehtes Taifersar Arahesis
2012-01-28 1:51 Arfrever Frehtes Taifersar Arahesis
2012-01-23 17:13 Arfrever Frehtes Taifersar Arahesis
2012-01-22 3:57 Arfrever Frehtes Taifersar Arahesis
2012-01-22 3:47 Arfrever Frehtes Taifersar Arahesis
2011-11-18 5:58 Zac Medico
2011-11-18 1:43 Zac Medico
2011-11-07 18:34 Zac Medico
2011-11-07 7:37 Zac Medico
2011-10-19 21:32 Zac Medico
2011-10-19 21:25 Zac Medico
2011-10-02 20:11 Zac Medico
2011-09-17 17:51 Zac Medico
2011-07-27 10:34 Zac Medico
2011-07-10 13:35 Zac Medico
2011-07-10 12:23 Zac Medico
2011-07-10 10:41 Zac Medico
2011-07-10 1:58 Zac Medico
2011-07-10 1:31 Zac Medico
2011-07-09 22:24 Zac Medico
2011-06-11 1:31 Zac Medico
2011-03-15 22:59 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox