2008-09-12 06:30:58 -07:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright (C) 2008 Richard Hughes <richard@hughsie.com>
|
|
|
|
#
|
|
|
|
# This file is designed to be run by a not privileged user, NOT ROOT.
|
|
|
|
# The tool which is invoked will have to use consolehelper or PolicyKit
|
|
|
|
# if privileged changes are required.
|
|
|
|
#
|
|
|
|
# Licensed under the GNU General Public License Version 2
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
2008-09-15 02:23:29 -07:00
|
|
|
DISTRO=""
|
|
|
|
if [ -e /usr/bin/lsb_release ]; then
|
|
|
|
DISTRO=$(/usr/bin/lsb_release -is)
|
|
|
|
fi
|
|
|
|
|
2008-09-12 06:30:58 -07:00
|
|
|
# Fedora uses preupgrade
|
|
|
|
if [ -e /etc/fedora-release ]; then
|
|
|
|
if [ -e /usr/bin/preupgrade ]; then
|
|
|
|
/usr/bin/preupgrade
|
|
|
|
else
|
|
|
|
xdg-open http://fedoraproject.org/en/get-fedora
|
|
|
|
fi
|
2008-09-15 02:23:29 -07:00
|
|
|
elif [ "$DISTRO" = "Ubuntu" ]; then
|
2010-03-18 14:07:18 -07:00
|
|
|
if [ -e /usr/share/pyshared/UpdateManager/DistUpgradeFetcherKDE.py ] && [ "$DESKTOP" = "kde" ]; then
|
|
|
|
PATH=`kde4-config --path exe` kdesu -- "python /usr/share/pyshared/UpdateManager/DistUpgradeFetcherKDE.py"
|
|
|
|
elif [ -e /usr/bin/do-release-upgrade ]; then
|
|
|
|
gksu "/usr/bin/do-release-upgrade -m desktop"
|
2010-01-26 11:37:46 -08:00
|
|
|
elif [ "$DESKTOP" = "kde" ]; then
|
|
|
|
xdg-open http://www.kubuntu.org/getkubuntu
|
2008-09-15 02:23:29 -07:00
|
|
|
else
|
|
|
|
xdg-open http://www.ubuntu.com/getubuntu
|
|
|
|
fi
|
2009-01-07 07:30:18 -08:00
|
|
|
elif [ -e /etc/SuSE-release ] && [ -x /usr/sbin/wagon ]; then
|
|
|
|
xdg-su -c /usr/sbin/wagon
|
2008-09-12 06:30:58 -07:00
|
|
|
else
|
2009-01-07 07:30:18 -08:00
|
|
|
TITLE="System is not recognised"
|
|
|
|
TEXT="Your distribution was not recognised by the upgrade script.\nPlease file a but in your distribution bug tracker under the component PackageKit."
|
2010-01-26 11:37:46 -08:00
|
|
|
if [ "$DESKTOP" = "kde" ]; then
|
|
|
|
PATH=`kde4-config --path exe` kdialog --title "$TITLE" --sorry "$TEXT"
|
2008-09-12 06:30:58 -07:00
|
|
|
# do not dep on zenity in build scripts
|
2010-01-26 11:37:46 -08:00
|
|
|
elif [ "`which zenity 2> /dev/null > /dev/null; echo $?`" -eq 0 ]; then
|
|
|
|
zenity --warning --title $TITLE --text $TEXT
|
2009-01-07 07:30:18 -08:00
|
|
|
else
|
2010-01-26 11:37:46 -08:00
|
|
|
xmessage $TEXT
|
2009-01-07 07:30:18 -08:00
|
|
|
fi
|
2008-09-12 06:30:58 -07:00
|
|
|
fi
|
|
|
|
|