From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C5808139694 for ; Wed, 1 Mar 2017 15:13:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D5BCEE0C5F; Wed, 1 Mar 2017 15:13:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A0A28E0C5F for ; Wed, 1 Mar 2017 15:13:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F0CCE3416D0 for ; Wed, 1 Mar 2017 15:13:50 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8331658AF for ; Wed, 1 Mar 2017 15:13:48 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1488381125.44d6f11f37970a60ac2e4d7252180d96793e02d3.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/scan/ebuild/ X-VCS-Repository: proj/portage X-VCS-Files: repoman/pym/repoman/modules/scan/ebuild/checks.py repoman/pym/repoman/modules/scan/ebuild/errors.py X-VCS-Directories: repoman/pym/repoman/modules/scan/ebuild/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 44d6f11f37970a60ac2e4d7252180d96793e02d3 X-VCS-Branch: master Date: Wed, 1 Mar 2017 15:13:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 6913c247-b918-4d54-925c-8813a8da6374 X-Archives-Hash: 23d2f3b8fd926e89483f2ca91fa634ed commit: 44d6f11f37970a60ac2e4d7252180d96793e02d3 Author: Ulrich Müller gentoo org> AuthorDate: Wed Mar 1 15:08:28 2017 +0000 Commit: Brian Dolbec gentoo 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 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 = (