public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/packagerules/parser/context/
Date: Mon, 19 Aug 2013 15:42:58 +0000 (UTC)	[thread overview]
Message-ID: <1376926348.539bc31a0b81d40efc812642f2682c98170cb1d1.dywi@gentoo> (raw)

commit:     539bc31a0b81d40efc812642f2682c98170cb1d1
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Aug 19 15:32:28 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> 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 <keyword, argstr> 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:


             reply	other threads:[~2013-08-19 15:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19 15:42 André Erdmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-08-19 15:42 [gentoo-commits] proj/R_overlay:master commit in: roverlay/packagerules/parser/context/ André Erdmann
2013-08-01 17:14 André Erdmann
2013-06-13 16:34 André Erdmann
2013-06-13 16:34 André Erdmann
2013-06-05 18:08 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-13 16:34 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-04-25 16:44 André Erdmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376926348.539bc31a0b81d40efc812642f2682c98170cb1d1.dywi@gentoo \
    --to=dywi@mailerd.de \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox