[Cook] find the cookbook up the path?

Aryeh M. Friedman aryeh at m-net.arbornet.org
Wed Sep 24 12:14:06 EST 2003


> Tom Satter schrieb am Mittwoch 24 September 2003 01:07:
> > We just wrote a script called docook that lookup up the file
> > hierarchy for a Howto.cook file and then used that.  If no
> > Howto.cook was found within some number of hierarchical levels
> > (like 6) then we reported an error.
> 
> thanks alot, I'll simply do the same --- hmmm... sometimes I wonder why the 
> obvious isn't allways obvious... :-)

	What is obvious is not always "right"... what I mean by this is
your essencially recreating the whole problem cook was designed to solve
(whole project dependancy graphs) [see either the chapter on whole project
builds, the tutorial or a new guide I am in the middle of passing around to
those intrested on how to intergrate cook/aegis/fhist/tardy in what
ever order you wish {1}]...  the basic idea here being that for any given
target there should be a single well defined method for how to build it
and if you follow the DRY [don't repeat yourself] princible as put forward
by Hunt and Thomas ("The Pragmatic Programmer") you should "never" have more
then one physical representation of the recipe for this target.

	Don't worry almost of us made the same mistake when we came to cook
for the first time... I was essencially recreating recursive makes and not
knowing it in my first  few cookbooks....

	As to a practicle answer for your first question... assuming your
not using a change/config managment system you should establish some root
dir for your project and then create an alias like this (csh) to do cook:

alias docook 'set foo=`pwd`;cd $PRJ_ROOT;cook !\*;cd $foo'

	--Aryeh

Notes:

1. If me and Peter can work some formating issues the guide should be
a part of the next release of cook and/or aegis (more likelly the second)
----- End of forwarded message (env-from aryeh) -----



More information about the Cook-users mailing list