Gentoo Archives: gentoo-portage-dev

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Sergei Trofimovich <siarheit@××××××.com>
Subject: [gentoo-portage-dev] [PATCH] Switch to new git '# $Id$' header format
Date: Sun, 09 Aug 2015 18:12:07
Message-Id: 1439143917-6268-1-git-send-email-slyfox@gentoo.org
1 From: Sergei Trofimovich <siarheit@××××××.com>
2
3 Currently repoman complains on every ebuild in ::gentoo.
4
5 Signed-off-by: Sergei Trofimovich <siarheit@××××××.com>
6 ---
7 pym/repoman/checks.py | 7 +++----
8 pym/repoman/errors.py | 2 +-
9 2 files changed, 4 insertions(+), 5 deletions(-)
10
11 diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
12 index 5f37648..4ab23d1 100644
13 --- a/pym/repoman/checks.py
14 +++ b/pym/repoman/checks.py
15 @@ -81,7 +81,7 @@ class EbuildHeader(LineCheck):
16 # Why a regex here, use a string match
17 # gentoo_license = re.compile(r'^# Distributed under the terms of the GNU General Public License v2$')
18 gentoo_license = '# Distributed under the terms of the GNU General Public License v2'
19 - cvs_header = re.compile(r'^# \$Header: .*\$$')
20 + id_header = '# $Id$'
21 ignore_comment = False
22
23 def new(self, pkg):
24 @@ -100,9 +100,8 @@ class EbuildHeader(LineCheck):
25 return errors.COPYRIGHT_ERROR
26 elif num == 1 and line.rstrip('\n') != self.gentoo_license:
27 return errors.LICENSE_ERROR
28 - elif num == 2:
29 - if not self.cvs_header.match(line):
30 - return errors.CVS_HEADER_ERROR
31 + elif num == 2 and line.rstrip('\n') != self.id_header:
32 + return errors.ID_HEADER_ERROR
33
34
35 class EbuildWhitespace(LineCheck):
36 diff --git a/pym/repoman/errors.py b/pym/repoman/errors.py
37 index 3833be6..74a5959 100644
38 --- a/pym/repoman/errors.py
39 +++ b/pym/repoman/errors.py
40 @@ -6,7 +6,7 @@ from __future__ import unicode_literals
41
42 COPYRIGHT_ERROR = 'Invalid Gentoo Copyright on line: %d'
43 LICENSE_ERROR = 'Invalid Gentoo/GPL License on line: %d'
44 -CVS_HEADER_ERROR = 'Malformed CVS Header on line: %d'
45 +ID_HEADER_ERROR = 'Malformed Id header on line: %d'
46 LEADING_SPACES_ERROR = 'Ebuild contains leading spaces on line: %d'
47 TRAILING_WHITESPACE_ERROR = 'Trailing whitespace error on line: %d'
48 READONLY_ASSIGNMENT_ERROR = 'Ebuild contains assignment to read-only variable on line: %d'
49 --
50 2.5.0

Replies