[Fwd: [RFC] - textdump element]

James Robertson jwrober at linuxfromscratch.org
Tue Jun 1 12:03:55 PDT 2004


Kevin P. Fleming wrote:

> James Robertson wrote:
> 
>> I can't remember if I brought it up before or not (and don't feel like
>> digging in the archives).  For an update to the ALFS DTD, what do you
>> think of adding support for appending data in the middle of a file or at
>> some point.  This is good for keeping configuration files in /etc
>> updated via script, but also allow you to keep the #Begin and #End
>> lines.  I for one, like those.
> 
> 
> I'm not opposed to the idea, but I can't imagine a syntax that would 
> work. I've already suggested enhancing search_replace to handle regex 
> substitution (probably using PCRE), so that may be able to do what you 
> want.
> 
> If you can come up with a syntax that's fairly easy to understand and 
> document, I'll certainly think about implementing it.

How about adding a mode attribute to search_replace like what 
environment has - that allows two options replace or prepend?  Replace 
would act like a simple sed command.  Prepend would do what I want it to 
do.  The new DTD would look like this:

!ELEMENT search_replace (file, find, replace)
!ATTLIST search_replace
           base           CDATA #IMPLIED
           mode           (replace | prepend) "replace"

Thoughts?

James
-- 
James Robertson -- jwrober at linuxfromscratch dot org
Reg. Linux User -- #160424 -- http://counter.li.org
Reg. LFS User   -- #6981   -- http://www.linuxfromscratch.org
LFS Bugzilla Maintainer    -- http://{blfs-}bugs.linuxfromscratch.org



More information about the alfs-discuss mailing list