From 8297c93cded9ad2fd496324957470ad45c2696b0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 4 Oct 2009 22:06:04 +0000 Subject: [PATCH] Use the simpler/stricter _pkgspit in dbapi code. svn path=/main/trunk/; revision=14492 --- pym/portage/dbapi/porttree.py | 2 +- pym/portage/dbapi/vartree.py | 2 +- pym/portage/versions.py | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index f7c8288d5..ef0b8a694 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -12,7 +12,7 @@ portage.proxy.lazyimport.lazyimport(globals(), 'portage.dep:dep_getkey,match_from_list,paren_reduce,use_reduce', 'portage.env.loaders:KeyValuePairFileLoader', 'portage.util:ensure_dirs,writemsg,writemsg_level', - 'portage.versions:best,catpkgsplit,pkgsplit,ver_regexp', + 'portage.versions:best,catpkgsplit,_pkgsplit@pkgsplit,ver_regexp', ) from portage.cache.cache_errors import CacheError diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 5fdd1ad44..5971ca647 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -21,7 +21,7 @@ portage.proxy.lazyimport.lazyimport(globals(), 'portage.util:apply_secpass_permissions,ConfigProtect,ensure_dirs,' + \ 'writemsg,writemsg_level,write_atomic,atomic_ofstream,writedict,' + \ 'grabfile,grabdict,normalize_path,new_protect_filename,getlibpaths', - 'portage.versions:best,catpkgsplit,catsplit,pkgcmp,pkgsplit', + 'portage.versions:best,catpkgsplit,catsplit,pkgcmp,_pkgsplit@pkgsplit', ) from portage.const import CACHE_PATH, CONFIG_MEMORY_FILE, \ diff --git a/pym/portage/versions.py b/pym/portage/versions.py index 60e58b894..dababe0c7 100644 --- a/pym/portage/versions.py +++ b/pym/portage/versions.py @@ -229,7 +229,12 @@ def pkgcmp(pkg1, pkg2): _pv_re = re.compile('^' + _pv + '$', re.VERBOSE) def _pkgsplit(mypkg): - + """ + @param mypkg: pv + @return: + 1. None if input is invalid. + 2. (pn, ver, rev) if input is pv + """ m = _pv_re.match(mypkg) if m is None: return None -- 2.26.2