From: William Douglas Date: Fri, 28 Jun 2013 23:29:41 +0000 (-0700) Subject: Update BUILD_ID in addition to VERSION_ID X-Git-Tag: accepted/tizen/20130629.031429~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=79d689cadce1a876b73d5134287a128ecde117c6;p=platform%2Fupstream%2Fswup.git Update BUILD_ID in addition to VERSION_ID Signed-off-by: William Douglas --- diff --git a/swup.py b/swup.py index 8fc01e6..43d4c54 100755 --- a/swup.py +++ b/swup.py @@ -35,7 +35,6 @@ def get_current_version(): config.readfp(FakeSecHead(open('/etc/os-release'))) return dict(config.items('os-release')) - def checksum(fileName, checksum_type="sha256", excludeLine="", includeLine=""): """Compute sha256 hash of the specified file""" m = hashlib.sha256() @@ -99,6 +98,7 @@ def parse_updates(): up['id'] = attr['id'] up['checksum'] = update.xpath("checksum")[0].text up['version'] = update.xpath("version")[0].text + up['build-id'] = update.xpath("build-id")[0].text up['title'] = update.xpath("title")[0].text loc = update.xpath("location")[0] up['location'] = "%s" % ( loc.attrib['href']) @@ -240,9 +240,10 @@ def install_update(update_data): os_release = get_current_version() current_version = os_release['version_id'].strip('"') + current_build = os_release['build_id'].strip('"') 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']), + print line.replace(current_version, u['version']).replace(current_build, u['build-id']), for line in fileinput.input("/etc/tizen-release", inplace=1): print line.replace(current_version, u['version']),