Commit 6b368cb9 authored by Kevin Kane's avatar Kevin Kane Committed by Phil Coval

[IOT-1529] Sync TinyCBOR to release tag before using

Current build will sync to the head of TinyCBOR's master branch.
To remove this unpredictability from the build, always sync to
a particular release tag.

Change-Id: I471ac19aedc787bca64ee01c4733ab319d6f32d3
Signed-off-by: default avatarKevin Kane <kkane@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14165Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Reviewed-by: default avatarPhil Coval <philippe.coval@osg.samsung.com>
parent 0308207f
......@@ -19,12 +19,15 @@
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
import os
import subprocess
Import('env')
src_dir = env.get('SRC_DIR')
target_os = env.get('TARGET_OS')
cborDir = os.path.join(src_dir, 'extlibs','tinycbor','tinycbor')
cborRevision = 'v0.4'
if not os.path.exists(cborDir):
print '''
......@@ -35,6 +38,37 @@ if not os.path.exists(cborDir):
'''
Exit(1)
start_dir = os.getcwd()
os.chdir(cborDir)
# Tizen uses a separate process to sync to a particular revision of TinyCBOR.
# Make sure tinycbor_revision stays in sync with extlibs/tinycbor/prep.sh.
# This code also assumes tinycbor_revision is a tag; if it changes to a branch
# or an arbitrary commit, disable this check below.
if target_os != 'tizen' and os.path.exists('.git/HEAD'):
out = subprocess.check_output('git tag -l ' + cborRevision, shell = True)
if cborRevision not in out:
print out
print '''
*********************************** Error: ****************************************
* Your TinyCBOR repo is not up to date with the latest version we require. Please *
* update with the following commands: *
* $ cd extlibs/tinycbor/tinycbor *
* $ git fetch *
***********************************************************************************
'''
Exit(1)
# Point TinyCBOR repo to desired release tag
if os.path.exists('.git/HEAD'):
cmd = 'git reset --hard ' + cborRevision
os.system(cmd)
else:
print 'Assume TinyCBOR is on tag ', cborRevision
os.chdir(start_dir)
cbor_src = [
os.path.join(cborDir,'src/cborparser.c'),
os.path.join(cborDir,'src/cborparser_dup_string.c'),
......
#!/bin/sh
set -e
# Keep cborRevision in sync with extlibs/tinycbor/SConscript's setting. Right now this script
# assumes cborRevision is a tag; comment out the second clause if cborRevision becomes
# a branch or a specific commit.
cborDir="./extlibs/tinycbor/tinycbor"
cborRevision="v0.4"
if [ ! -d ${cborDir} ]; then
echo ""
echo "*********************************** Error: ****************************************"
echo "* Please download TinyCBOR using the following command: *"
echo "* $ git clone https://github.com/01org/tinycbor.git extlibs/tinycbor/tinycbor *"
echo "***********************************************************************************"
echo ""
exit
elif [ ! -z $(git tag -l $cborRevision) ]; then
echo ""
echo "*********************************** Error: *******************************************"
echo "* TinyCBOR repo is out of date. Please update TinyCBOR using the following commands: *"
echo "* $ cd (authoritative TinyCBOR source repo location) *"
echo "* $ git fetch *"
echo "**************************************************************************************"
echo ""
exit
elif [ -d ${cborDir}/.git ]; then
cd ${cborDir}
git reset --hard ${cborRevision}
cd -
rm -rf ${cborDir}/.git*
else
echo "Assuming TinyCBOR is already on correct revision ${cborRevision}"
fi
......@@ -90,7 +90,8 @@ if [ $secured -eq 1 ];then
$SHELL ./extlibs/mbedtls/prep.sh
fi
rm -rf ./extlibs/tinycbor/tinycbor/.git*
# Prepare TinyCBOR dependency
$SHELL ./extlibs/tinycbor/prep.sh
# Initialize Git repositoryㅣ
if [ ! -d .git ]; then
......
......@@ -51,7 +51,6 @@ mkdir ./tmp
mkdir ./tmp/extlibs/
mkdir ./tmp/packaging
cp -LR ./extlibs/tinycbor $sourcedir/tmp/extlibs
rm -rf $sourcedir/tmp/extlibs/tinycbor/tinycbor/.git
cp -Rf ./extlibs/mbedtls $sourcedir/tmp/extlibs
cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
cp -R ./extlibs/tinydtls $sourcedir/tmp/extlibs
......@@ -92,6 +91,9 @@ echo `pwd`
# Prepare mbedTLS dependency
$SHELL ./extlibs/mbedtls/prep.sh
# Prepare TinyCBOR dependency
$SHELL ./extlibs/tinycbor/prep.sh
whoami
# Initialize Git repository
if [ ! -d .git ]; then
......
......@@ -30,7 +30,6 @@ cp -R ./examples $sourcedir/tmp
# tinycbor is available as soft-link, so copying with 'dereference' option.
cp -LR ./extlibs/tinycbor $sourcedir/tmp/extlibs
rm -rf $sourcedir/tmp/extlibs/tinycbor/tinycbor/.git
cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
cp -R ./extlibs/mbedtls $sourcedir/tmp/extlibs
......@@ -62,7 +61,8 @@ echo `pwd`
# Prepare mbedTLS dependency
$SHELL ./extlibs/mbedtls/prep.sh
rm -rf ./extlibs/tinycbor/tinycbor/.git*
# Prepare TinyCBOR dependency
$SHELL ./extlibs/tinycbor/prep.sh
# Build IoTivity
# Initialize Git repository
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment