summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-07-17 18:42:10 -0700
committerZac Medico <zmedico@gentoo.org>2012-07-17 18:42:10 -0700
commitb5956d62d08882a8565d3ef98afa3a1d65090cb7 (patch)
treef02861752e458ef593b30ab157f9ee6b1626237d /pym/portage/dbapi
parent8657622137cbc88e161296b2f35d264e0f52dd45 (diff)
downloadportage-b5956d62d08882a8565d3ef98afa3a1d65090cb7.tar.gz
portage-b5956d62d08882a8565d3ef98afa3a1d65090cb7.tar.bz2
portage-b5956d62d08882a8565d3ef98afa3a1d65090cb7.zip
portage.update: use isvalidatom for EAPI check
Diffstat (limited to 'pym/portage/dbapi')
-rw-r--r--pym/portage/dbapi/bintree.py15
-rw-r--r--pym/portage/dbapi/vartree.py11
2 files changed, 17 insertions, 9 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index 8072542e8..9527b0766 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -7,8 +7,7 @@ import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.checksum:hashfunc_map,perform_multiple_checksums,verify_all',
'portage.dbapi.dep_expand:dep_expand',
- 'portage.dep:dep_getkey,isjustname,match_from_list',
- 'portage.eapi:_get_eapi_attrs',
+ 'portage.dep:dep_getkey,isjustname,isvalidatom,match_from_list',
'portage.output:EOutput,colorize',
'portage.locks:lockfile,unlockfile',
'portage.package.ebuild.fetch:_check_distfile,_hide_url_passwd',
@@ -49,8 +48,11 @@ except ImportError:
from urlparse import urlparse
if sys.hexversion >= 0x3000000:
+ _unicode = str
basestring = str
long = int
+else:
+ _unicode = unicode
class bindbapi(fakedbapi):
_known_keys = frozenset(list(fakedbapi._known_keys) + \
@@ -389,10 +391,13 @@ class binarytree(object):
if repo_match is not None \
and not repo_match(mycpv.repo):
continue
- eapi_attrs = _get_eapi_attrs(mycpv.eapi)
- if not eapi_attrs.dots_in_PN and "." in catsplit(newcp)[1]:
+
+ # Use isvalidatom() to check if this move is valid for the
+ # EAPI (characters allowed in package names may vary).
+ if not isvalidatom(newcp, eapi=mycpv.eapi):
continue
- mynewcpv = mycpv.replace(mycpv_cp, str(newcp), 1)
+
+ mynewcpv = mycpv.replace(mycpv_cp, _unicode(newcp), 1)
myoldpkg = catsplit(mycpv)[1]
mynewpkg = catsplit(mynewcpv)[1]
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 0ae7dc54b..ea62f6bcc 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -11,7 +11,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
'portage.data:portage_gid,portage_uid,secpass',
'portage.dbapi.dep_expand:dep_expand',
'portage.dbapi._MergeProcess:MergeProcess',
- 'portage.dep:dep_getkey,isjustname,match_from_list,' + \
+ 'portage.dep:dep_getkey,isjustname,isvalidatom,match_from_list,' + \
'use_reduce,_get_slot_re',
'portage.eapi:_get_eapi_attrs',
'portage.elog:collect_ebuild_messages,collect_messages,' + \
@@ -332,10 +332,13 @@ class vardbapi(dbapi):
if repo_match is not None \
and not repo_match(mycpv.repo):
continue
- eapi_attrs = _get_eapi_attrs(mycpv.eapi)
- if not eapi_attrs.dots_in_PN and "." in catsplit(newcp)[1]:
+
+ # Use isvalidatom() to check if this move is valid for the
+ # EAPI (characters allowed in package names may vary).
+ if not isvalidatom(newcp, eapi=mycpv.eapi):
continue
- mynewcpv = mycpv.replace(mycpv_cp, str(newcp), 1)
+
+ mynewcpv = mycpv.replace(mycpv_cp, _unicode(newcp), 1)
mynewcat = catsplit(newcp)[0]
origpath = self.getpath(mycpv)
if not os.path.exists(origpath):