mirror of
git://slackware.nl/current.git
synced 2024-12-27 09:59:16 +01:00
c238904d3e
a/dcron-4.5-x86_64-14.txz: Rebuilt. Add /etc/default/run-parts. Thanks to lostintime. kde/fcitx5-configtool-5.1.3-x86_64-1.txz: Upgraded. x/fcitx5-5.1.6-x86_64-1.txz: Upgraded. x/fcitx5-qt-5.1.4-x86_64-1.txz: Upgraded. x/pixman-0.43.0-x86_64-1.txz: Upgraded. x/xcb-imdkit-1.0.6-x86_64-1.txz: Upgraded.
31 lines
792 B
Bash
31 lines
792 B
Bash
config() {
|
|
for infile in $1; do
|
|
NEW="$infile"
|
|
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...
|
|
done
|
|
}
|
|
|
|
preserve_perms() {
|
|
NEW="$1"
|
|
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
|
if [ -e $OLD ]; then
|
|
cp -a $OLD ${NEW}.incoming
|
|
cat $NEW > ${NEW}.incoming
|
|
mv ${NEW}.incoming $NEW
|
|
fi
|
|
config $NEW
|
|
}
|
|
|
|
preserve_perms etc/rc.d/rc.crond.new
|
|
config etc/default/crond.new
|
|
config etc/default/run-parts.new
|
|
config var/spool/cron/crontabs/root.new
|
|
rm -f var/spool/cron/crontabs/root.new
|