From: Grazvydas Ignotas Date: Wed, 17 Oct 2012 11:37:23 +0000 (+0300) Subject: op_osupgrade: use terminal for logs X-Git-Tag: sz_152~1 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=commitdiff_plain;h=a1a67e4bcf81ff4639db7a269bd9d0d7a66abc51;hp=d71cdea019d35d63686be7bd53ca2803c607d5ac op_osupgrade: use terminal for logs --- diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index 2abd3d9..04ddacd 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" DEPENDS = "zenity dbus" RDEPENDS = "zenity dbus" -PR = "r120" +PR = "r121" SRC_URI = " \ file://op_paths.sh \ diff --git a/recipes/pandora-system/pandora-scripts/op_osupgrade.sh b/recipes/pandora-system/pandora-scripts/op_osupgrade.sh index af57350..04199e7 100644 --- a/recipes/pandora-system/pandora-scripts/op_osupgrade.sh +++ b/recipes/pandora-system/pandora-scripts/op_osupgrade.sh @@ -1,5 +1,18 @@ -#!/bin/bash +#!/bin/sh zenity --question --title="Update Firmware OS" --text="This little tool helps you to keep your firmware OS up-to-date with the latest tweaks.\n\nPlease note that this is in TESTING state and\nmight break parts of your system with unstable packages!\n\nMake sure your Pandora is connected to the internet and click the Upgrade-Button.\n\n" --ok-label="Upgrade OS" --cancel-label="Quit" -opkg update 2>&1 | tee /tmp/upgrade.log | zenity --progress --auto-close --pulsate --title "Updating feedlist..." -opkg upgrade 2>&1 | tee -a /tmp/upgrade.log | zenity --text-info --title "Updating packages..." --width=600 -zenity --info --title="Upgrade complete" --text "All operations have been finished.\n\nYou can find a logfile in /tmp/upgrade.log" \ No newline at end of file + +terminal -x bash -c \ + 'echo "Updating package lists..." && \ + opkg update 2>&1 | tee /tmp/upgrade.log && test ${PIPESTATUS[0]} -eq 0 && \ + echo "Checking for updated packages..." && \ + opkg upgrade 2>&1 | tee -a /tmp/upgrade.log && test ${PIPESTATUS[0]} -eq 0 && \ + touch /tmp/upgrade_ok || sleep 3' + +if test -e /tmp/upgrade_ok; then + zenity --info --title="Upgrade complete" \ + --text "All operations have been finished.\n\nYou can find a logfile at /tmp/upgrade.log" +else + zenity --error --title="Errors detected" \ + --text "Errors detected during update.\n\nYou can find a logfile at /tmp/upgrade.log" +fi +rm -f /tmp/upgrade_ok