# HG changeset patch # User Andre Heinecke # Date 1409838931 -7200 # Node ID 43734932e2ea648ea136582d9259245bc2467127 # Parent 069f5e5344f63f7765d2e0e391a5b898c91ff8b2 (issue100) Fall back to system wide deinstallation when no local installation is found diff -r 069f5e5344f6 -r 43734932e2ea packaging/linux-installer.inc.in --- a/packaging/linux-installer.inc.in Thu Sep 04 15:27:02 2014 +0200 +++ b/packaging/linux-installer.inc.in Thu Sep 04 15:55:31 2014 +0200 @@ -175,6 +175,16 @@ instdata_path="${DATAPATH}" autostart_path=${XDG_CONFIG_HOME:-~/.config/autostart} startmenu_path=${XDG_DATA_HOME:-~/.local/share/applications} + if [ $DEINSTALL -eq 1 ] ; then + if [ ! -r ${instcfg_path}/${INSTCFGNAME} ]; then + if [ -r ${SYSCFGPATH}/${INSTCFGNAME} ]; then + # Fall back to system uninstallation if no user config found + SYSINST=1 + init_vars + check_priv + fi + fi + fi fi instcfg_file="${instcfg_path}/${INSTCFGNAME}" extra_bin_path=`mktemp --tmpdir -d tmpbin.XXXXXXXXXX` @@ -217,7 +227,7 @@ check_priv() { if [ $SYSINST -eq 1 -a "$UID" -ne 0 ] ; then - fatal "System wide installation requires root privileges!\n" + fatal "System wide installation or deinstallation requires root privileges!\n" fi } @@ -495,8 +505,8 @@ trap cleanup EXIT parse_args "$@" +check_priv init_vars -check_priv read_oldinstcfg cat <