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/bash_completion.d/ooffice.sh.new # Install dictionary extensions for spellchecking if [ -x "usr/lib64/libreoffice/program/unopkg" ]; then UNOPKGTMP=$(mktemp -d unopkg.XXXXXX) || UNOPKGTMP=/tmp/unopkg.$$ if [ -f "usr/lib64/libreoffice/share/extension/install/dict-en-US.oxt" ]; then chroot . /usr/lib64/libreoffice/program/unopkg add --shared \ usr/lib64/libreoffice/share/extension/install/dict-en-US.oxt \ "-env:UserInstallation=file:///$UNOPKGTMP" 1>/dev/null 2>/dev/null fi rm -rf $UNOPKGTMP fi # Update the desktop database: if [ -x usr/bin/update-desktop-database ]; then chroot . /usr/bin/update-desktop-database usr/share/applications > /dev/null 2>&1 fi # Update the mime database: if [ -x usr/bin/update-mime-database ]; then chroot . /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 fi # Update hicolor theme cache: if [ -d usr/share/icons/hicolor ]; then if [ -x /usr/bin/gtk-update-icon-cache ]; then chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null fi fi