public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/scan/ebuild/
Date: Wed,  1 Mar 2017 15:13:48 +0000 (UTC)	[thread overview]
Message-ID: <1488381125.44d6f11f37970a60ac2e4d7252180d96793e02d3.dolsen@gentoo> (raw)

commit:     44d6f11f37970a60ac2e4d7252180d96793e02d3
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  1 15:08:28 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Mar  1 15:12:05 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=44d6f11f

repoman: Warn about stale CVS keywords in ebuild header bug 610954

See Gentoo Council decision on 28 February 2017:
https://bugs.gentoo.org/611234

X-Gentoo-bug: 610954
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=610954

Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 repoman/pym/repoman/modules/scan/ebuild/checks.py | 11 +++++++----
 repoman/pym/repoman/modules/scan/ebuild/errors.py |  6 ++++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/repoman/pym/repoman/modules/scan/ebuild/checks.py b/repoman/pym/repoman/modules/scan/ebuild/checks.py
index 6d239c894..7a29af145 100644
--- a/repoman/pym/repoman/modules/scan/ebuild/checks.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/checks.py
@@ -1,6 +1,6 @@
 # -*- coding:utf-8 -*-
 # repoman: Checks
-# Copyright 2007-2014 Gentoo Foundation
+# Copyright 2007-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 """This module contains functions used in Repoman to ascertain the quality
@@ -89,7 +89,8 @@ class EbuildHeader(LineCheck):
 	gentoo_license = (
 		'# Distributed under the terms'
 		' of the GNU General Public License v2')
-	id_header = '# $Id$'
+	id_header_re = re.compile(r'.*\$(Id|Header)(:.*)?\$.*')
+	blank_line_re = re.compile(r'^$')
 	ignore_comment = False
 
 	def new(self, pkg):
@@ -108,8 +109,10 @@ class EbuildHeader(LineCheck):
 				return errors.COPYRIGHT_ERROR
 		elif num == 1 and line.rstrip('\n') != self.gentoo_license:
 			return errors.LICENSE_ERROR
-		#elif num == 2 and line.rstrip('\n') != self.id_header:
-		#	return errors.ID_HEADER_ERROR
+		elif num == 2 and self.id_header_re.match(line):
+			return errors.ID_HEADER_ERROR
+		elif num == 2 and not self.blank_line_re.match(line):
+			return errors.NO_BLANK_LINE_ERROR
 
 
 class EbuildWhitespace(LineCheck):

diff --git a/repoman/pym/repoman/modules/scan/ebuild/errors.py b/repoman/pym/repoman/modules/scan/ebuild/errors.py
index 3090de0d1..8387e35e6 100644
--- a/repoman/pym/repoman/modules/scan/ebuild/errors.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/errors.py
@@ -1,6 +1,6 @@
 # -*- coding:utf-8 -*-
 # repoman: Error Messages
-# Copyright 2007-2013 Gentoo Foundation
+# Copyright 2007-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals
@@ -10,7 +10,9 @@ COPYRIGHT_ERROR = (
 LICENSE_ERROR = (
 	'Invalid Gentoo/GPL License on line: %d')
 ID_HEADER_ERROR = (
-	'Malformed Id header on line: %d')
+	'Stale CVS header on line: %d')
+NO_BLANK_LINE_ERROR = (
+	'Non-blank line after header on line: %d')
 LEADING_SPACES_ERROR = (
 	'Ebuild contains leading spaces on line: %d')
 TRAILING_WHITESPACE_ERROR = (


             reply	other threads:[~2017-03-01 15:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01 15:13 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-30  5:20 [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/scan/ebuild/ Zac Medico
2018-03-30  4:23 ` [gentoo-commits] proj/portage:master " Zac Medico
2017-07-02 17:53 Michał Górny
2017-02-22  9:29 Michał Górny
2017-02-22  9:29 Michał Górny
2017-02-22  9:29 Michał Górny
2017-02-22  8:37 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=1488381125.44d6f11f37970a60ac2e4d7252180d96793e02d3.dolsen@gentoo \
    --to=dolsen@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