#!/bin/bash

#set -e
set -vx

BASE_PATH=`pwd`

git checkout devel
git submodule update --init --recursive --remote

if [ ! -f ./titan-test-system-framework ]
then
    git clone --recurse-submodules --single-branch --branch devel https://labs.etsi.org/rep/cti-tools/titan-test-system-framework.git
    cd ./titan-test-system-framework
else
    cd ./titan-test-system-framework
    git checkout devel
fi
cd ./ttcn/LibHttp
ln -sf module_emtel.mk module.mk

cd $BASE_PATH
ln -f ./ttcn/patch_lib_common_titan/module.mk ./ttcn/LibCommon/
ln -f ./ttcn/patch_lib_common_titan/ttcn/*.ttcn ./ttcn/LibCommon/ttcn/
ln -f ./ttcn/patch_ims_titan/*.ttcn ./ttcn/LibIms/ttcn/
ln -f ./ttcn/patch_ims_titan/module.mk ./ttcn/LibIms/
ln -f ./ttcn/patch_sip_titan/*.ttcn ./ttcn/LibSip/ttcn/
ln -f ./ttcn/patch_sip_titan/module.mk ./ttcn/LibSip/

exit 0
