public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: man/, bin/, pym/portage/repository/
Date: Fri, 24 May 2013 04:47:06 +0000 (UTC)	[thread overview]
Message-ID: <1369370591.7f164c6fd1c47c254b1e1df101edb680492c0c12.zmedico@gentoo> (raw)

commit:     7f164c6fd1c47c254b1e1df101edb680492c0c12
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 24 04:43:11 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> 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'
 


             reply	other threads:[~2013-05-24  4:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-24  4:47 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-02-18  0:01 [gentoo-commits] proj/portage:master commit in: man/, bin/, pym/portage/repository/ Zac Medico
2012-02-17 23:57 Zac Medico
2012-02-04 14:39 Zac Medico
2012-02-04 14:26 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369370591.7f164c6fd1c47c254b1e1df101edb680492c0c12.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox