diff options
author | Brian Harring <ferringb@gmail.com> | 2006-05-24 21:54:58 -0700 |
---|---|---|
committer | Brian Harring <ferringb@gmail.com> | 2006-05-24 21:54:58 -0700 |
commit | 8a18f666b7e56bde97d773968d37d3f788b6aa05 (patch) | |
tree | a5957bd0c0261421052b3bbc193e278251e93ad2 /bin | |
parent | fix ups. vulnerable scan is an or for groupped, drop the print, drop the imp... (diff) | |
download | pkgcore-8a18f666b7e56bde97d773968d37d3f788b6aa05.tar.gz pkgcore-8a18f666b7e56bde97d773968d37d3f788b6aa05.tar.bz2 pkgcore-8a18f666b7e56bde97d773968d37d3f788b6aa05.zip |
do a lookup for failed node, showing possibilities.
Not perfect, but tiz a start.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/tests/test_resolver.py | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/bin/tests/test_resolver.py b/bin/tests/test_resolver.py index 19750a57..5c0ece6e 100644 --- a/bin/tests/test_resolver.py +++ b/bin/tests/test_resolver.py @@ -4,7 +4,7 @@ from pkgcore.config import load_config from pkgcore.resolver import plan from pkgcore.package.atom import atom from pkgcore.util.lists import flatten, stable_unique - +from pkgcore.util.repo_utils import get_raw_repos def pop_paired_args(args, arg, msg): rets = [] @@ -49,6 +49,7 @@ if __name__ == "__main__": empty_vdb = pop_arg(args, "-e", "--empty") upgrade = pop_arg(args, "-u", "--upgrade") max = pop_arg(args, "-m", "--max-upgrade") + ignore_failures = pop_arg(args, None, "--ignore-failures") if max and max == upgrade: print "can only choose max, or upgrade" sys.exit(1) @@ -77,21 +78,40 @@ if __name__ == "__main__": atoms = [atom("sys-apps/portage")] else: atoms = [atom(x) for x in args] + set_targets - atoms = stable_unique(atoms) + atoms = stable_unique(atoms) domain = conf.domain["livefs domain"] vdb, repo = domain.vdb[0], domain.repos[0] resolver = plan.merge_plan(vdb, repo, pkg_selection_strategy=strategy, verify_vdb=deep) ret = True + failures = [] import time start_time = time.time() - for x in atoms: - print "\ncalling resolve for %s..." % x - ret = resolver.add_atom(x) + for restrict in atoms: + print "\ncalling resolve for %s..." % restrict + ret = resolver.add_atom(restrict) if ret: print "ret was",ret print "resolution failed" - sys.exit(2) + failures.append(restrict) + if not ignore_failures: + break + if failures: + print "\nfailures encountered-" + for restrict in failures: + print "failed '%s'\npotentials-" % restrict + match_count = 0 + for r in get_raw_repos(repo): + l = r.match(restrict) + if l: + print "repo %s: [ %s ]" % (r, ", ".join(str(x) for x in l)) + match_count += len(l) + if not match_count: + print "no matches found in %s" % repo + print + if not ignore_failures: + sys.exit(2) + print "\nbuildplan" for op, pkgs in resolver.state.iter_pkg_ops(): print "%s %s" % (op.ljust(8), ", ".join(str(y) for y in reversed(pkgs))) |