Commit d952db40 authored by garciay's avatar garciay
Browse files

Bug fixed in script

parent 1afc75d2
#!/bin/bash
# Debug mode
#set -evx
set -vx
#set -e
# Usage: sudo ./merge_ite_project.bash
# TODO Use git clone in temporary directory
......@@ -9,38 +10,26 @@
OLDPWD=`pwd`
# Storing path
VAGRANT_DIR=/vagrant
if [ ! -d ${VAGRANT_DIR} ]
DEST_DIR=~/tmp
if [ ! -d ${DEST_DIR} ]
then
exit -1
else
VAGRANT_DIR=/vagrant/to_be_merged
if [ -d ${VAGRANT_DIR} ]
DEST_DIR=$DEST_DIR/to_be_merged
if [ -d ${DEST_DIR} ]
then
rm -f ${VAGRANT_DIR}/*
rm -f ${DEST_DIR}/*
else
mkdir ${VAGRANT_DIR}
mkdir ${DEST_DIR}
fi
fi
# Execution path
RUN_PATH="${0%/*}"
UNAME=`uname -n`
if [ "${UNAME}" == "Ubuntu64" ]
then
SRC_ITS_PATH=/media/sf_F_DRIVE/FSCOM/ETSI/ITS/STF525_Auto_Interop/workspace_titan/STF525_Auto_Interop/src
elif [ "${UNAME}" == "ubuntu-xenial" ] || [ "${UNAME}" == "vagrant" ]
then
SRC_ITS_PATH=/media/sf_F_DRIVE/FSCOM/ETSI/ITS/STF525_Auto_Interop/workspace_titan/STF525_Auto_Interop/src
elif [ "${UNAME}" == "vagrant-prov" ]
then
SRC_ITS_PATH=~/tmp/STF525
else # Cygwin
SRC_ITS_PATH=/cygdrive/f/FSCOM/ETSI/ITS/STF525_Auto_Interop/workspace_titan/STF525_Auto_Interop/src
fi
SRC_ITS_PATH=~/dev/STF525_Its
if [ "${PATH_DEV_ITS}" == "" ]
then
PATH_DEV_ITS=`pwd`/../etsi_its
PATH_DEV_ITS=~/dev/etsi_its
fi
# Update ETSI Framework files
......@@ -57,7 +46,7 @@ do
s2=`sha256sum -b ${FWK_DST_PATH}/include/${BN} | cut -d' ' -f1`
if [ ${s1} != ${s2} ]
then
cp ${FWK_DST_PATH}/include/${BN} ${VAGRANT_DIR}
cp ${FWK_DST_PATH}/include/${BN} ${DEST_DIR}
if [ -f ${FWK_DST_PATH}/include/${BN}~ ]
then
rm ${FWK_DST_PATH}/include/${BN}~
......@@ -75,7 +64,7 @@ do
s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1`
if [ ${s1} != ${s2} ]
then
cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR}
cp ${FWK_DST_PATH}/src/${BN} ${DEST_DIR}
if [ -f ${FWK_DST_PATH}/src/${BN}~ ]
then
rm ${FWK_DST_PATH}/src/${BN}~
......@@ -91,7 +80,7 @@ do
s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1`
if [ "${s1}" != "${s2}" ]
then
cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR}
cp ${FWK_DST_PATH}/src/${BN} ${DEST_DIR}
if [ -f ${FWK_DST_PATH}/src/${BN}~ ]
then
rm ${FWK_DST_PATH}/src/${BN}~
......@@ -106,7 +95,7 @@ do
s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1`
if [ "${s1}" != "${s2}" ]
then
cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR}
cp ${FWK_DST_PATH}/src/${BN} ${DEST_DIR}
if [ -f ${FWK_DST_PATH}/src/${BN}~ ]
then
rm ${FWK_DST_PATH}/src/${BN}~
......@@ -122,7 +111,7 @@ do
s2=`sha256sum -b ${FWK_DST_PATH}/include/${BN} | cut -d' ' -f1`
if [ ${s1} != ${s2} ]
then
cp ${FWK_DST_PATH}/include/${BN} ${VAGRANT_DIR}
cp ${FWK_DST_PATH}/include/${BN} ${DEST_DIR}
if [ -f ${FWK_DST_PATH}/include/${BN}~ ]
then
rm ${FWK_DST_PATH}/include/${BN}~
......@@ -136,7 +125,7 @@ do
s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1`
if [ ${s1} != ${s2} ]
then
cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR}
cp ${FWK_DST_PATH}/src/${BN} ${DEST_DIR}
if [ -f ${FWK_DST_PATH}/src/${BN}~ ]
then
rm ${FWK_DST_PATH}/src/${BN}~
......@@ -151,7 +140,7 @@ do
s2=`sha256sum -b ${FWK_DST_PATH}/include/${BN} | cut -d' ' -f1`
if [ ${s1} != ${s2} ]
then
cp ${FWK_DST_PATH}/include/${BN} ${VAGRANT_DIR}
cp ${FWK_DST_PATH}/include/${BN} ${DEST_DIR}
if [ -f ${FWK_DST_PATH}/include/${BN}~ ]
then
rm ${FWK_DST_PATH}/include/${BN}~
......@@ -166,7 +155,7 @@ do
s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1`
if [ ${s1} != ${s2} ]
then
cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR}
cp ${FWK_DST_PATH}/src/${BN} ${DEST_DIR}
if [ -f ${FWK_DST_PATH}/src/${BN}~ ]
then
rm ${FWK_DST_PATH}/src/${BN}~
......@@ -188,7 +177,7 @@ do
s2=`sha256sum -b ${TTCN_3_DST_PATH}/$i/ttcn/${BN} | cut -d' ' -f1`
if [ ${s1} != ${s2} ]
then
cp ${TTCN_3_DST_PATH}/$i/ttcn/${BN} ${VAGRANT_DIR}
cp ${TTCN_3_DST_PATH}/$i/ttcn/${BN} ${DEST_DIR}
fi
done
# Other files
......@@ -198,8 +187,8 @@ do
s2=`sha256sum -b ${SRC_ITS_PATH}/docs/$i/o2.cfg | cut -d' ' -f1`
if [ ${s1} != ${s2} ]
then
mkdir -p ${VAGRANT_DIR}/docs/$i
cp ${PATH_DEV_ITS}/src/$i/docs/o2.cfg ${VAGRANT_DIR}/docs/$i
mkdir -p ${DEST_DIR}/docs/$i
cp ${PATH_DEV_ITS}/src/$i/docs/o2.cfg ${DEST_DIR}/docs/$i
fi
fi
if [ -f ${SRC_ITS_PATH}/etc/$i/ITSTS.cfg ]
......@@ -208,8 +197,8 @@ do
s2=`sha256sum -b ${SRC_ITS_PATH}/etc/$i/ITSTS.cfg | cut -d' ' -f1`
if [ ${s1} != ${s2} ]
then
mkdir -p ${VAGRANT_DIR}/etc/$i
cp ${PATH_DEV_ITS}/src/$i/etc/ITSTS.cfg ${VAGRANT_DIR}/etc/$i
mkdir -p ${DEST_DIR}/etc/$i
cp ${PATH_DEV_ITS}/src/$i/etc/ITSTS.cfg ${DEST_DIR}/etc/$i
fi
fi
done
......@@ -225,7 +214,7 @@ do
s2=`sha256sum -b ${TTCN_3_DST_PATH}/LibIts/$i/ttcn/${BN} | cut -d' ' -f1`
if [ ${s1} != ${s2} ]
then
cp ${TTCN_3_DST_PATH}/LibIts/$i/ttcn/${BN} ${VAGRANT_DIR}
cp ${TTCN_3_DST_PATH}/LibIts/$i/ttcn/${BN} ${DEST_DIR}
rm ${TTCN_3_DST_PATH}/LibIts/$i/ttcn/${BN}~
fi
done
......@@ -238,7 +227,7 @@ do
# s2=`sha256sum -b ${PATH_DEV_ITS}/src/LibIts/$i/include/${BN} | cut -d' ' -f1`
# if [ ${s1} != ${s2} ]
# then
# cp ${PATH_DEV_ITS}/src/LibIts/$i/include/${BN} ${VAGRANT_DIR}
# cp ${PATH_DEV_ITS}/src/LibIts/$i/include/${BN} ${DEST_DIR}
# rm ${PATH_DEV_ITS}/src/LibIts/$i/include/${BN}~
# fi
# done
......@@ -249,7 +238,7 @@ do
# s2=`sha256sum -b ${PATH_DEV_ITS}/src/LibIts/$i/src/${BN} | cut -d' ' -f1`
# if [ ${s1} != ${s2} ]
# then
# cp ${PATH_DEV_ITS}/src/LibIts/$i/src/${BN} ${VAGRANT_DIR}
# cp ${PATH_DEV_ITS}/src/LibIts/$i/src/${BN} ${DEST_DIR}
# rm ${PATH_DEV_ITS}/src/LibIts/$i/src/${BN}~
# fi
# done
......@@ -261,10 +250,10 @@ for i in ${LIST_FILES}
do
BN=$i
BN=${BN:: -1} # Remove the last character
cp ${BN} ${VAGRANT_DIR}
cp ${BN} ${DEST_DIR}
rm $i
done
chmod -R 664 ${VAGRANT_DIR}
chmod -R 664 ${DEST_DIR}
exit 0
Supports Markdown
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