1 |
commit: 44076b9432a1361a39515927de2b60baa2fbddb9 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 1 21:23:39 2020 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 1 21:30:23 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=44076b94 |
7 |
|
8 |
cpv_expand: treat GLEP 81 acct-* categories like virtual (bug 691798) |
9 |
|
10 |
This solves common name collisions introduced by GLEP 81 user and group |
11 |
management packages. |
12 |
|
13 |
TODO: Provide user configuration so that users an ignore name |
14 |
collisions with selected categories like app-emacs or dev-haskell. |
15 |
|
16 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
17 |
|
18 |
lib/_emerge/depgraph.py | 2 +- |
19 |
lib/portage/dbapi/cpv_expand.py | 4 ++-- |
20 |
2 files changed, 3 insertions(+), 3 deletions(-) |
21 |
|
22 |
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py |
23 |
index cae1c4470..1eaf20035 100644 |
24 |
--- a/lib/_emerge/depgraph.py |
25 |
+++ b/lib/_emerge/depgraph.py |
26 |
@@ -4212,7 +4212,7 @@ class depgraph(object): |
27 |
if len(expanded_atoms) > 1: |
28 |
number_of_virtuals = 0 |
29 |
for expanded_atom in expanded_atoms: |
30 |
- if expanded_atom.cp.startswith("virtual/"): |
31 |
+ if expanded_atom.cp.startswith(("acct-group/", "acct-user/", "virtual/")): |
32 |
number_of_virtuals += 1 |
33 |
else: |
34 |
candidate = expanded_atom |
35 |
|
36 |
diff --git a/lib/portage/dbapi/cpv_expand.py b/lib/portage/dbapi/cpv_expand.py |
37 |
index 70ee78245..ac2f6cc2e 100644 |
38 |
--- a/lib/portage/dbapi/cpv_expand.py |
39 |
+++ b/lib/portage/dbapi/cpv_expand.py |
40 |
@@ -72,9 +72,9 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None): |
41 |
matches.append(x+"/"+myp) |
42 |
if len(matches) > 1: |
43 |
virtual_name_collision = False |
44 |
- if len(matches) == 2: |
45 |
+ if len(matches) > 1: |
46 |
for x in matches: |
47 |
- if not x.startswith("virtual/"): |
48 |
+ if not x.startswith(("acct-group/", "acct-user/", "virtual/")): |
49 |
# Assume that the non-virtual is desired. This helps |
50 |
# avoid the ValueError for invalid deps that come from |
51 |
# installed packages (during reverse blocker detection, |