#!/bin/sh set -e # Template for diversions ORIG_FILE="/usr/lib/libreoffice/presets/basic/script.xlc" OUR_FILE="/usr/lib/libreoffice/presets/basic/script-custom.xlc" ORIG_FILE2="/usr/lib/libreoffice/presets/basic/dialog.xlc" OUR_FILE2="/usr/lib/libreoffice/presets/basic/dialog-custom.xlc" OUR_PACKAGE="lliurex-dgti-conf-membrete" VERSION_WHICH_FIX_IT="0.35" case $1 in configure) echo " [ Membretes for LibreOffice ] : Testing if your libreoffice installation can be damaged" rc=0 dpkg --compare-versions $2 lt ${VERSION_WHICH_FIX_IT} || rc=1 if [ ${rc} -eq 0 ] ; then echo " [ Membretes for Libreoffice addons may be broken ] ... Fixing it!" for usuario in $(find /home/ -wholename "*.config/libreoffice" -xtype d -exec echo {} \; | cut -d "/" -f 1,2,3,4,5,6| sort -u); do echo " [ Membretes for Libreoffice addons may be broken ] Saving profile for ${usuario} " mv ${usuario} ${usuario}.bak || true done else echo " [ Your installation seems to be correct ]" fi if dpkg-divert --package ${OUR_PACKAGE} --add --rename --divert ${ORIG_FILE}.real ${ORIG_FILE} ; then ln -fs ${OUR_FILE} ${ORIG_FILE} else echo "Unabe to divert file ${ORIG_FILE}" fi if dpkg-divert --package ${OUR_PACKAGE} --add --rename --divert ${ORIG_FILE2}.real ${ORIG_FILE2} ; then ln -fs ${OUR_FILE2} ${ORIG_FILE2} else echo "Unabe to divert file ${ORIG_FILE2}" fi ;; *) echo "Nothing to do" ;; esac # Other Stuff # #DEBHELPER#