From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F3AA81381F3 for ; Fri, 24 May 2013 04:47:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C8F27E0869; Fri, 24 May 2013 04:47:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3BE0CE0869 for ; Fri, 24 May 2013 04:47:09 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D86D933E11B for ; Fri, 24 May 2013 04:47:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 48025E4404 for ; Fri, 24 May 2013 04:47:06 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1369370591.7f164c6fd1c47c254b1e1df101edb680492c0c12.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: man/, bin/, pym/portage/repository/ X-VCS-Repository: proj/portage X-VCS-Files: bin/repoman man/portage.5 man/repoman.1 pym/portage/repository/config.py X-VCS-Directories: man/ bin/ pym/portage/repository/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 7f164c6fd1c47c254b1e1df101edb680492c0c12 X-VCS-Branch: master Date: Fri, 24 May 2013 04:47:06 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: fd388748-2d17-4a95-ad67-b300aeef8f12 X-Archives-Hash: d6cbf4c51fdd172c205a24a27cccc0ad commit: 7f164c6fd1c47c254b1e1df101edb680492c0c12 Author: Zac Medico gentoo org> AuthorDate: Fri May 24 04:43:11 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri May 24 04:43:11 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7f164c6f repoman: check for deprecated EAPIs, bug #470670 This adds support for repo.eapi.banned (fatal) and repo.eapi.deprecated (warning) checks which are controlled by eapis-banned and eapis-deprecated settings in a repository's metadata/layout.conf. --- bin/repoman | 13 +++++++++++++ man/portage.5 | 8 +++++++- man/repoman.1 | 10 +++++++++- pym/portage/repository/config.py | 15 ++++++++++++++- 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/bin/repoman b/bin/repoman index 20832ec..c4a5a22 100755 --- a/bin/repoman +++ b/bin/repoman @@ -380,6 +380,8 @@ qahelp = { "metadata.bad": "Bad metadata.xml files", "metadata.warning": "Warnings in metadata.xml files", "portage.internal": "The ebuild uses an internal Portage function or variable", + "repo.eapi.banned": "The ebuild uses an EAPI which is banned by the repository's metadata/layout.conf settings", + "repo.eapi.deprecated": "The ebuild uses an EAPI which is deprecated by the repository's metadata/layout.conf settings", "virtual.oldstyle": "The ebuild PROVIDEs an old-style virtual (see GLEP 37)", "virtual.suspect": "Ebuild contains a package that usually should be pulled via virtual/, not directly.", "usage.obsolete": "The ebuild makes use of an obsolete construct", @@ -424,6 +426,7 @@ qawarnings = set(( "wxwidgets.eclassnotused", "metadata.warning", "portage.internal", +"repo.eapi.deprecated", "usage.obsolete", "upstream.workaround", "LIVEVCS.stable", @@ -1815,6 +1818,16 @@ for x in effective_scanlist: inherited = pkg.inherited live_ebuild = live_eclasses.intersection(inherited) + if repo_config.eapi_is_banned(eapi): + stats["repo.eapi.banned"] += 1 + fails["repo.eapi.banned"].append( + "%s: %s" % (relative_path, eapi)) + + elif repo_config.eapi_is_deprecated(eapi): + stats["repo.eapi.deprecated"] += 1 + fails["repo.eapi.deprecated"].append( + "%s: %s" % (relative_path, eapi)) + for k, v in myaux.items(): if not isinstance(v, basestring): continue diff --git a/man/portage.5 b/man/portage.5 index 46a64f1..e462266 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -1,4 +1,4 @@ -.TH "PORTAGE" "5" "Nov 2012" "Portage VERSION" "Portage" +.TH "PORTAGE" "5" "May 2013" "Portage VERSION" "Portage" .SH NAME portage \- the heart of Gentoo .SH "DESCRIPTION" @@ -875,6 +875,12 @@ masters = gentoo java-overlay # indicate that this repo can be used as a substitute for foo-overlay aliases = foo-overlay +# indicate that ebuilds with the specified EAPIs are banned +eapis\-banned = 0 1 + +# indicate that ebuilds with the specified EAPIs are deprecated +eapis\-deprecated = 2 3 + # sign commits in this repo, which requires Git >=1.7.9, and # key configured by `git config user.signingkey key_id` sign\-commits = true diff --git a/man/repoman.1 b/man/repoman.1 index 912ba65..bf498d4 100644 --- a/man/repoman.1 +++ b/man/repoman.1 @@ -1,4 +1,4 @@ -.TH "REPOMAN" "1" "Oct 2012" "Portage VERSION" "Portage" +.TH "REPOMAN" "1" "May 2013" "Portage VERSION" "Portage" .SH NAME repoman \- Gentoo's program to enforce a minimal level of quality assurance in packages added to the portage tree .SH SYNOPSIS @@ -326,6 +326,14 @@ Missing metadata.xml files .B metadata.warning Warnings in metadata.xml files .TP +.B repo.eapi.banned +The ebuild uses an EAPI which is banned by the repository's +metadata/layout.conf settings. +.TP +.B repo.eapi.deprecated +The ebuild uses an EAPI which is deprecated by the repository's +metadata/layout.conf settings. +.TP .B portage.internal The ebuild uses an internal Portage function or variable .TP diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 969fce4..da8c365 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -80,7 +80,8 @@ class RepoConfig(object): 'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name', 'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority', 'profile_formats', 'sign_commit', 'sign_manifest', 'sync', - 'thin_manifest', 'update_changelog', 'user_location') + 'thin_manifest', 'update_changelog', 'user_location', + '_eapis_banned', '_eapis_deprecated') def __init__(self, name, repo_opts): """Build a RepoConfig with options in repo_opts @@ -198,6 +199,15 @@ class RepoConfig(object): self.portage1_profiles_compat = not eapi_allows_directories_on_profile_level_and_repository_level(eapi) and \ layout_data['profile-formats'] == ('portage-1-compat',) + self._eapis_banned = frozenset(layout_data['eapis-banned']) + self._eapis_deprecated = frozenset(layout_data['eapis-deprecated']) + + def eapi_is_banned(self, eapi): + return eapi in self._eapis_banned + + def eapi_is_deprecated(self, eapi): + return eapi in self._eapis_deprecated + def iter_pregenerated_caches(self, auxdbkeys, readonly=True, force=False): """ Reads layout.conf cache-formats from left to right and yields cache @@ -745,6 +755,9 @@ def parse_layout_conf(repo_location, repo_name=None): data['allow-provide-virtual'] = \ layout_data.get('allow-provide-virtuals', 'false').lower() == 'true' + data['eapis-banned'] = tuple(layout_data.get('eapis-banned', '').split()) + data['eapis-deprecated'] = tuple(layout_data.get('eapis-deprecated', '').split()) + data['sign-commit'] = layout_data.get('sign-commits', 'false').lower() \ == 'true'