Static Bash Instructions
rbpark at ualberta.ca
Wed Sep 11 21:40:47 PDT 2002
Alas! Gerard Beekmans spake thus:
> On September 3, 2002 02:18 pm, Rob Park wrote:
> > That is why I suggested to make it a separate version of the book, so
> > that weirdos like you can keep your package contents ;)
> That's an idea I've been toying with for a long time: Dynamic LFS Books (the
> DLFSB project if you will). The book is written in XML, allows for awesome
> tricks. You could "tag" (not the official XML term but this way it's easier
> to understand) all the contents, command explanations, dependencies,
> installation instructions, and so on. Then you can simply enable or disable
> all such tags. Say you disable all contents "tags", then no section in the
> book will contain the package's contents (except for the listing in appendix
> a, unless you go as far as tagging actual chapters and then you can generate
> a book with only a select number of chapters and sections).
> All it requires is update a few entities and the index.xml file, then
> re-generate the book on your system (only takes a minute) and voila your own
> personalized LFS book. Is it easy to do? Fairly easy. Why hasn't it been done
> yet? It's gonna take some time to do it, quite the job to redo a lot of the
> XML structure. Needs lots of time. It'll happen, some day.
Interesting. I don't know anything about XML, but here's how I'd do it
if it were up to me (this may or may not be better; at any rate it's
food for thought):
Use m4 preprocessing. On the commandline you could specify options, like
what you wanted to be removed from the book.
In the book, you'd have something like this:
Install instructions for bash
ifelse(`OMIT_CONTENTS', `yes', `', `Contents of package bash ...')
And then to generate the book without the package contents, you'd do
m4 -DOMIT_CONTENTS=yes book.m4 > book.xml
<and then whatever command to convert xml into the preferred format>
Or to generate the book with package contents, you'd do this:
m4 book.m4 > book.xml
And there'd be other things for leaving out other stuff.
This has the advantage of working no matter what format the book is
written in (though that doesn't seem to be a terribly important
advantage, now that I think of it...). It might make book maintenance a
little more difficult with m4 mixed with xml, though.
It also gives you the flexibility of being able to do pretty much
anything, though. Instead of being limited to just leaving out things,
you could use to the change the order of things, or replace some things
with other things. For example:
m4 -DEDITOR=vim book.m4 > book.xml
m4 -DEDITOR=pico book.m4 > book.xml
m4 -DEDITOR=nano book.m4 > book.xml
Would be how you could get the book to use your favorite editor.
I guess it just adds a layer of abstraction to the book maintenance.
That makes everything more flexible ;)
Just my $.02
Rob 'Feztaa' Park
The nice thing about standards is that there are so many of them to choose from.
-- Andrew S. Tanenbaum
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message
More information about the lfs-dev