Commit 790bdef
committed
dependencies: fix graph_reverse_depends crash on Atom.intersects
Atom.intersects() type-checks its argument since portage removed str
subtyping from Atom, so it needs a real Atom object, not a Dependencies
(a Query subclass) or a plain string.
graph_reverse_depends() called dep.intersects(self) where self is a
Dependencies object. Pass self.atom instead, but that then exposed a
second bug: gentoolkit.atom.Atom.__init__ sets self.atom to the raw atom
string it was constructed from (used by __repr__/__str__).
Query.__init__ copied that string into self.atom via __dict__.update(),
and its fallback except branch set self.atom = self.cpv (also a plain
string), so Query.atom was never actually usable as an Atom. Fix both:
restore self.atom to the real Atom object in the success path, and
construct one from self.cpv in the fallback path.
Bug: https://bugs.gentoo.org/981521
Signed-off-by: Matt Turner <mattst88@gentoo.org>1 parent bbc768d commit 790bdef
2 files changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| |||
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
78 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
| |||
0 commit comments