aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-10-11 01:02:51 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-10-11 01:03:57 +0200
commitde8154b545ecdd5a35a0956ac5d93e26bb8ebc19 (patch)
tree416722030d1659f4f1fdf4a68bd20c7f610ecdcd
parent8861c188ae6c91b0a76c98a365366c807d3bd38e (diff)
Fixed incorrect detection of installed SDKs
Add an additional verification about uuid that is based on url field to identify SDK. Change-Id: Iefe43ff37d928c7592c0c9c8c14b9f537080b0b6 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
-rwxr-xr-xscripts/sdks/agl/db-dump13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/sdks/agl/db-dump b/scripts/sdks/agl/db-dump
index e7538d7..2fcd4c4 100755
--- a/scripts/sdks/agl/db-dump
+++ b/scripts/sdks/agl/db-dump
@@ -19,6 +19,7 @@
# **************************************************************************/
import os
+import sys
import json
import logging
import inspect
@@ -129,6 +130,18 @@ for one_sdk in INSTALLED_SDK:
if sdk['profile'] == PROFILE and sdk['version'] == VERSION and sdk['arch'] == ARCH:
if sdk['status'] == 'Installed':
continue
+ # Additional verification based on url used to generate UUID (see also same logic in add script)
+ if sdk['url'] != '':
+ try:
+ ps = subprocess.Popen(('echo', sdk['url']), stdout=subprocess.PIPE)
+ uuid_md5 = subprocess.check_output(('md5sum'), stdin=ps.stdout)
+ ps.wait()
+ if str(uuid_md5).split(' ')[0][2:] != UUID:
+ continue
+ except:
+ e = sys.exc_info()[0]
+ logging.error("Error while checking UUID: " % e)
+
found = True
sdk['status'] = 'Installed'
sdk['date'] = SDK_DATE