aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVirgil Dupras <vdupras@gentoo.org>2018-09-17 19:31:27 -0400
committerVirgil Dupras <vdupras@gentoo.org>2018-09-17 19:31:27 -0400
commit72bb4d3a91e47db7532219889dbeda72f6073746 (patch)
tree8ce2a7886c001f1d2d3fdc6016c712f4b2149385
parentAdd functional tests through "cmdtests" (diff)
downloadgentoolkit-72bb4d3a91e47db7532219889dbeda72f6073746.tar.gz
gentoolkit-72bb4d3a91e47db7532219889dbeda72f6073746.tar.bz2
gentoolkit-72bb4d3a91e47db7532219889dbeda72f6073746.zip
Atom.intersects: add repo comparison
The code for it was already there, but commented out. Portage now supports repo alright...
-rw-r--r--pym/gentoolkit/atom.py7
-rw-r--r--pym/gentoolkit/test/test_atom.py5
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-1-r1', False),
('=cat/pkg-1*', '>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),
]: