aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2017-03-01 07:08:28 -0800
committerBrian Dolbec <dolsen@gentoo.org>2017-03-01 07:12:05 -0800
commit44d6f11f37970a60ac2e4d7252180d96793e02d3 (patch)
tree82f857cffbe4f91c74ea4d4070be451a1ace0329
parentchecksum: Add blake2* and sha3 hashes from hashlib 3.6+ (diff)
downloadportage-44d6f11f.tar.gz
portage-44d6f11f.tar.bz2
portage-44d6f11f.zip
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@gentoo.org>
-rw-r--r--repoman/pym/repoman/modules/scan/ebuild/checks.py11
-rw-r--r--repoman/pym/repoman/modules/scan/ebuild/errors.py6
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 = (