From 96fbcd170ef97ad4896f540c41dbc95637506f6b Mon Sep 17 00:00:00 2001 From: William Douglas Date: Mon, 8 Jul 2013 14:02:47 -0700 Subject: [PATCH] Remove bash scripting work around for update all 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 --- swup.py | 3 +++ system-update.sh | 18 +++++------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/swup.py b/swup.py index 307d36c..3f3cf7d 100755 --- 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('"') diff --git a/system-update.sh b/system-update.sh index ec40cad..c0ddeae 100755 --- a/system-update.sh +++ b/system-update.sh @@ -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 -- 2.7.4