From 938658b03bd7b6b3d3afcbf8ddae74530524ec26 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 28 Aug 2007 15:36:18 +0000 Subject: Move some of the less expensive QA checks before dep_check() so that they're still done even in --force mode. svn path=/main/trunk/; revision=7718 --- bin/repoman | 212 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/bin/repoman b/bin/repoman index ee36faea4..9e78a964f 100755 --- a/bin/repoman +++ b/bin/repoman @@ -1248,112 +1248,6 @@ for x in scanlist: stats["usage.obsolete"] += 1 fails["usage.obsolete"].append("%s/%s.ebuild: not migrated to modular X" % (x, y)) - if "--force" in myoptions: - # The dep_check() calls are the most expensive QA test. If --force - # is enabled, there's no point in wasting time on these since the - # user is intent on forcing the commit anyway. - continue - - for keyword,arch,groups in arches: - - if not profiles.has_key(arch): - # A missing profile will create an error further down - # during the KEYWORDS verification. - continue - - for prof in profiles[arch]: - - profdir = portdir+"/profiles/"+prof[0] - - if prof[0] in arch_caches: - dep_settings = arch_caches[prof[0]] - else: - dep_settings = portage.config( - config_profile_path=profdir, - config_incrementals=portage.const.INCREMENTALS, - local_config=False) - arch_caches[prof[0]] = dep_settings - while True: - try: - # Protect ACCEPT_KEYWORDS from config.regenerate() - # (just in case) - dep_settings.incrementals.remove("ACCEPT_KEYWORDS") - except ValueError: - break - - xmatch_cache_key = (prof[0], tuple(groups)) - xcache = arch_xmatch_caches.get(xmatch_cache_key) - if xcache is None: - portdb.melt() - portdb.freeze() - xcache = portdb.xcache - arch_xmatch_caches[xmatch_cache_key] = xcache - - trees["/"]["porttree"].settings = dep_settings - portdb.mysettings = dep_settings - portdb.xcache = xcache - # for package.use.mask support inside dep_check - dep_settings.setcpv("/".join((catdir, y))) - dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups) - # just in case, prevent config.reset() from nuking these. - dep_settings.backup_changes("ACCEPT_KEYWORDS") - - for myprovide in myaux["PROVIDE"].split(): - prov_cp = portage.dep_getkey(myprovide) - if prov_cp not in dep_settings.getvirtuals(): - stats["virtual.unavailable"]+=1 - fails["virtual.unavailable"].append(x+"/"+y+".ebuild: "+keyword+"("+prof[0]+") "+prov_cp) - - if not baddepsyntax: - ismasked = os.path.join(catdir, y) not in \ - portdb.xmatch("list-visible", x) - if ismasked: - if "--ignore-masked" in myoptions: - continue - #we are testing deps for a masked package; give it some lee-way - suffix="masked" - matchmode="match-all" - else: - suffix="" - matchmode="match-visible" - - if prof[1] == "dev": - suffix=suffix+"indev" - - for mytype,mypos in [["DEPEND",len(missingvars)],["RDEPEND",len(missingvars)+1],["PDEPEND",len(missingvars)+2]]: - - mykey=mytype+".bad"+suffix - myvalue = myaux[mytype] - if not myvalue: - continue - try: - mydep = portage.dep_check(myvalue, portdb, - dep_settings, use="all", mode=matchmode, - trees=trees) - except KeyError, e: - stats[mykey]=stats[mykey]+1 - fails[mykey].append(x+"/"+y+".ebuild: "+keyword+"("+prof[0]+") "+repr(e[0])) - continue - - if mydep[0]==1: - if mydep[1]!=[]: - #we have some unsolvable deps - #remove ! deps, which always show up as unsatisfiable - d=0 - while d' "+checkdir+"/"+y+".ebuild >/dev/null 2>&1"): stats["ebuild.nesteddie"]=stats["ebuild.nesteddie"]+1 @@ -1494,6 +1388,112 @@ for x in scanlist: previous_line = line del previous_line + if "--force" in myoptions: + # The dep_check() calls are the most expensive QA test. If --force + # is enabled, there's no point in wasting time on these since the + # user is intent on forcing the commit anyway. + continue + + for keyword,arch,groups in arches: + + if not profiles.has_key(arch): + # A missing profile will create an error further down + # during the KEYWORDS verification. + continue + + for prof in profiles[arch]: + + profdir = portdir+"/profiles/"+prof[0] + + if prof[0] in arch_caches: + dep_settings = arch_caches[prof[0]] + else: + dep_settings = portage.config( + config_profile_path=profdir, + config_incrementals=portage.const.INCREMENTALS, + local_config=False) + arch_caches[prof[0]] = dep_settings + while True: + try: + # Protect ACCEPT_KEYWORDS from config.regenerate() + # (just in case) + dep_settings.incrementals.remove("ACCEPT_KEYWORDS") + except ValueError: + break + + xmatch_cache_key = (prof[0], tuple(groups)) + xcache = arch_xmatch_caches.get(xmatch_cache_key) + if xcache is None: + portdb.melt() + portdb.freeze() + xcache = portdb.xcache + arch_xmatch_caches[xmatch_cache_key] = xcache + + trees["/"]["porttree"].settings = dep_settings + portdb.mysettings = dep_settings + portdb.xcache = xcache + # for package.use.mask support inside dep_check + dep_settings.setcpv("/".join((catdir, y))) + dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups) + # just in case, prevent config.reset() from nuking these. + dep_settings.backup_changes("ACCEPT_KEYWORDS") + + for myprovide in myaux["PROVIDE"].split(): + prov_cp = portage.dep_getkey(myprovide) + if prov_cp not in dep_settings.getvirtuals(): + stats["virtual.unavailable"]+=1 + fails["virtual.unavailable"].append(x+"/"+y+".ebuild: "+keyword+"("+prof[0]+") "+prov_cp) + + if not baddepsyntax: + ismasked = os.path.join(catdir, y) not in \ + portdb.xmatch("list-visible", x) + if ismasked: + if "--ignore-masked" in myoptions: + continue + #we are testing deps for a masked package; give it some lee-way + suffix="masked" + matchmode="match-all" + else: + suffix="" + matchmode="match-visible" + + if prof[1] == "dev": + suffix=suffix+"indev" + + for mytype,mypos in [["DEPEND",len(missingvars)],["RDEPEND",len(missingvars)+1],["PDEPEND",len(missingvars)+2]]: + + mykey=mytype+".bad"+suffix + myvalue = myaux[mytype] + if not myvalue: + continue + try: + mydep = portage.dep_check(myvalue, portdb, + dep_settings, use="all", mode=matchmode, + trees=trees) + except KeyError, e: + stats[mykey]=stats[mykey]+1 + fails[mykey].append(x+"/"+y+".ebuild: "+keyword+"("+prof[0]+") "+repr(e[0])) + continue + + if mydep[0]==1: + if mydep[1]!=[]: + #we have some unsolvable deps + #remove ! deps, which always show up as unsatisfiable + d=0 + while d