Remove bash scripting work around for update all 40/5740/2
authorWilliam Douglas <william.douglas@intel.com>
Mon, 8 Jul 2013 21:02:47 +0000 (14:02 -0700)
committerWilliam Douglas <william.douglas@intel.com>
Wed, 17 Jul 2013 16:33:36 +0000 (09:33 -0700)
Instead of using bash to install all the updates on the system, use
the new swup -a that just had support added for it.

Change-Id: I335ad0deb9f16a7f2b51a93c4d153c7c21a53f58
Signed-off-by: William Douglas <william.douglas@intel.com>
swup.py
system-update.sh

diff --git a/swup.py b/swup.py
index 307d36c..3f3cf7d 100755 (executable)
--- a/swup.py
+++ b/swup.py
@@ -248,6 +248,9 @@ def install_update(update_data):
     if not os.path.exists("%s/installed" % (update_cache)):
         os.mkdir("%s/installed" % (update_cache))
     shutil.copyfile("%s/download/%s/content/%s" %(update_cache, update_id, update_id), "%s/installed/%s" % (update_cache, update_id))
+    for id in os.listdir("%s/install" % update_cache):
+        if re.search(update_id, id):
+            os.remove("%s/install/%s" % (update_cache, id))
 
     os_release = get_current_version()
     current_version = os_release['version_id'].strip('"')
index ec40cad..c0ddeae 100755 (executable)
@@ -8,19 +8,11 @@ function system_update
 
        plymouth update --status="Installing Updates..."
 
-       for i in `ls /var/cache/updatemanager/install`; do
-               UPDATE=$(echo $i | sed -e 's/^[0-9]*-//')
-               mkdir -p /var/cache/zypp/packages/$UPDATE/rpms
-               /usr/bin/swup -i  $UPDATE
-               if [ "$?" != 0 ]; then
-                   echo "Update failed"
-                   exit -1
-               fi
-               rm /var/cache/updatemanager/install/$i
-       done
-
-       # check update status
-       # update failed revert to snapshot
+       /usr/bin/swup -a
+       if [ "$?" != 0 ]; then
+           echo "Update failed"
+           exit -1
+       fi
 }
 
 function system_restore