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>
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('"')
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