From 936dd2dcc314cc5b16387a397d035e7e3753e58b Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 9 Jul 2017 07:50:58 -0600 Subject: [PATCH] build: define mbedtls_version before use A recent change tried to centralize the mbedtls version into one setting, but the setting is currently done after it is used in an error message. Move the assignment up above first use. Change-Id: I3887c3f036fb0d22c4f4f60436ff75306fd7eb73 Signed-off-by: Mats Wichmann Reviewed-on: https://gerrit.iotivity.org/gerrit/21331 Tested-by: jenkins-iotivity Reviewed-by: Phil Coval --- extlibs/mbedtls/SConscript | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extlibs/mbedtls/SConscript b/extlibs/mbedtls/SConscript index cc50d91..9517042 100644 --- a/extlibs/mbedtls/SConscript +++ b/extlibs/mbedtls/SConscript @@ -32,6 +32,9 @@ mbedtls_dir = os.path.join(root_dir, 'extlibs', 'mbedtls', 'mbedtls') start_dir = os.getcwd() mbedtls_config_file = 'config-iotivity.h' if target_os != 'windows' else 'config-iotivity_windows.h' +# The mbedtls_revision tag here must match the one in extlibs/mbedtls/prep.sh. +mbedtls_revision = 'mbedtls-2.4.2' + if not os.path.exists(mbedtls_dir): msg = ''' *********************************** Error: ************************************ @@ -50,8 +53,6 @@ os.chdir(mbedtls_dir) # the script will always conclude the repo is not up to date because a tag # with that name doesn't exist. # Tizen uses its own process to prepare the mbedTLS repo in gbsbuild.sh. -# The mbedtls_revision tag here must match the one in extlibs/mbedtls/prep.sh. -mbedtls_revision = 'mbedtls-2.4.2' if os.path.exists('.git/HEAD'): out = subprocess.check_output('git tag -l ' + mbedtls_revision, shell=True) if mbedtls_revision not in out: @@ -92,6 +93,7 @@ if found: if not found: if os.path.exists('.git/HEAD'): # Apply ocf patch on git revision + print "Syncing/patching mbedtls external project..." cmd = 'git checkout -f development && git reset --hard ' + mbedtls_revision + ' && git clean -f && git apply --whitespace=fix ../ocf.patch' res = os.system(cmd) else: @@ -114,8 +116,8 @@ mbedtls_config = os.path.join(root_dir, 'extlibs', 'mbedtls', 'mbedtls', try: copyfile(iotivity_config, mbedtls_config) except: - print 'mbedtls SConscript: cannot copy ' + iotivity_config + ' to ' + mbedtls_config - msg = 'error: ' + str(sys.exc_info()[0]) + msg = 'mbedtls SConscript: cannot copy ' + iotivity_config + ' to ' + mbedtls_config + msg += 'error: ' + str(sys.exc_info()[0]) Exit(msg) else: print 'Copied IoTivity version of config.h to ' + mbedtls_config -- 2.7.4