Fixed version update
authorAnas Nashif <anas.nashif@intel.com>
Wed, 10 Apr 2013 18:23:57 +0000 (14:23 -0400)
committerAnas Nashif <anas.nashif@intel.com>
Wed, 10 Apr 2013 18:23:57 +0000 (14:23 -0400)
swup.py
system-update.sh

diff --git a/swup.py b/swup.py
index 2474007..d36fae5 100755 (executable)
--- a/swup.py
+++ b/swup.py
@@ -14,6 +14,7 @@ import zipfile
 import rpm
 import subprocess as sub
 import distutils
+import fileinput
 
 update_repo="http://www.planux.com/updates"
 update_cache="/var/cache/updatemanager"
@@ -97,6 +98,7 @@ def parse_updates():
         attr = update.attrib
         up['id'] = attr['id']
         up['checksum'] = update.xpath("checksum")[0].text
+        up['version'] = update.xpath("version")[0].text
         up['title'] = update.xpath("title")[0].text 
         loc = update.xpath("location")[0]
         up['location'] = "%s" % ( loc.attrib['href'])
@@ -235,7 +237,7 @@ def install_update(update_data):
         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))
 
-    print "Finished installing %s." % update_id 
+    print "Finished installing %s. (from %s to %s)" % (update_id, current_version, u['version'])
     for line in fileinput.input("/etc/os-release", inplace=1):
         print line.replace(current_version, u["version"]),
     for line in fileinput.input("/etc/tizen-release", inplace=1):
index 7c6bff6..b3bc46c 100755 (executable)
@@ -7,10 +7,12 @@ rm /system-update
 
 # call updater
 
+plymouth update --status="Updating..."
+
 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 | tee /var/log/system-update.log
+       /usr/bin/swup -i  $UPDATE 2>&1 | tee /var/log/system-update.log
        rm /var/cache/updatemanager/install/$i
 done