From 0350ec1e1055812793431ba814f0797321a06d17 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 23 Jan 2011 00:40:33 +0100 Subject: [PATCH] autoupdate: use our new options dialog Signed-off-by: Stephan Raue --- packages/tools/autoupdate/config/update.conf | 48 ------------------- packages/tools/autoupdate/install | 3 -- .../tools/autoupdate/scripts/autoupdate.devel | 24 ++++++++-- .../autoupdate/scripts/autoupdate.release | 24 ++++++++-- 4 files changed, 38 insertions(+), 61 deletions(-) delete mode 100644 packages/tools/autoupdate/config/update.conf diff --git a/packages/tools/autoupdate/config/update.conf b/packages/tools/autoupdate/config/update.conf deleted file mode 100644 index acd0ad3281..0000000000 --- a/packages/tools/autoupdate/config/update.conf +++ /dev/null @@ -1,48 +0,0 @@ -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) -# -# 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, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ -# update.conf - -# This configuration file allows you to setup the update feature of -# openelec - -# The update features retain all custom settings and files from both -# the openelec base system and xbmc - -# Options are "no" / "manually" / "auto" ) - -# no: -Disable updates -# -No pop-up information about available updates -# -No automatic downloadling - -# manually: Manual updates -# -Shows pop-up information about available updates -# -No automatic downloading -# -To update: Download the required openelec version, extract -# and copy the two files "SYSTEM" and "KERNEL" to the "Update" -# share (or /storage/.update) -# Reboot the system and the update will install automatically - -# auto: Automatic updates -# -Shows pop-up information about available updates -# -New updates will be automatically downloaded -# -The system will notify you that a reboot is all that's -# required to complete the upgrade - -AUTOUPDATE=manually diff --git a/packages/tools/autoupdate/install b/packages/tools/autoupdate/install index 1332404bf6..b9541bb7a8 100755 --- a/packages/tools/autoupdate/install +++ b/packages/tools/autoupdate/install @@ -46,9 +46,6 @@ mkdir -p $INSTALL/etc if [ -f $PROJECT_DIR/$PROJECT/autoupdate/update.conf ]; then cp $PROJECT_DIR/$PROJECT/autoupdate/update.conf $INSTALL/etc - else - mkdir -p $INSTALL/usr/config - cp $PKG_DIR/config/update.conf $INSTALL/usr/config fi mkdir -p $INSTALL/etc/crontabs diff --git a/packages/tools/autoupdate/scripts/autoupdate.devel b/packages/tools/autoupdate/scripts/autoupdate.devel index 2847d1b9f9..6ab3334668 100755 --- a/packages/tools/autoupdate/scripts/autoupdate.devel +++ b/packages/tools/autoupdate/scripts/autoupdate.devel @@ -20,10 +20,24 @@ # http://www.gnu.org/copyleft/gpl.html ################################################################################ -[ -f /etc/update.conf ] && . /etc/update.conf -[ -f /storage/.config/update.conf ] && . /storage/.config/update.conf -[ -f /etc/repo.conf ] && . /etc/repo.conf || exit 0 -[ -n "$KEYFILE" ] && SCP_ARG="-i $KEYFILE" +OPENELEC_SETTINGS="$HOME/.xbmc/userdata/addon_data/os.openelec.settings/settings.xml" + +if [ -f /etc/update.conf ]; then + . /etc/update.conf +elif [ -f "$OPENELEC_SETTINGS" ]; then + AUTOUPDATE=`grep UPDATE_AUTO $OPENELEC_SETTINGS | awk '{print $3 }' | sed -e "s,value=,," -e "s,\",,g"` +else + exit 0 +fi + +if [ -f /etc/repo.conf ]; then + . /etc/repo.conf + if [ -n "$KEYFILE" ]; then + SCP_ARG="-i $KEYFILE" + fi +else + exit 0 +fi download () { case "$DL_METHOD" in @@ -74,7 +88,7 @@ if [ ! -f /var/lock/update.lock ]; then elif [ "$AUTOUPDATE" = "auto" ]; then # show a message if a new version is avaible - send_message "New update avaible: r$NEW_VERSION - downloading and extract the new version..." + send_message "New update avaible: r$NEW_VERSION - downloading and extracting the new version..." # locking autoupdate touch /var/lock/update.lock diff --git a/packages/tools/autoupdate/scripts/autoupdate.release b/packages/tools/autoupdate/scripts/autoupdate.release index 192b7fd67a..4243c70016 100755 --- a/packages/tools/autoupdate/scripts/autoupdate.release +++ b/packages/tools/autoupdate/scripts/autoupdate.release @@ -20,10 +20,24 @@ # http://www.gnu.org/copyleft/gpl.html ################################################################################ -[ -f /etc/update.conf ] && . /etc/update.conf -[ -f /storage/.config/update.conf ] && . /storage/.config/update.conf -[ -f /etc/repo.conf ] && . /etc/repo.conf || exit 0 -[ -n "$KEYFILE" ] && SCP_ARG="-i $KEYFILE" +OPENELEC_SETTINGS="$HOME/.xbmc/userdata/addon_data/os.openelec.settings/settings.xml" + +if [ -f /etc/update.conf ]; then + . /etc/update.conf +elif [ -f "$OPENELEC_SETTINGS" ]; then + AUTOUPDATE=`grep UPDATE_AUTO $OPENELEC_SETTINGS | awk '{print $3 }' | sed -e "s,value=,," -e "s,\",,g"` +else + exit 0 +fi + +if [ -f /etc/repo.conf ]; then + . /etc/repo.conf + if [ -n "$KEYFILE" ]; then + SCP_ARG="-i $KEYFILE" + fi +else + exit 0 +fi download () { case "$DL_METHOD" in @@ -81,7 +95,7 @@ if [ ! -f /var/lock/update.lock ]; then elif [ "$AUTOUPDATE" = "auto" ]; then # show a message if a new version is avaible - send_message "New update avaible: $NEW_VERSION - downloading and extract the new version..." + send_message "New update avaible: $NEW_VERSION - downloading and extracting the new version..." # locking autoupdate touch /var/lock/update.lock