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 A7F99139694 for ; Sat, 15 Jul 2017 02:29:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BAF031FC069; Sat, 15 Jul 2017 02:29:34 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 9CC971FC069 for ; Sat, 15 Jul 2017 02:29:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 92AFA3418E9 for ; Sat, 15 Jul 2017 02:29:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0F60974C0 for ; Sat, 15 Jul 2017 02:29:31 +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: <1500085544.c9e19d980de83ce9e3142f784f3a3a43d202c0e9.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/helpers/ X-VCS-Repository: proj/portage X-VCS-Files: repoman/pym/repoman/modules/linechecks/helpers/__init__.py repoman/pym/repoman/modules/linechecks/helpers/offset.py X-VCS-Directories: repoman/pym/repoman/modules/linechecks/helpers/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: c9e19d980de83ce9e3142f784f3a3a43d202c0e9 X-VCS-Branch: repoman Date: Sat, 15 Jul 2017 02:29:31 +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: e4841836-fc6b-45a4-841a-9a00c340fce0 X-Archives-Hash: 9a67357199106a11db8bfa5893448af1 commit: c9e19d980de83ce9e3142f784f3a3a43d202c0e9 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jul 15 01:01:52 2017 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Jul 15 02:25:44 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c9e19d98 repoman: New linechecks module, helpers .../repoman/modules/linechecks/helpers/__init__.py | 21 +++++++++++++++++++++ .../repoman/modules/linechecks/helpers/offset.py | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/repoman/pym/repoman/modules/linechecks/helpers/__init__.py b/repoman/pym/repoman/modules/linechecks/helpers/__init__.py new file mode 100644 index 000000000..e2d12afe4 --- /dev/null +++ b/repoman/pym/repoman/modules/linechecks/helpers/__init__.py @@ -0,0 +1,21 @@ +# Copyright 2015-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +doc = """Helpers plug-in module for repoman LineChecks. +Performs variable helpers checks on ebuilds.""" +__doc__ = doc[:] + + +module_spec = { + 'name': 'do', + 'description': doc, + 'provides':{ + 'nooffset-check': { + 'name': "nooffset", + 'sourcefile': "offset", + 'class': "NoOffsetWithHelpers", + 'description': doc, + }, + } +} + diff --git a/repoman/pym/repoman/modules/linechecks/helpers/offset.py b/repoman/pym/repoman/modules/linechecks/helpers/offset.py new file mode 100644 index 000000000..5d7624a68 --- /dev/null +++ b/repoman/pym/repoman/modules/linechecks/helpers/offset.py @@ -0,0 +1,22 @@ + +import re + +from repoman.modules.linechecks.base import LineCheck + + +class NoOffsetWithHelpers(LineCheck): + """ Check that the image location, the alternate root offset, and the + offset prefix (D, ROOT, ED, EROOT and EPREFIX) are not used with + helpers """ + + repoman_check_name = 'variable.usedwithhelpers' + # Ignore matches in quoted strings like this: + # elog "installed into ${ROOT}usr/share/php5/apc/." + _install_funcs = ( + 'docinto|do(compress|dir|hard)' + '|exeinto|fowners|fperms|insinto|into') + _quoted_vars = 'D|ROOT|ED|EROOT|EPREFIX' + re = re.compile( + r'^[^#"\']*\b(%s)\s+"?\$\{?(%s)\b.*' % + (_install_funcs, _quoted_vars)) + error = 'NO_OFFSET_WITH_HELPERS'