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"
|
2012-09-18 23:09:11 +02:00
|
|
|
|
|
|
|
if [ -f "$BLACKLIST" ]; then
|
|
|
|
VBOX_TEST=$(grep -c "Blacklist-virtualbox" $BLACKLIST)
|
|
|
|
else
|
|
|
|
VBOX_TEST="0"
|
|
|
|
fi
|
2011-10-31 03:41:52 +01:00
|
|
|
|
|
|
|
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
|
|
|
|