[Cook] find the cookbook up the path?
Susanne Oberhauser
froh at SuSE.de
Wed Sep 24 20:05:31 EST 2003
On Wednesday 24 September 2003 04:14, Aryeh M. Friedman wrote:
> > 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) [...]
> 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....
Ok, I was not specific enough. I have _one_ toplevel Howto.cook file
in each of my *independend* project(let)s. Now if my $PWD is below
that top level, I still want to get the project cooked using the top
level file and starting from the top level directory.
This attached script 'lookandcook', inspired by Tom's hints (thanks
again :), will do exactly this for me:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lookandcook
Type: application/x-sh
Size: 1130 bytes
Desc: lookandcook script to find the cookbook up the tree if there is none in $PWD
URL: <http://lists.auug.org.au/pipermail/cook-users/attachments/20030924/94324a75/attachment.sh>
-------------- next part --------------
No recursive cooking or cookbook replication in sight ;)
> As to a practicle answer for your first question...
> alias docook 'set foo=`pwd`;cd $PRJ_ROOT;cook !\*;cd $foo'
The practical background of my question was also a reasonable value
for the emacs 'compile-command' variable, that will work for any
project, just based on the current working directory. So a project
specific alias won't do. (setq compile-command "lookandcook") will :)
On Wednesday 24 September 2003 08:21, Tom Satter wrote:
> Actually, the way that we did it was this:
> [low level cookbooks that set some TOPLEVEL and then source the
> toplevel cookbook which will then again source the subbooks]
This was my first idea, too. But then if I did this, I _had_ to
install a Howto.cook cookbook in each directory, which I want to avoid
to keep things simple for my less technical colleagues.
So I just will name the few special subdir recipies (mostly modifying
the local manifest and such) differently, Subdir.cook or the like, and
where present they will be included by the toplevel Howto.cook.
thanks
Susanne :)
--
Susanne Oberhauser simply SUSE LINUX AG
+49-911-74053-574 change: Deutschherrnstr. 15-19
<froh at suse.de> www.suse.de 90429 N?rnberg
More information about the Cook-users
mailing list