summaryrefslogtreecommitdiff
path: root/packaging/tizen_fix/tizen_fix.sh
blob: 4066467ff8bc829ba6b53f643e7d1f1644e23f58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
DST_PATH=$SCRIPT_DIR/../../
FILE1="BUILD.gn"
FILE2="src/crypto/crypto.gni"
FILE3="src/platform/Linux/MdnsImpl.cpp"

cd $DST_PATH

while true; do
    echo -e "\e[31m***********************************\e[0m"
    echo -e "\e[31m********** C A U T I O N **********\e[0m"
    echo -e "\e[31m***********************************\e[0m"
    echo -e "\e[31m This script is a program that downloads the code of CHIP upstream and enables tizen gbs build.\e[0m"
    echo -e "\e[31m This script contains the contents of deleting all files from CHIP folder (except packaging, git folders)! We ask for safety in use.\e[0m"
    echo -e "\e[31m Please do not change the location of this script.\e[0m"
    echo -e "\e[31m Please check if the path of CHIP folder below is correct. \e[0m"
    echo -e "\e[32m CHIP folder path : $PWD\e[0m"
    read -p "Do you wish to delete files of the folder? (Y/N) : " yn
    case $yn in
        [Yy]* ) break;;
        [Nn]* ) exit;;
        * ) echo "Please answer yes or no.";;
    esac
done


rm -rf `ls | find ./ ! \( \( -path './packaging' -o -path './.git' -o -path './' \) -prune \)`

cd -

git clone https://github.com/project-chip/connectedhomeip
cd connectedhomeip
git submodule update --init
rm -rf .git/
cd ..
cp -rf ./connectedhomeip/* $DST_PATH
rm -rf ./connectedhomeip/

cp ${SCRIPT_DIR}/BUILD.gn ${DST_PATH}${FILE1}
cp ${SCRIPT_DIR}/crypto.gni ${DST_PATH}${FILE2}
cp ${SCRIPT_DIR}/MdnsImpl.cpp ${DST_PATH}${FILE3}