Attributes and :include
Tim Hemel <[email protected]> Mon, 27 Sep 2004 12:22:24 +0200
| Newsgroups | gmane.comp.tools.aap.user |
|---|---|
| Message-ID | <[email protected]> |
I am trying to debug an aap file and while doing that, I run into
some strange behaviour, which is not the actual problem, but might
be related.
I have the following files:
child.aap:
@for i in var2list(Items):
:print `get_attr(i)`
----------------------------------------------------
parent.aap:
Items = a { myattr=done }
b { myattr=notdone }
c
:attr { all = mine } $Items
@for i in var2list(_no.Items):
:print `get_attr(i)` ...
:include child.aap
-----------------------------------------------------
When I run this, I get the following output:
[tim@localhost ~]$ aap -f parent.aap
{'all': 'mine', 'myattr': 'done'} ...
{'all': 'mine', 'myattr': 'notdone'} ...
{'all': 'mine'} ...
{'all': 'mine', 'myattr': 'done'}
{'all': 'mine', 'myattr': 'notdone'}
{'all': 'mine'}
Aap: No target on the command line and no $TARGET, build rules or "all"
target in a recipe
Ok, so that works as expected, the attributes are available in both the
parent and the child recipe.
Now, I comment out the :attr command in the parent file, and we get an
unexpected result:
[tim@localhost ~]$ aap -f parent.aap
{} ...
{} ...
{} ...
{}
{}
{}
Aap: No target on the command line and no $TARGET, build rules or "all"
target in a recipe
Hey! where did all my attributes go?
The actual problem I am trying to solve has an :attr command, but tries
to access the attributes from within a dependency and an action, where
it, for some reason, fails to do this.
Tim
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php