[RFC] ALFS implementations

Matthew Burgess matthew at linuxfromscratch.org
Tue Aug 9 10:51:16 PDT 2005


Jeremy Huntwork wrote:

> The difficulty becomes how to use those raw text files to intelligently
> and accurately script the build.

One idea that immediately springs to mind is that we have a tool that 
not only extracts/dumps the commands (i.e. XSL), but instead of/as well 
as dumping the commands it raises events which can do user defined 
actions.  For example, my personal Makefiles (which I've always promised 
myself I'd drop in favour of ALFS), always follow the same pattern:

pre-instruction setup/configuration stuff
[book instructions]
post-instruction setup/configuration stuff

This largely involves setting things up so that logging, timing and 
sizing can be carried out during the build.

So, what I was thinking of was something that extracts the commands, but 
raises events such as:

1) Start of new package/section
2) Book command
3) End of new package/section

I'd then write "handlers" for each of those events that would result in 
me having exactly the same Makefiles that I have now, but with the 
massive benefit of being automatically generated/maintained.  This 
processing is inspired by the SAX method of processing XML - googling on 
that should help clarfiy things if anyone's interested but confused by 
my musings.

Hmmm, just writing SAX there makes me wonder whether we couldn't just 
write a tool that trivially uses SAX to parse the book and raise its own 
events in response to particular PIs (<?...?> tags)...

Regards,

Matt.



More information about the lfs-dev mailing list