From 32a91f4b3918b9b4682faf04b76e1197b02d3243 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 22 Nov 2010 17:22:04 -0800 Subject: repoman: enable dep check with empty KEYWORDS Since no KEYWORDS are set, and those are normally used to decide which profiles to check, we use an empty profile with effective ACCEPT_KEYWORDS set to **. --- bin/repoman | 62 +++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 12 deletions(-) (limited to 'bin') diff --git a/bin/repoman b/bin/repoman index e6599bfa9..2b0df1268 100755 --- a/bin/repoman +++ b/bin/repoman @@ -635,9 +635,19 @@ class ProfileDesc(object): def __init__(self, arch, status, sub_path, tree_path): self.arch = arch self.status = status - self.sub_path = normalize_path(sub_path.lstrip(os.sep)) + if sub_path: + sub_path = normalize_path(sub_path.lstrip(os.sep)) + self.sub_path = sub_path self.tree_path = tree_path - self.abs_path = os.path.join(tree_path, 'profiles', self.sub_path) + if tree_path: + self.abs_path = os.path.join(tree_path, 'profiles', self.sub_path) + else: + self.abs_path = tree_path + + def __str__(self): + if self.sub_path: + return self.sub_path + return 'empty profile' profile_list = [] valid_profile_types = frozenset(['dev', 'exp', 'stable']) @@ -742,6 +752,11 @@ for prof in profile_list: profile_sub_paths.add(prof.sub_path) profiles.setdefault(prof.arch, []).append(prof) +# Use an empty profile for checking dependencies of +# packages that have empty KEYWORDS. +prof = ProfileDesc('**', 'stable', '', '') +profiles.setdefault(prof.arch, []).append(prof) + for x in repoman_settings.archlist(): if x[0] == "~": continue @@ -1565,7 +1580,7 @@ for x in scanlist: previous_keywords = slot_keywords.get(myaux["SLOT"]) if previous_keywords is None: slot_keywords[myaux["SLOT"]] = set() - elif not live_ebuild: + elif ebuild_archs and not live_ebuild: dropped_keywords = previous_keywords.difference(ebuild_archs) if dropped_keywords: stats["KEYWORDS.dropped"] += 1 @@ -1622,6 +1637,10 @@ for x in scanlist: else: arches.append([keyword, keyword, [keyword]]) allmasked = False + if not arches: + # Use an empty profile for checking dependencies of + # packages that have empty KEYWORDS. + arches.append(['**', '**', ['**']]) baddepsyntax = False badlicsyntax = False @@ -1866,15 +1885,22 @@ for x in scanlist: # just in case, prevent config.reset() from nuking these. dep_settings.backup_changes("ACCEPT_KEYWORDS") - for prov_cp in provide_cps: - if prov_cp not in dep_settings.getvirtuals(): - stats["virtual.unavailable"]+=1 - fails["virtual.unavailable"].append("%s: %s(%s) %s" % \ - (relative_path, keyword, prof.sub_path, prov_cp)) + if prof.sub_path: + # old-style virtuals currently aren't + # resolvable with empty profile, since + # mappings from 'virtuals' files are + # unavailable (it would be expensive to + # search for PROVIDE in all ebuilds) + for prov_cp in provide_cps: + if prov_cp not in dep_settings.getvirtuals(): + stats["virtual.unavailable"] += 1 + fails["virtual.unavailable"].append( + "%s: %s(%s) %s" % (relative_path, keyword, + prof.sub_path, prov_cp)) if not baddepsyntax: - ismasked = os.path.join(catdir, y) not in \ - portdb.xmatch("list-visible", x) + ismasked = not ebuild_archs or \ + pkg.cp not in portdb.xmatch("list-visible", x) if ismasked: if not have_pmasked: have_pmasked = bool(dep_settings._getMaskAtom( @@ -1908,22 +1934,34 @@ for x in scanlist: if success: if atoms: + + if not prof.sub_path: + # old-style virtuals currently aren't + # resolvable with empty profile, since + # 'virtuals' mappings are unavailable + # (it would be expensive to search + # for PROVIDE in all ebuilds) + atoms = [atom for atom in atoms if not \ + (atom.cp.startswith('virtual/') and \ + not portdb.cp_list(atom.cp))] + #we have some unsolvable deps #remove ! deps, which always show up as unsatisfiable atoms = [str(atom.unevaluated_atom) \ for atom in atoms if not atom.blocker] + #if we emptied out our list, continue: if not atoms: continue stats[mykey]=stats[mykey]+1 fails[mykey].append("%s: %s(%s) %s" % \ (relative_path, keyword, - prof.sub_path, repr(atoms))) + prof, repr(atoms))) else: stats[mykey]=stats[mykey]+1 fails[mykey].append("%s: %s(%s) %s" % \ (relative_path, keyword, - prof.sub_path, repr(atoms))) + prof, repr(atoms))) # Check for 'all unstable' or 'all masked' -- ACCEPT_KEYWORDS is stripped # XXX -- Needs to be implemented in dep code. Can't determine ~arch nicely. -- cgit v1.2.3-1-g7c22