From 72bb4d3a91e47db7532219889dbeda72f6073746 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 17 Sep 2018 19:31:27 -0400 Subject: Atom.intersects: add repo comparison The code for it was already there, but commented out. Portage now supports repo alright... --- pym/gentoolkit/atom.py | 7 +++---- pym/gentoolkit/test/test_atom.py | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pym/gentoolkit/atom.py b/pym/gentoolkit/atom.py index 9d8a558..b5b755c 100644 --- a/pym/gentoolkit/atom.py +++ b/pym/gentoolkit/atom.py @@ -227,10 +227,9 @@ class Atom(portage.dep.Atom, CPV): this_slot != that_slot): return False - # TODO: Uncomment when Portage's Atom supports repo - #if (self.repo_name is not None and other.repo_name is not None and - # self.repo_name != other.repo_name): - # return False + if (self.repo is not None and other.repo is not None and + self.repo != other.repo): + return False # Use deps are similar: if one of us forces a flag on and the # other forces it off we do not intersect. If only one of us diff --git a/pym/gentoolkit/test/test_atom.py b/pym/gentoolkit/test/test_atom.py index 1adb221..399905e 100644 --- a/pym/gentoolkit/test/test_atom.py +++ b/pym/gentoolkit/test/test_atom.py @@ -126,9 +126,8 @@ class TestGentoolkitAtom(unittest.TestCase): ('=cat/pkg-1-r1*', 'cat/pkg-2', False), ('>=cat/pkg-8.4', '=cat/pkg-8.3.4*', False), - # Repos not yet supported by Portage - #('cat/pkg::gentoo', 'cat/pkg', True), - #('cat/pkg::gentoo', 'cat/pkg::foo', False), + ('cat/pkg::gentoo', 'cat/pkg', True), + ('cat/pkg::gentoo', 'cat/pkg::foo', False), ('=sys-devel/gcc-4.1.1-r3', '=sys-devel/gcc-3.3*', False), ('=sys-libs/db-4*', '~sys-libs/db-4.3.29', True), ]: -- cgit v1.2.3