public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH v4] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI < 4. Fixes bug 379491.
@ 2014-01-15 21:35 Chris Reffett
  2014-01-15 22:23 ` [gentoo-portage-dev] " Duncan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Reffett @ 2014-01-15 21:35 UTC (permalink / raw
  To: gentoo-portage-dev

---
 pym/repoman/checks.py | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 85aa065..c814fa7 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -15,7 +15,7 @@ import repoman.errors as errors
 import portage
 from portage.eapi import eapi_supports_prefix, eapi_has_implicit_rdepend, \
 	eapi_has_src_prepare_and_src_configure, eapi_has_dosed_dohard, \
-	eapi_exports_AA
+	eapi_exports_AA, eapi_has_pkg_pretend
 
 class LineCheck(object):
 	"""Run a check on a line of an ebuild."""
@@ -731,6 +731,21 @@ class DeprecatedHasq(LineCheck):
 	re = re.compile(r'(^|.*\b)hasq\b')
 	error = errors.HASQ_ERROR
 
+# EAPI <2 checks
+class UndefinedSrcPrepareSrcConfigurePhases(LineCheck):
+	repoman_check_name = 'EAPI.incompatible'
+	src_configprepare_re = re.compile(r'\s*(src_configure|src_prepare)\s*\(\)')
+
+	def check_eapi(self, eapi):
+		return not eapi_has_src_prepare_and_src_configure(eapi)
+
+	def check(self, num, line):
+		m = self.src_configprepare_re.match(line)
+		if m is not None:
+			return ("'%s'" % m.group(1)) + \
+				" phase is not defined in EAPI < 2 on line: %d"
+
+
 # EAPI-3 checks
 class Eapi3DeprecatedFuncs(LineCheck):
 	repoman_check_name = 'EAPI.deprecated'
@@ -745,6 +760,20 @@ class Eapi3DeprecatedFuncs(LineCheck):
 			return ("'%s'" % m.group(1)) + \
 				" has been deprecated in EAPI=3 on line: %d"
 
+# EAPI <4 checks
+class UndefinedPkgPretendPhase(LineCheck):
+	repoman_check_name = 'EAPI.incompatible'
+	pkg_pretend_re = re.compile(r'\s*(pkg_pretend)\s*\(\)')
+
+	def check_eapi(self, eapi):
+		return not eapi_has_pkg_pretend(eapi)
+
+	def check(self, num, line):
+		m = self.pkg_pretend_re.match(line)
+		if m is not None:
+			return ("'%s'" % m.group(1)) + \
+				" phase is not defined in EAPI < 4 on line: %d"
+
 # EAPI-4 checks
 class Eapi4IncompatibleFuncs(LineCheck):
 	repoman_check_name = 'EAPI.incompatible'
-- 
1.8.5.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-portage-dev] Re: [PATCH v4] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI < 4. Fixes bug 379491.
  2014-01-15 21:35 [gentoo-portage-dev] [PATCH v4] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI < 4. Fixes bug 379491 Chris Reffett
@ 2014-01-15 22:23 ` Duncan
  2014-01-15 22:54 ` [gentoo-portage-dev] " Tom Wijsman
  2014-01-19  9:22 ` Mike Frysinger
  2 siblings, 0 replies; 4+ messages in thread
From: Duncan @ 2014-01-15 22:23 UTC (permalink / raw
  To: gentoo-portage-dev

Chris Reffett posted on Wed, 15 Jan 2014 16:35:48 -0500 as excerpted:

[snip the actual patch... and that's all the content there was]

TL;DR summary: please include commit descriptions and append one-line vN 
changelogs as the vN increases.

I'm not sure whether there's an accepted practice for portage or not, but 
on the various upstream mailing lists (mostly btrfs, AFAIK using the 
general lkml/kernel policy) I follow, accepted practice is to:

1) Always include a commit description.

2) For [PATCH vN] commits/posts, append to that description a short 
(generally but not always one-line) version changelog:

[Original commit description, generally unchanged unless a vN 
significantly changed something at the comment level.]

v2: Xxxx pointed out that I missed ...
v3: Oops, v2 was incomplete, ignore it
v4: Sebastian suggested I use eap_has_function instead of hardcoding EAPI

This makes is *FAR* easier for people to track a patch as it evolves, 
particularly if they've investigated an earlier version and now only care 
about what has changed since then, or if (like me) they don't really 
code, but are still interested in following the patch as it evolves, 
particularly if they've applied and are testing it!

Yes, people can go back and find the other version and do a diff, but the 
vN oneline changelog format is /so/ much easier, and people can still do 
a diff if they're actually interested once they read the one-line. =:^)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-portage-dev] [PATCH v4] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI < 4. Fixes bug 379491.
  2014-01-15 21:35 [gentoo-portage-dev] [PATCH v4] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI < 4. Fixes bug 379491 Chris Reffett
  2014-01-15 22:23 ` [gentoo-portage-dev] " Duncan
@ 2014-01-15 22:54 ` Tom Wijsman
  2014-01-19  9:22 ` Mike Frysinger
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Wijsman @ 2014-01-15 22:54 UTC (permalink / raw
  To: creffett; +Cc: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

On Wed, 15 Jan 2014 16:35:48 -0500
Chris Reffett <creffett@gentoo.org> wrote:

> ---
>  pym/repoman/checks.py | 31 ++++++++++++++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)

Can you please use In-Reply-To to avoid threads from breaking?

Due to the patches being in four threads, collapsing the threads gives
me four threads instead of a single thread. If everyone does this, it
becomes tedious to follow what is going on. This also doesn't allow one
to ignore threads which one cannot help on or has no interest in.

Thank you very much in advance.

-- 
With kind regards,

Tom Wijsman (TomWij)
Gentoo Developer

E-mail address  : TomWij@gentoo.org
GPG Public Key  : 6D34E57D
GPG Fingerprint : C165 AF18 AB4C 400B C3D2  ABF0 95B2 1FCD 6D34 E57D

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-portage-dev] [PATCH v4] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI < 4. Fixes bug 379491.
  2014-01-15 21:35 [gentoo-portage-dev] [PATCH v4] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI < 4. Fixes bug 379491 Chris Reffett
  2014-01-15 22:23 ` [gentoo-portage-dev] " Duncan
  2014-01-15 22:54 ` [gentoo-portage-dev] " Tom Wijsman
@ 2014-01-19  9:22 ` Mike Frysinger
  2 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2014-01-19  9:22 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Chris Reffett

[-- Attachment #1: Type: Text/Plain, Size: 157 bytes --]

Acked-by: Mike Frysinger <vapier@gentoo.org>

btw you should keep the patch summary short.  if it goes long, better to move 
it to the main body.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-19  9:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 21:35 [gentoo-portage-dev] [PATCH v4] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI < 4. Fixes bug 379491 Chris Reffett
2014-01-15 22:23 ` [gentoo-portage-dev] " Duncan
2014-01-15 22:54 ` [gentoo-portage-dev] " Tom Wijsman
2014-01-19  9:22 ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox