-
Notifications
You must be signed in to change notification settings - Fork 1
/
apply_t2_libc_compatibility_patches.sh
67 lines (49 loc) · 2.26 KB
/
apply_t2_libc_compatibility_patches.sh
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
#!/bin/bash
PLATFORM_TYPE=$(cat ../../build.mak | grep "SDK_THREE_DOT_X")
if [ "$PLATFORM_TYPE" = "BUILD_TYPE_FLAG = -DSDK_THREE_DOT_X" ]
then
OS_TYPE=sdk_3.x
else
OS_TYPE=sdk_2.x
fi
PATCH_FILE_1_PATH=patches/$OS_TYPE/azure-iot-sdk-c.patch
PATCH_TARGET_1_PATH=azure-iot-sdk-c
PATCH_FILE_2_PATH=patches/$OS_TYPE/azure-iot-sdk-c_deps_parson.patch
PATCH_TARGET_2_PATH=azure-iot-sdk-c/deps/parson
PATCH_FILE_3_PATH=patches/$OS_TYPE/azure-iot-sdk-c_deps_uhttp.patch
PATCH_TARGET_3_PATH=azure-iot-sdk-c/deps/uhttp
PATCH_FILE_4_PATH=patches/$OS_TYPE/azure-iot-sdk-c_provisioning-client_deps_utpm_deps_c-utility.patch
PATCH_TARGET_4_PATH=azure-iot-sdk-c/provisioning_client/deps/utpm/deps/c-utility
PATCH_FILE_5_PATH=patches/$OS_TYPE/azure-iot-sdk-c_umqtt.patch
PATCH_TARGET_5_PATH=azure-iot-sdk-c/umqtt
PATCH_FILE_6_PATH=patches/$OS_TYPE/azure-iot-sdk-c_c-utility.patch
PATCH_TARGET_6_PATH=azure-iot-sdk-c/c-utility
PATCH_FILE_7_PATH=patches/$OS_TYPE/azure-iot-sdk-c_c-utility_deps_azure-macro-utils-c_inc_azure-macro-utils.patch
PATCH_TARGET_7_PATH=azure-iot-sdk-c/c-utility/deps/azure-macro-utils-c/inc/azure_macro_utils
ROOT_PATH="$PWD"
echo $ROOT_PATH
echo "...patching $ROOT_PATH/$PATCH_TARGET_1_PATH"
cd $ROOT_PATH/$PATCH_TARGET_1_PATH
git apply --whitespace=nowarn $ROOT_PATH/$PATCH_FILE_1_PATH
echo "...patching $ROOT_PATH/$PATCH_TARGET_2_PATH"
cd $ROOT_PATH/$PATCH_TARGET_2_PATH
git apply --whitespace=nowarn $ROOT_PATH/$PATCH_FILE_2_PATH
echo "...patching $ROOT_PATH/$PATCH_TARGET_3_PATH"
cd $ROOT_PATH/$PATCH_TARGET_3_PATH
git apply --whitespace=nowarn $ROOT_PATH/$PATCH_FILE_3_PATH
echo "...patching $ROOT_PATH/$PATCH_TARGET_4_PATH"
cd $ROOT_PATH/$PATCH_TARGET_4_PATH
git apply --whitespace=nowarn $ROOT_PATH/$PATCH_FILE_4_PATH
if [ "$PLATFORM_TYPE" != "BUILD_TYPE_FLAG = -DSDK_THREE_DOT_X" ]
then
echo "...patching $ROOT_PATH/$PATCH_TARGET_5_PATH"
cd $ROOT_PATH/$PATCH_TARGET_5_PATH
git apply --whitespace=nowarn $ROOT_PATH/$PATCH_FILE_5_PATH
fi
echo "...patching $ROOT_PATH/$PATCH_TARGET_6_PATH"
cd $ROOT_PATH/$PATCH_TARGET_6_PATH
git apply --whitespace=nowarn $ROOT_PATH/$PATCH_FILE_6_PATH
echo "...patching $ROOT_PATH/$PATCH_TARGET_7_PATH"
cd $ROOT_PATH/$PATCH_TARGET_7_PATH
git apply --whitespace=nowarn $ROOT_PATH/$PATCH_FILE_7_PATH
echo "...patching completed"