#7 non-reenterable recipes

open
nobody
None
5
2007-04-09
2007-04-09
ASManiac
No

i use AAP to build a group of related projects that are based on the same libraries.
i faced the problem when i tried to include some universal recipe from a target's recipe and from the library's one that the target depends on.
like that:
program.aap:
---
:include settings.aap
:child library.aap
...
---

library.aap
---
:include settings.aap
...
---

i got:
---
Aap: Skipping recipe already being read: "/AAP/settings.aap"
...
---

so, the settings.aap is not reenterable.

i examined AAP code and fixed Commands.py:
> diff Commands.py.bak Commands.py
---
2517c2517
< optional = optiondict.get("quiet"))
---
> optional = optiondict.get("quiet"), reread = not optiondict.get("once"))
---

and DoRead.py:
> diff DoRead.py.bak DoRead.py
84c84,86
< recipe_active[name] = 1
---
> if name not in recipe_active:
> recipe_active[name] = 0
> recipe_active[name] += 1
96c98,100
< del recipe_active[name]
---
> recipe_active[name] -= 1
> if not recipe_active[name]:
> del recipe_active[name]
---

i have achieved my goal and everything works perfectly now.

but i am not sure that my fix is conceptually correct.

Discussion