From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A3FBC1381F3 for ; Mon, 19 Aug 2013 15:43:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1F8D3E0EE8; Mon, 19 Aug 2013 15:43:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9C3E2E0EE8 for ; Mon, 19 Aug 2013 15:43:02 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9328B33EB90 for ; Mon, 19 Aug 2013 15:43:01 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id DF1FAE546B for ; Mon, 19 Aug 2013 15:42:58 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1376926348.539bc31a0b81d40efc812642f2682c98170cb1d1.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/packagerules/parser/context/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/packagerules/parser/context/action.py X-VCS-Directories: roverlay/packagerules/parser/context/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 539bc31a0b81d40efc812642f2682c98170cb1d1 X-VCS-Branch: master Date: Mon, 19 Aug 2013 15:42:58 +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: a65a516d-d947-477b-8618-c24d6d8b475a X-Archives-Hash: a89507eaea1ac08d9d9db97a435ca726 commit: 539bc31a0b81d40efc812642f2682c98170cb1d1 Author: André Erdmann mailerd de> AuthorDate: Mon Aug 19 15:32:28 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Mon Aug 19 15:32:28 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=539bc31a package rules, actions: run self-test --- roverlay/packagerules/parser/context/action.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/roverlay/packagerules/parser/context/action.py b/roverlay/packagerules/parser/context/action.py index febe88b..1828754 100644 --- a/roverlay/packagerules/parser/context/action.py +++ b/roverlay/packagerules/parser/context/action.py @@ -93,6 +93,11 @@ class RuleActionContext ( self._actions = list() # --- end of __init__ (...) --- + def _add_action ( self, action ): + if action.do_test ( return_on_error=False ): + self._actions.append ( action ) + # --- end of _add_action (...) --- + def _add_as_info_action ( self, keyword, argstr, orig_str, lino ): """Tries to add as package info-manipulating action. @@ -168,7 +173,7 @@ class RuleActionContext ( value = roverlay.strutil.unquote ( value ) if value: - self._actions.append ( action_cls ( key, value, lino ) ) + self._add_action ( action_cls ( key, value, lino ) ) else: raise ActionNeedsValue ( orig_str ) else: @@ -199,7 +204,7 @@ class RuleActionContext ( raise NotImplementedError ( "flags are not supported yet." ) elif len ( argv ) > 2 and all ( argv[:3] ): - self._actions.append ( + self._add_action ( action_cls ( key, self.namespace.get_object ( re.compile, argv [1] ), @@ -245,14 +250,14 @@ class RuleActionContext ( if argv [0] in self.KEYWORDS_ACTION_TRACE: if len ( argv ) > 1 and argv [1]: - self._actions.append ( + self._add_action ( roverlay.packagerules.actions.trace.TraceAction ( roverlay.strutil.unquote ( argv [1] ), lino ) ) else: - self._actions.append ( + self._add_action ( roverlay.packagerules.actions.trace.MarkAsModifiedAction ( lino ) @@ -268,7 +273,7 @@ class RuleActionContext ( try: if evar_cls: - self._actions.append ( + self._add_action ( evar_cls ( roverlay.strutil.unquote ( argv [1] ), lino ) ) else: