diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-01-16 05:30:18 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-01-16 05:30:18 -0800 |
commit | bd4193fc05af01c2f7546ab7cc99e404582a6d60 (patch) | |
tree | aa80092ec3a82bc5b3637acefd9e2934fe50db7e | |
parent | f7d169d516a2fbaf457057cb5e17a84f9ad13d04 (diff) | |
download | portage-bd4193fc05af01c2f7546ab7cc99e404582a6d60.tar.gz portage-bd4193fc05af01c2f7546ab7cc99e404582a6d60.tar.bz2 portage-bd4193fc05af01c2f7546ab7cc99e404582a6d60.zip |
Use Atom for stricter portdb.cp_all() validation.
-rw-r--r-- | pym/portage/dbapi/__init__.py | 1 | ||||
-rw-r--r-- | pym/portage/dbapi/porttree.py | 11 |
2 files changed, 7 insertions, 5 deletions
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index 0708d6840..be18b3245 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -20,7 +20,6 @@ from portage.localization import _ class dbapi(object): _category_re = re.compile(r'^\w[-.+\w]*$') - _pkg_dir_name_re = re.compile(r'^\w[-+\w]*$') _categories = None _use_mutable = False _known_keys = frozenset(x for x in auxdbkeys diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 2f6b9dd16..ed4db33f2 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -10,7 +10,7 @@ portage.proxy.lazyimport.lazyimport(globals(), 'portage.checksum', 'portage.data:portage_gid,secpass', 'portage.dbapi.dep_expand:dep_expand', - 'portage.dep:dep_getkey,match_from_list,use_reduce', + 'portage.dep:Atom,dep_getkey,match_from_list,use_reduce', 'portage.package.ebuild.doebuild:doebuild', 'portage.util:ensure_dirs,shlex_split,writemsg,writemsg_level', 'portage.util.listdir:listdir', @@ -684,10 +684,13 @@ class portdbapi(dbapi): for x in categories: for oroot in trees: for y in listdir(oroot+"/"+x, EmptyOnError=1, ignorecvs=1, dirsonly=1): - if not self._pkg_dir_name_re.match(y) or \ - y == "CVS": + try: + atom = Atom("%s/%s" % (x, y)) + except InvalidAtom: + continue + if atom != atom.cp: continue - d[x+"/"+y] = None + d[atom.cp] = None l = list(d) l.sort() return l |