commit:     aef2873cd86d91ffd4badec45d7d310d917a12f7
Author:     Sergei Trofimovich <siarheit <AT> google <DOT> com>
AuthorDate: Mon Aug 10 14:19:26 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug 10 14:43:30 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=aef2873c

repoman: Switch to new git '# $Id$' header format

Currently repoman complains on every ebuild in ::gentoo.

Signed-off-by: Sergei Trofimovich <siarheit <AT> google.com>
Reviewed-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 pym/repoman/checks.py | 7 +++----
 pym/repoman/errors.py | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 5f37648..4ab23d1 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -81,7 +81,7 @@ class EbuildHeader(LineCheck):
        # Why a regex here, use a string match
        # gentoo_license = re.compile(r'^# Distributed under the terms of the 
GNU General Public License v2$')
        gentoo_license = '# Distributed under the terms of the GNU General 
Public License v2'
-       cvs_header = re.compile(r'^# \$Header: .*\$$')
+       id_header = '# $Id$'
        ignore_comment = False
 
        def new(self, pkg):
@@ -100,9 +100,8 @@ class EbuildHeader(LineCheck):
                                return errors.COPYRIGHT_ERROR
                elif num == 1 and line.rstrip('\n') != self.gentoo_license:
                        return errors.LICENSE_ERROR
-               elif num == 2:
-                       if not self.cvs_header.match(line):
-                               return errors.CVS_HEADER_ERROR
+               elif num == 2 and line.rstrip('\n') != self.id_header:
+                       return errors.ID_HEADER_ERROR
 
 
 class EbuildWhitespace(LineCheck):

diff --git a/pym/repoman/errors.py b/pym/repoman/errors.py
index 3833be6..74a5959 100644
--- a/pym/repoman/errors.py
+++ b/pym/repoman/errors.py
@@ -6,7 +6,7 @@ from __future__ import unicode_literals
 
 COPYRIGHT_ERROR = 'Invalid Gentoo Copyright on line: %d'
 LICENSE_ERROR = 'Invalid Gentoo/GPL License on line: %d'
-CVS_HEADER_ERROR = 'Malformed CVS Header on line: %d'
+ID_HEADER_ERROR = 'Malformed Id header on line: %d'
 LEADING_SPACES_ERROR = 'Ebuild contains leading spaces on line: %d'
 TRAILING_WHITESPACE_ERROR = 'Trailing whitespace error on line: %d'
 READONLY_ASSIGNMENT_ERROR = 'Ebuild contains assignment to read-only variable 
on line: %d'

Reply via email to