aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS17
-rw-r--r--pym/gentoolkit/atom.py12
-rw-r--r--pym/gentoolkit/test/test_atom.py11
3 files changed, 29 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index 9309ab8..7eacb10 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,22 @@
News (new features/major bug fixes)
+gentoolkit-0.4.3
+----------------
+ * epkginfo: Add 'reverse' display option for equery
+ * Speed up "equery depends" by a great deal
+ * Fix broken test suite and add new tests
+ * Add tox config
+
+gentoolkit-0.4.2
+----------------
+ * Improve keyword grouping and sorting in eshowkw
+ * Bug fixes in eshowkw
+
+gentoolkit-0.4.1
+----------------
+ * ekeyword: Support sorting keywords without additional changes
+ * Bug fixes in revdep_rebuild, equery, eclean
+
gentoolkit-0.4.0
----------------
* Merge ekeyword, ebump, imlate tools from gentoolkit-dev
diff --git a/pym/gentoolkit/atom.py b/pym/gentoolkit/atom.py
index b5b755c..b86c89c 100644
--- a/pym/gentoolkit/atom.py
+++ b/pym/gentoolkit/atom.py
@@ -209,15 +209,9 @@ class Atom(portage.dep.Atom, CPV):
# Our "cp" (cat/pkg) must match exactly:
if self.cp != other.cp:
# Check to see if one is name only:
- # Avoid slow partitioning if we're definitely not matching
- # (yes, this is hackish, but it's faster):
- if self.cp[-1:] != other.cp[-1:]:
- return False
-
- if ((not self.category and self.name == other.name) or
- (not other.category and other.name == self.name)):
- return True
- return False
+ # We don't bother checking if self.category is None: it can't be
+ # because we're an Atom subclass and that would be invalid.
+ return (not other.category and self.name == other.name)
# Slot dep only matters if we both have one. If we do they
# must be identical:
diff --git a/pym/gentoolkit/test/test_atom.py b/pym/gentoolkit/test/test_atom.py
index 399905e..6177222 100644
--- a/pym/gentoolkit/test/test_atom.py
+++ b/pym/gentoolkit/test/test_atom.py
@@ -8,6 +8,7 @@
import unittest
from gentoolkit.atom import Atom
+from gentoolkit.cpv import CPV
from gentoolkit.test import cmp
"""Atom test suite (verbatim) from pkgcore."""
@@ -140,10 +141,16 @@ class TestGentoolkitAtom(unittest.TestCase):
result, that_atom.intersects(this_atom),
'%s intersecting %s should be %s' % (that, this, result))
+ def test_intersects_nameonly(self):
+ atom = Atom('cat/pkg')
+ self.assertTrue(atom.intersects(CPV('pkg')))
+ self.assertFalse(atom.intersects(CPV('other')))
+ self.assertFalse(atom.intersects(CPV('dkg')))
+
def test_main():
- suite = unittest.TestLoader().loadTestsFromTestCase(TestGentoolkitAtom)
- unittest.TextTestRunner(verbosity=2).run(suite)
+ suite = unittest.TestLoader().loadTestsFromTestCase(TestGentoolkitAtom)
+ unittest.TextTestRunner(verbosity=2).run(suite)
test_main.__test__ = False