op_osupgrade: rework update script
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 16 Mar 2013 17:22:13 +0000 (19:22 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 17 Mar 2013 18:30:42 +0000 (20:30 +0200)
recipes/pandora-system/pandora-scripts.bb
recipes/pandora-system/pandora-scripts/op_osupgrade.sh

index da824ae..acb3a0f 100644 (file)
@@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 DEPENDS = "zenity dbus"
 RDEPENDS = "zenity dbus"
 
 DEPENDS = "zenity dbus"
 RDEPENDS = "zenity dbus"
 
-PR = "r136"
+PR = "r137"
 
 SRC_URI = " \
           file://op_paths.sh \
 
 SRC_URI = " \
           file://op_paths.sh \
index 14cc71f..197433e 100644 (file)
@@ -22,14 +22,20 @@ Aborting."
   exit 1
 fi
 
   exit 1
 fi
 
+rm -f /tmp/upgrade_ok
 kernelmd5_old=`md5sum $kernel_path`
 
 kernelmd5_old=`md5sum $kernel_path`
 
+# reminder: don't use '&&' '||' ... after tee, it breaks set -e, no idea why
 terminal -x bash -c \
 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'
+  '( set -e; \
+     cd /tmp/; \
+     echo "Updating package lists..."; \
+     opkg update 2>&1; \
+     echo "Checking for updated packages..."; \
+     opkg upgrade 2>&1; \
+     touch /tmp/upgrade_ok; \
+     sync ) | tee /tmp/upgrade.log; \
+   test -e /tmp/upgrade_ok || sleep 3'
 
 sync
 
 
 sync