Hi,
I just built snapper package which have a configuration file in
/etc/conf.d/snapper.
According slackware documentation i added the following content in my
doinst.sh:
Code:
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
config etc/conf.d/snapper.new
when I run "slackpkg install snapper", I see this output:
Code:
[1/1] Package: snapper-0.10.3-x86_64-1_Sdom.tgz
Linking /home/domenico/Slackdom/x86_64/snapper/snapper-0.10.3-x86_64-1_Sdom.tgz
Linking /home/domenico/Slackdom/x86_64/snapper/snapper-0.10.3-x86_64-1_Sdom.tgz.asc
[1/1] Package snapper-0.10.3-x86_64-1_Sdom.tgz is already in cache - not downloading
Installing [Slackdom]:snapper-0.10.3-x86_64-1_Sdom...
snapper-0.10.3-x86_64-1_Sdom: Snapper is a tool for Linux file system snapshot management ......................................................................... [ 3.8M]
cat: etc/conf.d/snapper.new: No such file or directory
Searching for NEW configuration files...
Some packages had new configuration files installed (1 new files):
/etc/slackpkg/slackpkgplus.conf.new
What do you want (K/O/R/P)?
(K)eep the old files and consider .new files later
(O)verwrite all old files with the new ones. The
old files will be stored with the suffix .orig
(R)emove all .new files
(P)rompt K, O, R selection for every single file
K
As you can see, snapper.new cannot be found and it is right, but
must it work in this way ? or am i wronging anything?
Another point which is not clear for me, after the installation,
if I edit "
/etc/conf.d/snapper" changing its content then
its md5sum will change, thus, if I run "slackpkg reinstall snapper"
i expect to find
/etc/conf.d/snapper and
/etc/conf.d/snapper.new
but I only find /etc/conf.d/snapper with its original content losing the
previous changes.
What am i wronging?
Regards