From 13020ad05b8aca4de723c7fd55fc05dcd7937939 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 24 May 2013 11:12:23 -0700 Subject: [PATCH] _find_bad_atoms: use insert_category_into_atom This shares/aligns logic with is_valid_package_atom. --- pym/_emerge/main.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index ce00ae34a..e066c8700 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -9,11 +9,13 @@ import sys import portage portage.proxy.lazyimport.lazyimport(globals(), 'logging', + 'portage.dep:Atom', 'portage.util:writemsg_level', 'textwrap', '_emerge.actions:load_emerge_config,run_action,' + \ 'validate_ebuild_environment', '_emerge.help:help@emerge_help', + '_emerge.is_valid_package_atom:insert_category_into_atom' ) from portage import os @@ -258,14 +260,17 @@ def _find_bad_atoms(atoms, less_strict=False): """ bad_atoms = [] for x in ' '.join(atoms).split(): + atom = x + if "/" not in x.split(":")[0]: + x_cat = insert_category_into_atom(x, 'dummy-category') + if x_cat is not None: + atom = x_cat + bad_atom = False try: - atom = portage.dep.Atom(x, allow_wildcard=True, allow_repo=less_strict) + atom = Atom(atom, allow_wildcard=True, allow_repo=less_strict) except portage.exception.InvalidAtom: - try: - atom = portage.dep.Atom("*/"+x, allow_wildcard=True, allow_repo=less_strict) - except portage.exception.InvalidAtom: - bad_atom = True + bad_atom = True if bad_atom or (atom.operator and not less_strict) or atom.blocker or atom.use: bad_atoms.append(x) -- 2.26.2