update of configuration files and ALFS

Vassili Dzuba vassilidzuba at nerim.net
Mon Mar 3 13:22:12 PST 2003


Hello,


The LFS book often instructs to update configuration files,
using something like

cat >> /etc/the_config_file << EOF
...
EOF

In a ALFS profile, it becomes :

   <textdump mode="append" base="/etc">
      <file>the_config_file</file>
      <content>
          =....
      </content>
   </textdump>

However, in both cases, if we execute twice the instructions,
we will several times the specified text appended to the file.
It can be harmfull or not according to the cases, but it's
probably not a good way to work.

In (B)LFS, the updates to configuration files are often 
bracketted by comments :

cat >> /etc/ld.so.conf << "EOF"
# Begin qt addition to /etc/ld.so.conf

/opt/qt/lib

# End qt addition
EOF


I propose to expand <textdump> functions to insert automatically
the comments, and use them to avoid to insert the configuration text
several times.

e.g. :

<textdump mode="insert" package="qt" base="/etc">
   <file>ld.so.conf</file>
   <content>
       =/opt/qt/lib
   </content>
</textdump>

That would insert :

# Begin qt insert
/opt/qt/lib
# End qt insert

To take into account the files where '#' is not a comment marker,
one could use :

    <textdump mode="insert" package="qt" base="/etc" commentchar="//">

or, if we want to be able to specifify the full

    <textdump mode="insert" package="qt" base="/etc">
        <insertfrom># Begin of insertion qt</insertfrom>
        <insertto># End of insertion qt</insertto>
        <file>...</file>


Any comment ?

Vassili
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message



More information about the alfs-discuss mailing list