From 6032d49b18c5bab2ba37888de37f9a1e825d3cf9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 23 Aug 2009 16:38:24 +0000 Subject: =?UTF-8?q?Add=20a=20LIVEVCS.unmasked=20category=20for=20ebuilds?= =?UTF-8?q?=20that=20have=20non-empty=20KEYWORDS=20and=20are=20not=20maske?= =?UTF-8?q?d=20in=20the=20global=20package.mask.=20Thanks=20to=20Diego=20E?= =?UTF-8?q?.=20Petten=C3=B2=20for=20the=20suggestion.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/main/trunk/; revision=14132 --- bin/repoman | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/repoman b/bin/repoman index aecd45ca0..8e670f118 100755 --- a/bin/repoman +++ b/bin/repoman @@ -302,6 +302,7 @@ qahelp={ "variable.invalidchar":"A variable contains an invalid character that is not part of the ASCII character set", "variable.readonly":"Assigning a readonly variable", "LIVEVCS.stable":"This ebuild is a live checkout from a VCS but has stable keywords.", + "LIVEVCS.unmasked":"This ebuild is a live checkout from a VCS but has keywords and is not masked in the global package.mask.", "IUSE.invalid":"This ebuild has a variable in IUSE that is not in the use.desc or use.local.desc file", "IUSE.undefined":"This ebuild does not define IUSE (style guideline says to define IUSE even when empty)", "LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.", @@ -362,7 +363,8 @@ qawarnings = set(( "virtual.unavailable", "usage.obsolete", "upstream.workaround", -"LIVEVCS.stable" +"LIVEVCS.stable", +"LIVEVCS.unmasked", )) non_ascii_re = re.compile(r'[^\x00-\x7f]') @@ -570,6 +572,7 @@ valid_profile_types = frozenset(['dev', 'exp', 'stable']) kwlist = set() liclist = set() uselist = set() +global_pmasklines = [] for path in portdb.porttrees: try: @@ -600,6 +603,9 @@ for path in portdb.porttrees: if x: uselist.add(use_prefix + x[0]) + global_pmasklines.append(portage.util.grabfile_package( + os.path.join(path, 'profiles', 'package.mask'), recursive=1)) + desc_path = os.path.join(path, 'profiles', 'profiles.desc') try: desc_file = codecs.open(_unicode_encode(desc_path, @@ -635,6 +641,21 @@ for path in portdb.porttrees: repoman_settings['PORTAGE_ARCHLIST'] = ' '.join(sorted(kwlist)) repoman_settings.backup_changes('PORTAGE_ARCHLIST') +global_pmasklines = portage.util.stack_lists(global_pmasklines, incremental=1) +global_pmaskdict = {} +for x in global_pmasklines: + global_pmaskdict.setdefault(portage.dep_getkey(x), []).append(x) +del global_pmasklines + +def has_global_mask(pkg): + mask_atoms = global_pmaskdict.get(pkg.cp) + if mask_atoms: + pkg_list = [pkg] + for x in mask_atoms: + if portage.dep.match_from_list(x, pkg_list): + return x + return None + # Ensure that profile sub_path attributes are unique. Process in reverse order # so that profiles with duplicate sub_path from overlays will override # profiles with the same sub_path from parent repos. @@ -1347,6 +1368,10 @@ for x in scanlist: bad_stable_keywords) del bad_stable_keywords + if keywords and not has_global_mask(pkg): + stats["LIVEVCS.unmasked"] += 1 + fails["LIVEVCS.unmasked"].append(relative_path) + if options.ignore_arches: arches = [[repoman_settings["ARCH"], repoman_settings["ARCH"], repoman_settings["ACCEPT_KEYWORDS"].split()]] -- cgit v1.2.3-1-g7c22