diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-09-12 18:10:03 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-09-12 18:10:03 +0000 |
commit | 7879445e8a1a907d64faa68103c108f44a8630d3 (patch) | |
tree | 3f78a1d9c12feb21dcf97bd2e009e68a34453d1c | |
parent | b19e9790de7e83329b6236b71f95a3f4f034c603 (diff) | |
download | portage-7879445e8a1a907d64faa68103c108f44a8630d3.tar.gz portage-7879445e8a1a907d64faa68103c108f44a8630d3.tar.bz2 portage-7879445e8a1a907d64faa68103c108f44a8630d3.zip |
Use isjustname() where appropriate.
svn path=/main/trunk/; revision=14236
-rwxr-xr-x | bin/egencache | 3 | ||||
-rw-r--r-- | pym/portage/dbapi/bintree.py | 4 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 4 | ||||
-rw-r--r-- | pym/portage/update.py | 3 |
4 files changed, 8 insertions, 6 deletions
diff --git a/bin/egencache b/bin/egencache index db0eb622d..2b3af4e50 100755 --- a/bin/egencache +++ b/bin/egencache @@ -34,6 +34,7 @@ from _emerge.MetadataRegen import MetadataRegen from portage.cache.cache_errors import CacheError, StatCollision from portage.util import writemsg_level from portage import cpv_getkey +from portage.dep import isjustname def parse_args(args): usage = "egencache [options] --update [atom] ..." @@ -112,7 +113,7 @@ def parse_args(args): except portage.exception.InvalidAtom: parser.error('Invalid atom: %s' % (atom,)) - if str(atom) != atom.cp: + if not isjustname(atom): parser.error('Atom is too specific: %s' % (atom,)) return parser, options, args diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 734eb5418..d15953735 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -6,7 +6,7 @@ __all__ = ["bindbapi", "binarytree"] import portage portage.proxy.lazyimport.lazyimport(globals(), - 'portage.dep:dep_getkey,match_from_list', + 'portage.dep:dep_getkey,isjustname,match_from_list', 'portage.output:EOutput,colorize', 'portage.update:update_dbentries', 'portage.util:ensure_dirs,normalize_path,writemsg,writemsg_stdout', @@ -231,7 +231,7 @@ class binarytree(object): newcp = mylist[2] # sanity check for atom in (origcp, newcp): - if atom.cp != atom: + if not isjustname(atom): raise InvalidPackageName(str(atom)) origcat = origcp.split("/")[0] mynewcat = newcp.split("/")[0] diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 23c76bce4..da7426880 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -9,7 +9,7 @@ __all__ = ["PreservedLibsRegistry", "LinkageMap", import portage portage.proxy.lazyimport.lazyimport(globals(), 'portage.checksum:_perform_md5_merge@perform_md5', - 'portage.dep:dep_getkey,match_from_list,' + \ + 'portage.dep:dep_getkey,isjustname,match_from_list,' + \ 'use_reduce,paren_reduce', 'portage.elog:elog_process', 'portage.elog.filtering:filter_mergephases,filter_unmergephases', @@ -874,7 +874,7 @@ class vardbapi(dbapi): # sanity check for atom in (origcp, newcp): - if atom.cp != atom: + if not isjustname(atom): raise InvalidPackageName(str(atom)) origmatches = self.match(origcp, use_cache=0) moves = 0 diff --git a/pym/portage/update.py b/pym/portage/update.py index 069f10087..251da88a4 100644 --- a/pym/portage/update.py +++ b/pym/portage/update.py @@ -13,7 +13,8 @@ from portage import _unicode_decode from portage import _unicode_encode import portage portage.proxy.lazyimport.lazyimport(globals(), - 'portage.dep:Atom,dep_getkey,get_operator,isvalidatom,remove_slot', + 'portage.dep:Atom,dep_getkey,get_operator,isjustname,isvalidatom,' + \ + 'remove_slot', 'portage.util:ConfigProtect,grabfile,new_protect_filename,' + \ 'normalize_path,write_atomic,writemsg', 'portage.versions:ververify' |