On Jun 15, 2005, at 8:54 AM, Rob Hassing wrote:
This means the rpm should replace some default config files.
The files ldap.conf, yp.conf and auto.master should be replaced by
this rpm.
On Jun 15, 2005, at 9:43 AM, Kolev, Nik wrote:
Something like (I am only trying to demonstrate):
%post
mv $(DEFAULT_FILE) $(SAVE_DEFAULT_FILE)
mv $(NEW_DEFAULT_FILE) $(DEFAULT_FILE)
I'm doing something similar for config files on the Pepper Pad from
www.pepper.com, a MontaVista Linux-based Wi-Fi pad. I create a
hierarchy under /opt/pup (Pepper Updater) called target and install
all of my config files there. I then cp -af instead of mv the custom
config files so they get preserved in case something happens (mv
obviously deletes them from their original install point).
Simple edits are better suited to using a combination of sed, awk,
grep, etc. to insert/modify one-line config options but, in my case
where the majority of the config files have almost been rewritten
from scratch, copying whole files around is much easier.
/Sean/
Hierarchy:
/opt/pup/target/etc/fstab
/opt/pup/target/etc/init.d/modutils
/opt/pup/target/etc/init.d/pcmcia
/opt/pup/target/etc/modules
/opt/pup/target/etc/modules.conf
/opt/pup/target/etc/network/ifstate
/opt/pup/target/etc/network/interfaces
/opt/pup/target/etc/profile
/opt/pup/target/etc/shells
/opt/pup/target/etc/syslog.conf
Spec file:
%files
%defattr(-,root,root)
/opt/pup/target
%post
MODIFIEDFILES=" \
etc/fstab \
etc/init.d/modutils \
etc/init.d/pcmcia \
etc/modules \
etc/modules.conf \
etc/network/ifstate \
etc/network/interfaces \
etc/profile \
etc/shells \
etc/syslog.conf \
"
for file in $MODIFIEDFILES; do
echo "*** Updating /$file..."
cp -af /$file /$file.pupsave
cp -af /opt/pup/target/$file /$file
done