2010-05-11 22:55:36 +02:00
|
|
|
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...
|
|
|
|
}
|
|
|
|
|
2010-07-20 16:25:26 +02:00
|
|
|
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
|
2010-05-11 22:55:36 +02:00
|
|
|
fi
|
2010-07-20 16:25:26 +02:00
|
|
|
config $NEW
|
|
|
|
}
|
|
|
|
|
2011-06-20 05:39:50 +02:00
|
|
|
# Fix starting of kde within virtualbox
|
2011-10-31 03:41:52 +01:00
|
|
|
BLACKLIST="usr/share/apps/kconf_update/kwin_blacklist.upd"
|
|
|
|
VBOX_TEST=$(grep -c "Blacklist-virtualbox" $BLACKLIST)
|
|
|
|
|
|
|
|
if [ "$VBOX_TEST" = "0" ]; then
|
|
|
|
cat << EOF >> $BLACKLIST
|
2011-06-20 05:39:50 +02:00
|
|
|
Id=Blacklist-virtualbox
|
|
|
|
Options=overwrite
|
|
|
|
File=kwinrc
|
|
|
|
Script=kwin_blacklist_vbox.sh,sh
|
|
|
|
EOF
|
2011-10-31 03:41:52 +01:00
|
|
|
fi
|
2011-06-20 05:39:50 +02:00
|
|
|
|
2010-07-20 16:25:26 +02:00
|
|
|
preserve_perms etc/rc.d/rc.vboxadd.new
|
|
|
|
preserve_perms etc/rc.d/rc.vboxadd-service.new
|
2010-05-11 22:55:36 +02:00
|
|
|
|
2010-05-13 00:42:19 +02:00
|
|
|
# remove existing fdi cache to recognize newly installed fdi files
|
|
|
|
# and restart hal to regenerate the cache
|
|
|
|
rm -f var/cache/hald/fdi-cache
|
|
|
|
chroot . /etc/rc.d/rc.hald restart
|
|
|
|
|