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 20AE91396D0 for ; Mon, 11 Sep 2017 21:43:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9B6F81FC058; Mon, 11 Sep 2017 21:43:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 76E781FC058 for ; Mon, 11 Sep 2017 21:43:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 515873417E7 for ; Mon, 11 Sep 2017 21:43:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 954D69081 for ; Mon, 11 Sep 2017 21:43:51 +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: <1505146395.0b861f2b8372026938dc2d0b18cbb24f787bb108.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/patches/ X-VCS-Repository: proj/portage X-VCS-Files: repoman/pym/repoman/modules/linechecks/patches/__init__.py repoman/pym/repoman/modules/linechecks/patches/patches.py X-VCS-Directories: repoman/pym/repoman/modules/linechecks/patches/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 0b861f2b8372026938dc2d0b18cbb24f787bb108 X-VCS-Branch: repoman Date: Mon, 11 Sep 2017 21:43:51 +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: 19fd3a3a-84e6-4cbd-9890-e35166d84d67 X-Archives-Hash: 17f725693095963f58801a0b83cc5282 commit: 0b861f2b8372026938dc2d0b18cbb24f787bb108 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jul 15 01:02:58 2017 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Mon Sep 11 16:13:15 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=0b861f2b repoman: New linechecks module, patches .../repoman/modules/linechecks/patches/__init__.py | 21 +++++++++++++++++++++ .../repoman/modules/linechecks/patches/patches.py | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/repoman/pym/repoman/modules/linechecks/patches/__init__.py b/repoman/pym/repoman/modules/linechecks/patches/__init__.py new file mode 100644 index 000000000..67434f911 --- /dev/null +++ b/repoman/pym/repoman/modules/linechecks/patches/__init__.py @@ -0,0 +1,21 @@ +# Copyright 2015-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +doc = """Patches plug-in module for repoman LineChecks. +Performs PATCHES variable checks on ebuilds.""" +__doc__ = doc[:] + + +module_spec = { + 'name': 'do', + 'description': doc, + 'provides':{ + 'patches-check': { + 'name': "patches", + 'sourcefile': "patches", + 'class': "EbuildPatches", + 'description': doc, + }, + } +} + diff --git a/repoman/pym/repoman/modules/linechecks/patches/patches.py b/repoman/pym/repoman/modules/linechecks/patches/patches.py new file mode 100644 index 000000000..63651cd7c --- /dev/null +++ b/repoman/pym/repoman/modules/linechecks/patches/patches.py @@ -0,0 +1,16 @@ + + +import re + +from repoman.modules.linechecks.base import LineCheck + + +class EbuildPatches(LineCheck): + """Ensure ebuilds use bash arrays for PATCHES to ensure white space safety""" + repoman_check_name = 'ebuild.patches' + re = re.compile(r'^\s*PATCHES=[^\(]') + error = 'PATCHES_ERROR' + + def check_eapi(self, eapi): + return eapi in ("0", "1", "2", "3", "4", "4-python", + "4-slot-abi", "5", "5-hdepend", "5-progress")