1 |
commit: 13020ad05b8aca4de723c7fd55fc05dcd7937939 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri May 24 18:12:23 2013 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 24 18:12:23 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=13020ad0 |
7 |
|
8 |
_find_bad_atoms: use insert_category_into_atom |
9 |
|
10 |
This shares/aligns logic with is_valid_package_atom. |
11 |
|
12 |
--- |
13 |
pym/_emerge/main.py | 15 ++++++++++----- |
14 |
1 files changed, 10 insertions(+), 5 deletions(-) |
15 |
|
16 |
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py |
17 |
index ce00ae3..e066c87 100644 |
18 |
--- a/pym/_emerge/main.py |
19 |
+++ b/pym/_emerge/main.py |
20 |
@@ -9,11 +9,13 @@ import sys |
21 |
import portage |
22 |
portage.proxy.lazyimport.lazyimport(globals(), |
23 |
'logging', |
24 |
+ 'portage.dep:Atom', |
25 |
'portage.util:writemsg_level', |
26 |
'textwrap', |
27 |
'_emerge.actions:load_emerge_config,run_action,' + \ |
28 |
'validate_ebuild_environment', |
29 |
'_emerge.help:help@emerge_help', |
30 |
+ '_emerge.is_valid_package_atom:insert_category_into_atom' |
31 |
) |
32 |
from portage import os |
33 |
|
34 |
@@ -258,14 +260,17 @@ def _find_bad_atoms(atoms, less_strict=False): |
35 |
""" |
36 |
bad_atoms = [] |
37 |
for x in ' '.join(atoms).split(): |
38 |
+ atom = x |
39 |
+ if "/" not in x.split(":")[0]: |
40 |
+ x_cat = insert_category_into_atom(x, 'dummy-category') |
41 |
+ if x_cat is not None: |
42 |
+ atom = x_cat |
43 |
+ |
44 |
bad_atom = False |
45 |
try: |
46 |
- atom = portage.dep.Atom(x, allow_wildcard=True, allow_repo=less_strict) |
47 |
+ atom = Atom(atom, allow_wildcard=True, allow_repo=less_strict) |
48 |
except portage.exception.InvalidAtom: |
49 |
- try: |
50 |
- atom = portage.dep.Atom("*/"+x, allow_wildcard=True, allow_repo=less_strict) |
51 |
- except portage.exception.InvalidAtom: |
52 |
- bad_atom = True |
53 |
+ bad_atom = True |
54 |
|
55 |
if bad_atom or (atom.operator and not less_strict) or atom.blocker or atom.use: |
56 |
bad_atoms.append(x) |