public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/
@ 2019-01-20  7:24 Zac Medico
  0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2019-01-20  7:24 UTC (permalink / raw
  To: gentoo-commits

commit:     9cce0dad3f45b15f8f069a552ac6c91b9dfdd769
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Jan 18 08:42:09 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 20 07:05:17 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9cce0dad

emerge: compare new slot USE to installed slot

For new-slot package installation, show USE flags added/deleted in
comparison with highest installed other-slot package instance

Bug: https://bugs.gentoo.org/675756
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/resolver/output.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py
index 24340576c..ed88cc51f 100644
--- a/lib/_emerge/resolver/output.py
+++ b/lib/_emerge/resolver/output.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2018 Gentoo Foundation
+# Copyright 2010-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 """Resolver output display operation.
@@ -673,9 +673,14 @@ class Display(object):
 			pkg_info.previous_pkg = self.vardb.match_pkgs(
 				Atom('=' + pkg.cpv))[0]
 		else:
-			slot_matches = self.vardb.match_pkgs(pkg.slot_atom)
-			if slot_matches:
-				pkg_info.previous_pkg = slot_matches[0]
+			cp_slot_matches = self.vardb.match_pkgs(pkg.slot_atom)
+			if cp_slot_matches:
+				pkg_info.previous_pkg = cp_slot_matches[0]
+			else:
+				cp_matches = self.vardb.match_pkgs(Atom(pkg.cp))
+				if cp_matches:
+					# Use highest installed other-slot package instance.
+					pkg_info.previous_pkg = cp_matches[-1]
 
 		return pkg_info
 


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/
@ 2020-08-03  3:08 Zac Medico
  0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2020-08-03  3:08 UTC (permalink / raw
  To: gentoo-commits

commit:     602d2cd487bb48788e9654a7b7fd5a3be34150d9
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 02:53:42 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 03:07:31 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=602d2cd4

lib/_emerge/resolver/slot_collision.py: fix redefined-builtin W0622

* This fixes the referenced warning by renaming the 'id' variable to
 'name' and the 'type' variable to 'atype'
* Additional cosmetic/style changes found along the way.

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/resolver/slot_collision.py | 74 +++++++++++++++++-----------------
 1 file changed, 37 insertions(+), 37 deletions(-)

diff --git a/lib/_emerge/resolver/slot_collision.py b/lib/_emerge/resolver/slot_collision.py
index cc16287de..2b8f59953 100644
--- a/lib/_emerge/resolver/slot_collision.py
+++ b/lib/_emerge/resolver/slot_collision.py
@@ -591,14 +591,14 @@ class slot_conflict_handler:
 							version_violated = False
 							slot_violated = False
 							use = []
-							for (type, sub_type), parents in collision_reasons.items():
+							for (ctype, sub_type), parents in collision_reasons.items():
 								for x in parents:
 									if parent == x[0] and atom == x[1]:
-										if type == "version":
+										if ctype == "version":
 											version_violated = True
-										elif type == "slot":
+										elif ctype == "slot":
 											slot_violated = True
-										elif type == "use":
+										elif ctype == "use":
 											use.append(sub_type)
 										break
 
@@ -934,64 +934,64 @@ class slot_conflict_handler:
 				msg += "}"
 			msg += "]\n"
 			writemsg(msg, noiselevel=-1)
-		
+
 		required_changes = {}
-		for id, pkg in enumerate(config):
+		for idx, pkg in enumerate(config):
 			if not pkg.installed:
-				#We can't change the USE of installed packages.
-				for flag in all_involved_flags[id]:
+				# We can't change the USE of installed packages.
+				for flag in all_involved_flags[idx]:
 					if not pkg.iuse.is_valid_flag(flag):
 						continue
-					state = all_involved_flags[id][flag]
+					state = all_involved_flags[idx][flag]
 					self._force_flag_for_package(required_changes, pkg, flag, state)
 
-			#Go through all (parent, atom) pairs for the current slot conflict.
-			for ppkg, atom in all_conflict_atoms_by_slotatom[id]:
+			# Go through all (parent, atom) pairs for the current slot conflict.
+			for ppkg, atom in all_conflict_atoms_by_slotatom[idx]:
 				if not atom.package:
 					continue
 				use = atom.unevaluated_atom.use
 				if not use:
-					#No need to force something for an atom without USE conditionals.
-					#These atoms are already satisfied.
+					# No need to force something for an atom without USE conditionals.
+					# These atoms are already satisfied.
 					continue
-				for flag in all_involved_flags[id]:
-					state = all_involved_flags[id][flag]
+				for flag in all_involved_flags[idx]:
+					state = all_involved_flags[idx][flag]
 					
 					if flag not in use.required or not use.conditional:
 						continue
 					if flag in use.conditional.enabled:
-						#[flag?]
+						# [flag?]
 						if state == "enabled":
-							#no need to change anything, the atom won't
-							#force -flag on pkg
+							# no need to change anything, the atom won't
+							# force -flag on pkg
 							pass
 						elif state == "disabled":
-							#if flag is enabled we get [flag] -> it must be disabled
+							# if flag is enabled we get [flag] -> it must be disabled
 							self._force_flag_for_package(required_changes, ppkg, flag, "disabled")
 					elif flag in use.conditional.disabled:
-						#[!flag?]
+						# [!flag?]
 						if state == "enabled":
-							#if flag is enabled we get [-flag] -> it must be disabled
+							# if flag is enabled we get [-flag] -> it must be disabled
 							self._force_flag_for_package(required_changes, ppkg, flag, "disabled")
 						elif state == "disabled":
-							#no need to change anything, the atom won't
-							#force +flag on pkg
+							# no need to change anything, the atom won't
+							# force +flag on pkg
 							pass
 					elif flag in use.conditional.equal:
-						#[flag=]
+						# [flag=]
 						if state == "enabled":
-							#if flag is disabled we get [-flag] -> it must be enabled
+							# if flag is disabled we get [-flag] -> it must be enabled
 							self._force_flag_for_package(required_changes, ppkg, flag, "enabled")
 						elif state == "disabled":
-							#if flag is enabled we get [flag] -> it must be disabled
+							# if flag is enabled we get [flag] -> it must be disabled
 							self._force_flag_for_package(required_changes, ppkg, flag, "disabled")
 					elif flag in use.conditional.not_equal:
-						#[!flag=]
+						# [!flag=]
 						if state == "enabled":
-							#if flag is enabled we get [-flag] -> it must be disabled
+							# if flag is enabled we get [-flag] -> it must be disabled
 							self._force_flag_for_package(required_changes, ppkg, flag, "disabled")
 						elif state == "disabled":
-							#if flag is disabled we get [flag] -> it must be enabled
+							# if flag is disabled we get [flag] -> it must be enabled
 							self._force_flag_for_package(required_changes, ppkg, flag, "enabled")
 
 		is_valid_solution = True
@@ -999,12 +999,12 @@ class slot_conflict_handler:
 			for state in required_changes[pkg].values():
 				if not state in ("enabled", "disabled"):
 					is_valid_solution = False
-		
+
 		if not is_valid_solution:
 			return None
 
-		#Check if all atoms are satisfied after the changes are applied.
-		for id, pkg in enumerate(config):
+		# Check if all atoms are satisfied after the changes are applied.
+		for idx, pkg in enumerate(config):
 			new_use = _pkg_use_enabled(pkg)
 			if pkg in required_changes:
 				old_use = pkg.use.enabled
@@ -1015,14 +1015,14 @@ class slot_conflict_handler:
 					elif state == "disabled":
 						new_use.discard(flag)
 				if not new_use.symmetric_difference(old_use):
-					#avoid copying the package in findAtomForPackage if possible
+					# avoid copying the package in findAtomForPackage if possible
 					new_use = old_use
 
-			for ppkg, atom in all_conflict_atoms_by_slotatom[id]:
+			for ppkg, atom in all_conflict_atoms_by_slotatom[idx]:
 				if not atom.package:
 					continue
 				if not hasattr(ppkg, "use"):
-					#It's a SetArg or something like that.
+					# It's a SetArg or something like that.
 					continue
 				ppkg_new_use = set(_pkg_use_enabled(ppkg))
 				if ppkg in required_changes:
@@ -1035,7 +1035,7 @@ class slot_conflict_handler:
 				new_atom = atom.unevaluated_atom.evaluate_conditionals(ppkg_new_use)
 				i = InternalPackageSet(initial_atoms=(new_atom,))
 				if not i.findAtomForPackage(pkg, new_use):
-					#We managed to create a new problem with our changes.
+					# We managed to create a new problem with our changes.
 					is_valid_solution = False
 					if self.debug:
 						writemsg(("new conflict introduced: %s"
@@ -1046,7 +1046,7 @@ class slot_conflict_handler:
 			if not is_valid_solution:
 				break
 
-		#Make sure the changes don't violate REQUIRED_USE
+		# Make sure the changes don't violate REQUIRED_USE
 		for pkg in required_changes:
 			required_use = pkg._metadata.get("REQUIRED_USE")
 			if not required_use:


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/
@ 2020-08-03 19:30 Zac Medico
  0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2020-08-03 19:30 UTC (permalink / raw
  To: gentoo-commits

commit:     c449a5bab005dab8596b16b07934cc00ea05f8c8
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 19:05:46 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 19:21:35 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c449a5ba

lib/_emerge/resolver/output.py: fix unused-import

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/resolver/output.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py
index 9483898de..1dcb47020 100644
--- a/lib/_emerge/resolver/output.py
+++ b/lib/_emerge/resolver/output.py
@@ -8,8 +8,6 @@ __all__ = (
 	"Display", "format_unmatched_atom",
 	)
 
-
-import portage
 from portage import os
 from portage.dbapi.dep_expand import dep_expand
 from portage.dep import Atom, cpvequal, _repo_separator, _slot_separator


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/
@ 2020-08-03 21:42 Zac Medico
  0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2020-08-03 21:42 UTC (permalink / raw
  To: gentoo-commits

commit:     4aac767b0bde663567c16ccaf8f214c67fb3b6a0
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 20:20:19 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 21:15:42 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4aac767b

lib/_emerge/resolver/slot_collision.py: drop unused-import

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/resolver/slot_collision.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/_emerge/resolver/slot_collision.py b/lib/_emerge/resolver/slot_collision.py
index 2b8f59953..7accb89f4 100644
--- a/lib/_emerge/resolver/slot_collision.py
+++ b/lib/_emerge/resolver/slot_collision.py
@@ -3,8 +3,6 @@
 
 from __future__ import print_function
 
-
-from portage import _encodings, _unicode_encode
 from _emerge.AtomArg import AtomArg
 from _emerge.Package import Package
 from _emerge.PackageArg import PackageArg


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/
@ 2020-08-03 23:28 Zac Medico
  0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2020-08-03 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     02fc63f5d1f0dd66578adcb7e42443ae95540982
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 22:43:07 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 23:28:01 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=02fc63f5

lib/_emerge/resolver/output_helpers.py: fix whitespace

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/resolver/output_helpers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/_emerge/resolver/output_helpers.py b/lib/_emerge/resolver/output_helpers.py
index 25aa925b4..932e66e1b 100644
--- a/lib/_emerge/resolver/output_helpers.py
+++ b/lib/_emerge/resolver/output_helpers.py
@@ -588,7 +588,7 @@ class PkgInfo:
 	"""Simple class to hold instance attributes for current
 	information about the pkg being printed.
 	"""
-	
+
 	__slots__ = ("attr_display", "built", "cp",
 		"ebuild_path", "fetch_symbol", "merge",
 		"oldbest", "oldbest_list", "operation", "ordered", "previous_pkg",


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/
@ 2021-08-15  6:48 Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2021-08-15  6:48 UTC (permalink / raw
  To: gentoo-commits

commit:     7a4bf042dcc322ead982b151e2a459b3455c6f29
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  7 15:58:02 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Aug  7 17:17:16 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7a4bf042

emerge: Sort USE flags in output using combined alnum sort

Sort USE flags in output by a combined sort that treats sequences
of digits as numbers and sorts them numerically rather than lexically.
As a result, python3_10 now sorts after python3_9.

Ideally, we'd just respect the order from profiles/desc but this should
work as an intermediate solution until we figure out how to implement
that.

Bug: https://bugs.gentoo.org/show_bug.cgi?id=788346
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 lib/_emerge/resolver/output_helpers.py | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/lib/_emerge/resolver/output_helpers.py b/lib/_emerge/resolver/output_helpers.py
index 30000e93f..f639f84b3 100644
--- a/lib/_emerge/resolver/output_helpers.py
+++ b/lib/_emerge/resolver/output_helpers.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2020 Gentoo Authors
+# Copyright 2010-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 """Contains private support functions for the Display class
@@ -8,6 +8,8 @@ in output.py
 __all__ = (
 	)
 
+import re
+
 from portage import os
 from portage._sets.base import InternalPackageSet
 from portage.exception import PackageSetNotFound
@@ -214,6 +216,21 @@ class _DisplayConfig:
 		self.pkg = depgraph._pkg
 
 
+_alnum_sort_re = re.compile(r'(\d+)')
+
+
+def _alnum_sort_key(x):
+	def _convert_even_to_int(it):
+		it = iter(it)
+		try:
+			while True:
+				yield next(it)
+				yield int(next(it))
+		except StopIteration:
+			pass
+	return tuple(_convert_even_to_int(_alnum_sort_re.split(x)))
+
+
 def _create_use_string(conf, name, cur_iuse, iuse_forced, cur_use,
 	old_iuse, old_use,
 	is_new, feature_flags, reinst_flags):
@@ -233,7 +250,7 @@ def _create_use_string(conf, name, cur_iuse, iuse_forced, cur_use,
 	removed_iuse = set(old_iuse).difference(cur_iuse)
 	any_iuse = cur_iuse.union(old_iuse)
 	any_iuse = list(any_iuse)
-	any_iuse.sort()
+	any_iuse.sort(key=_alnum_sort_key)
 
 	for flag in any_iuse:
 		flag_str = None


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/
@ 2021-10-04  0:24 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2021-10-04  0:24 UTC (permalink / raw
  To: gentoo-commits

commit:     601b5728bc0c1f76c28d41aae68fd946f19fd0f9
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  1 06:17:12 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct  4 00:24:31 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=601b5728

lib/_emerge/resolver/output_helpers.py: explicitly state 'all satisfied'

This makes things a bit less confusing and tries to avoid
users focusing on (soft) blocks which aren't actually
the problem they're hitting.

Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/760
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/_emerge/resolver/output_helpers.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/_emerge/resolver/output_helpers.py b/lib/_emerge/resolver/output_helpers.py
index f80b79ccf..6ce812189 100644
--- a/lib/_emerge/resolver/output_helpers.py
+++ b/lib/_emerge/resolver/output_helpers.py
@@ -163,6 +163,8 @@ class _PackageCounters:
                 myoutput.append(
                     bad(" (%s unsatisfied)") % (self.blocks - self.blocks_satisfied)
                 )
+            else:
+                myoutput.append(" (all satisfied)")
         return "".join(myoutput)
 
 


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/
@ 2021-10-04  0:24 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2021-10-04  0:24 UTC (permalink / raw
  To: gentoo-commits

commit:     9c5689bc065080ec665ee5250d20146cadf760d6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  1 05:48:16 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct  4 00:24:31 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9c5689bc

lib/_emerge/resolver/output.py: say 'soft blocking' explicitly

Before:
```
[blocks b      ] >perl-core/Scalar-List-Utils-1.550.0-r999 (">perl-core/Scalar-List-Utils-1.550.0-r999" is blocking virtual/perl-Scalar-List-Utils-1.550.0)

```

After:
```
[blocks b      ] >perl-core/Scalar-List-Utils-1.550.0-r999 (">perl-core/Scalar-List-Utils-1.550.0-r999" is soft blocking virtual/perl-Scalar-List-Utils-1.550.0)

```

This should make it a little bit clearer when a block matters,
especially given we already explicitly say 'hard blocking'
for the opposite case.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/_emerge/resolver/output.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py
index e891d84c0..7b5602a78 100644
--- a/lib/_emerge/resolver/output.py
+++ b/lib/_emerge/resolver/output.py
@@ -108,7 +108,7 @@ class Display:
         if blocker.atom.blocker.overlap.forbid:
             blocking_desc = "hard blocking"
         else:
-            blocking_desc = "blocking"
+            blocking_desc = "soft blocking"
         if self.resolved != blocker.atom:
             addl += colorize(
                 self.blocker_style,


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/
@ 2022-03-27 23:07 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2022-03-27 23:07 UTC (permalink / raw
  To: gentoo-commits

commit:     2f7278309bcc13e7fe8b9303124b743e3434871e
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Sun Mar 27 20:46:04 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 23:06:33 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2f727830

lib/_emerge/resolver: fix typos

Fix typos in comments and class/function descriptions in the
lib/_emerge/resolver scripts

Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Closes: https://github.com/gentoo/portage/pull/797
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/_emerge/resolver/output.py          |  2 +-
 lib/_emerge/resolver/package_tracker.py |  8 ++++----
 lib/_emerge/resolver/slot_collision.py  | 24 ++++++++++++------------
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py
index 7b5602a78..6e569ea48 100644
--- a/lib/_emerge/resolver/output.py
+++ b/lib/_emerge/resolver/output.py
@@ -46,7 +46,7 @@ from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice
 
 
 class Display:
-    """Formats and outputs the depgrah supplied it for merge/re-merge, etc.
+    """Formats and outputs the depgraph supplied it for merge/re-merge, etc.
 
     __call__()
     @param depgraph: list

diff --git a/lib/_emerge/resolver/package_tracker.py b/lib/_emerge/resolver/package_tracker.py
index 7f7f2ca36..8631b78d6 100644
--- a/lib/_emerge/resolver/package_tracker.py
+++ b/lib/_emerge/resolver/package_tracker.py
@@ -75,7 +75,7 @@ class PackageTracker:
     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
+    there is already a to-be-installed package added 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
@@ -225,7 +225,7 @@ class PackageTracker:
     def discard_pkg(self, pkg):
         """
         Removes the package from the tracker.
-        Does not raises KeyError if it is not present.
+        Does not raise KeyError if it is not present.
         """
         try:
             self.remove_pkg(pkg)
@@ -263,7 +263,7 @@ class PackageTracker:
 
     def conflicts(self):
         """
-        Iterates over the curently existing conflicts.
+        Iterates over the currently existing conflicts.
         """
         if self._conflicts_cache is None:
             self._conflicts_cache = []
@@ -369,7 +369,7 @@ class PackageTracker:
 
 class PackageTrackerDbapiWrapper:
     """
-    A wrpper class that provides parts of the legacy
+    A wrapper class that provides parts of the legacy
     dbapi interface. Remove it once all consumers have
     died.
     """

diff --git a/lib/_emerge/resolver/slot_collision.py b/lib/_emerge/resolver/slot_collision.py
index 0b063b5f3..4f30cb675 100644
--- a/lib/_emerge/resolver/slot_collision.py
+++ b/lib/_emerge/resolver/slot_collision.py
@@ -22,7 +22,7 @@ class slot_conflict_handler:
     go away. This class focuses on cases where this can be achieved
     with a change in USE settings.
 
-    1) Find out if what causes a given slot conflict. There are
+    1) Find out what causes a given slot conflict. There are
     three possibilities:
 
             a) One parent needs foo-1:0 and another one needs foo-2:0,
@@ -36,7 +36,7 @@ class slot_conflict_handler:
             enabled, this case is treated in the same way as c).
 
             c) Neither a 'version based conflict' nor an 'unspecific
-            conflict'. Ignoring use deps would result result in an
+            conflict'. Ignoring use deps would result in an
             'unspecific conflict'. This is called a 'specific conflict'.
             This is the only conflict we try to find suggestions for.
 
@@ -63,7 +63,7 @@ class slot_conflict_handler:
             * The parent package is 'installed'.
             * The conflict package is 'installed'.
 
-    USE of 'installed' packages can't be changed. This always requires an
+    USE of 'installed' packages can't be changed. This always requires a
     non-installed package.
 
     During this procedure, contradictions may occur. In this case the
@@ -126,10 +126,10 @@ class slot_conflict_handler:
 
         self._prepare_conflict_msg_and_check_for_specificity()
 
-        # a list of dicts that hold the needed USE values to solve all conflicts
+        # a list of dicts that holds the needed USE values to solve all conflicts
         self.solutions = []
 
-        # a list of dicts that hold the needed USE changes to solve all conflicts
+        # a list of dicts that holds the needed USE changes to solve all conflicts
         self.changes = []
 
         # configuration = a list of packages with exactly one package from every
@@ -218,7 +218,7 @@ class slot_conflict_handler:
                 to_be_removed.append(change)
 
         if not ignore:
-            # Discard all existing change that are a superset of the new change.
+            # Discard all existing changes that are a superset of the new change.
             for obsolete_change in to_be_removed:
                 changes.remove(obsolete_change)
             changes.append(new_change)
@@ -803,12 +803,12 @@ class slot_conflict_handler:
         self, config, all_conflict_atoms_by_slotatom, conflict_nodes
     ):
         """
-        Given a configuartion, required use changes are computed and checked to
+        Given a configuration, required use changes are computed and checked to
         make sure that no new conflict is introduced. Returns a solution or None.
         """
         _pkg_use_enabled = self.depgraph._pkg_use_enabled
         # An installed package can only be part of a valid configuration if it has no
-        # pending use changed. Otherwise the ebuild will be pulled in again.
+        # pending use changes. Otherwise the ebuild will be pulled in again.
         for pkg in config:
             if not pkg.installed:
                 continue
@@ -908,7 +908,7 @@ class slot_conflict_handler:
                     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
-                    # part of the conflict, isn't it?
+                    # part of the conflict, isn't it?)
                     if self.debug:
                         writemsg(
                             (
@@ -922,7 +922,7 @@ class slot_conflict_handler:
 
                 # Compute the required USE changes. A flag can be forced to "enabled" or "disabled",
                 # it can be in the conditional state "cond" that allows both values or in the
-                # "contradiction" state, which means that some atoms insist on differnt values
+                # "contradiction" state, which means that some atoms insist on different values
                 # for this flag and those kill this configuration.
                 for flag in violated_atom.use.required:
                     state = involved_flags.get(flag, "")
@@ -1013,7 +1013,7 @@ class slot_conflict_handler:
 
     def _force_flag_for_package(self, required_changes, pkg, flag, state):
         """
-        Adds an USE change to required_changes. Sets the target state to
+        Adds a USE change to required_changes. Sets the target state to
         "contradiction" if a flag is forced to conflicting values.
         """
         _pkg_use_enabled = self.depgraph._pkg_use_enabled
@@ -1043,7 +1043,7 @@ class slot_conflict_handler:
         self, config, all_involved_flags, all_conflict_atoms_by_slotatom
     ):
         """
-        Given a configuartion and all involved flags, all possible settings for the involved
+        Given a configuration and all involved flags, all possible settings for the involved
         flags are checked if they solve the slot conflict.
         """
         _pkg_use_enabled = self.depgraph._pkg_use_enabled


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/
@ 2023-12-06 16:18 Zac Medico
  0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2023-12-06 16:18 UTC (permalink / raw
  To: gentoo-commits

commit:     036a0785d2595defc55ef03e424ffdf739a108b1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  6 00:26:17 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec  6 16:06:00 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=036a0785

circular_dependency: Handle SonameAtom

Treat soname deps is as unconditional for now. In some
cases they can be avoided by a rebuild with changed
USE, but ebuilds sometimes do not specify the
corresponding conditional dependency (especially for
system packages like gcc which provides libstdc++.so.6
and libgcc_s.so.1).

Bug: https://bugs.gentoo.org/919311
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/resolver/circular_dependency.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/lib/_emerge/resolver/circular_dependency.py b/lib/_emerge/resolver/circular_dependency.py
index c88b18a574..cd612e3130 100644
--- a/lib/_emerge/resolver/circular_dependency.py
+++ b/lib/_emerge/resolver/circular_dependency.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2020 Gentoo Authors
+# Copyright 2010-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import logging
@@ -132,9 +132,20 @@ class circular_dependency_handler:
             for ppkg, atom in parent_atoms:
                 if ppkg == parent:
                     changed_parent = ppkg
-                    parent_atom = atom.unevaluated_atom
+                    parent_atom = atom
                     break
 
+            if parent_atom.package:
+                parent_atom = parent_atom.unevaluated_atom
+            else:
+                # Treat soname deps as unconditional for now. In some
+                # cases they can be avoided by a rebuild with changed
+                # USE, but ebuilds sometimes do not specify the
+                # corresponding conditional dependency (especially for
+                # system packages like gcc which provides libstdc++.so.6
+                # and libgcc_s.so.1).
+                continue
+
             try:
                 affecting_use = extract_affecting_use(
                     dep, parent_atom, eapi=parent.eapi


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-12-06 16:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-04  0:24 [gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-12-06 16:18 Zac Medico
2022-03-27 23:07 Sam James
2021-10-04  0:24 Sam James
2021-08-15  6:48 Michał Górny
2020-08-03 23:28 Zac Medico
2020-08-03 21:42 Zac Medico
2020-08-03 19:30 Zac Medico
2020-08-03  3:08 Zac Medico
2019-01-20  7:24 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox