diff options
author | Marius Mauch <genone@gentoo.org> | 2007-01-10 08:08:18 +0000 |
---|---|---|
committer | Marius Mauch <genone@gentoo.org> | 2007-01-10 08:08:18 +0000 |
commit | 650ab45c0dfa16b57cc01fcc03020c1032a672c7 (patch) | |
tree | 0470bf7aee5974d890f2e57e9e1e8fb64c8112bf /pym/portage.py | |
parent | bf22605c3dfe950f14b1c073c6435e3a8237cfcf (diff) | |
download | portage-650ab45c0dfa16b57cc01fcc03020c1032a672c7.tar.gz portage-650ab45c0dfa16b57cc01fcc03020c1032a672c7.tar.bz2 portage-650ab45c0dfa16b57cc01fcc03020c1032a672c7.zip |
Always use vercmp for cpv comparisons
svn path=/main/trunk/; revision=5511
Diffstat (limited to 'pym/portage.py')
-rw-r--r-- | pym/portage.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pym/portage.py b/pym/portage.py index 3f3e378ae..21b8d1817 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -3818,6 +3818,18 @@ def getCPFromCPV(mycpv): """Calls pkgsplit on a cpv and returns only the cp.""" return pkgsplit(mycpv)[0] +def cpvequal(cpv1, cpv2): + split1 = catpkgsplit(cpv1) + split2 = catpkgsplit(cpv2) + + if not split1 or not split2: + raise portage_exception.PortageException("Invalid data, parameter was not a CPV") + + if split1[0] != split2[0]: + return False + + return (pkgcmp(split1[1:], split2[1:]) == 0) + def dep_virtual(mysplit, mysettings): "Does virtual dependency conversion" |