diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-11-06 10:05:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-11-06 10:05:07 +0000 |
commit | 81c71b9f00f7c8f361d2d6655c7dfdafa281fe25 (patch) | |
tree | a38be308cbe3049187c96519614327d1e333f053 /bin | |
parent | d820c840c1d6c3e4234f0923d1b78044c74bb897 (diff) | |
download | portage-81c71b9f00f7c8f361d2d6655c7dfdafa281fe25.tar.gz portage-81c71b9f00f7c8f361d2d6655c7dfdafa281fe25.tar.bz2 portage-81c71b9f00f7c8f361d2d6655c7dfdafa281fe25.zip |
Simplify and fix bugs in is_valid_package_atom(). (trunk r8445)
svn path=/main/branches/2.1.2/; revision=8446
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/emerge | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/bin/emerge b/bin/emerge index 947096388..7eb9fbeab 100755 --- a/bin/emerge +++ b/bin/emerge @@ -4571,17 +4571,11 @@ def chk_updated_cfg_files(target_root, config_protect): print " "+yellow("*")+" man page to learn how to update config files." def is_valid_package_atom(x): - try: - testkey = portage.dep_getkey(x) - except portage_exception.InvalidData: - return False - if testkey.startswith("null/"): - testatom = x.replace(testkey[5:], "cat/"+testkey[5:]) - elif "/" not in x: - testatom = "cat/"+x - else: - testatom = x - return portage.isvalidatom(testatom) + if "/" not in x: + alphanum = re.search(r'\w', x) + if alphanum: + x = x[:alphanum.start()] + "cat/" + x[alphanum.start():] + return portage.isvalidatom(x) def show_blocker_docs_link(): print |