summaryrefslogtreecommitdiff
path: root/make_tizenfx_from_bb.sh
blob: db9e31f16bc7a0f7b582e80223c68bea4813e0e9 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#/bin/bash

function get_tizenfx () {
    BB=$1
    STATUS="start"
    FX_LIST=""

    LINE_NUM=`grep -n "<buildingblock name=\"$BB\">" /opt/share/bb/mapping-bb-tizenfx.xml | awk -F: '{print \$1}'`

    exec < /opt/share/bb/mapping-bb-tizenfx.xml

    if [ x"$LINE_NUM" == "x" ]
    then
	retval="FAIL"
    else

    while ((LINE_NUM--))
    do
        read line
    done

    while read line
    do
        echo $line | grep "</buildingblock>" > /dev/null
        if [ $? == 0 ]
        then
            STATUS="done"
            break
        fi
        LIST=`echo $line | sed -e "s/<fx_info>\(.\+\)<\/fx_info>/\1/"`
        FX_LIST="$FX_LIST $LIST"
    done

    if [ $STATUS == "done" ]
    then
        echo "$FX_LIST" | grep "NONE" > /dev/null
        if [ $? == 0 ]
        then
            retval="FAIL"
        else
            retval=$FX_LIST
        fi
    else
        retval="FAIL"
    fi
    fi
}

rpm -qa | grep building-blocks-sub1-domain_Feature-DotNET > /dev/null

if [ $? == 0 -a -f /opt/share/bb/mapping-bb-tizenfx.xml ]
then
	API_LIST=`rpm -qa --queryformat="%{NAME}\n"| grep building-blocks- | grep domain_CSAPI`

	API_LIST="${API_LIST} building-blocks-sub1-domain_Feature-DotNET"
	G_FX_LIST=""
	for API in $API_LIST
 	do
	#    echo $API
		get_tizenfx $API
		if [ "$retval" != "FAIL" ]
		then
			G_FX_LIST="$G_FX_LIST $retval"
		fi
	done

	mkdir -p /tmp/fx_bb

	G_FX_LIST=`echo $G_FX_LIST | sed -e "s/ /\n/g" | sort -u`

	for FX in $G_FX_LIST
	do
		echo $FX
		rm -f /usr/share/dotnet.tizen/framework/ref/$FX
		cp /usr/share/dotnet.tizen/framework/$FX /tmp/fx_bb
	done
	rm -f /usr/share/dotnet.tizen/framework/*.dll
	cp -f /tmp/fx_bb/* /usr/share/dotnet.tizen/framework/
	echo "Complete to making the tizenfx for iot"
else
    echo "Warning : Can't make the tizenfx for iot"
fi