-
Notifications
You must be signed in to change notification settings - Fork 2
/
v4-rename-ifwrapper.sh
executable file
·43 lines (34 loc) · 1.57 KB
/
v4-rename-ifwrapper.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
#!/bin/bash
function find_all() {
find . -name "*" -not \( -path "*/.git/*" -o -path "*/src_core/*" -o -path "*.xlsm" \) -type f -print0
}
echo "IfWrapper -> hal"
echo ""
## c2a-core ref
echo "rename c2a-core ref: src_core/IfWrapper -> src_core/hal"
find_all | xargs -0 sed -i -e "s#src_core/IfWrapper/Common/i2c_common#src_core/hal/i2c_common#g"
find_all | xargs -0 sed -i -e "s#src_core/IfWrapper#src_core/hal#g"
## c2a user code
echo "rename src_user dir: src_user/IfWrapper -> src_user/hal"
mv src/src_user/IfWrapper src/src_user/hal
mv src/src_user/hal/Common src/src_user/hal/common
mv src/src_user/hal/Sils src/src_user/hal/sils
mv src/src_user/hal/SilsMockup src/src_user/hal/sils_mockup
### ref
echo "rename src_user ref: IfWrapper/*"
find_all | xargs -0 sed -i -e "s#IfWrapper/Common#hal/common#g"
find_all | xargs -0 sed -i -e "s#IfWrapper/Sils#IfWrapper/sils#g"
find_all | xargs -0 sed -i -e "s#SilsMockup#sils_mockup#g"
#### IfWrapper internal ref
echo "rename src_user ref in src/src_user/hal: IfWrapper/*"
find src/src_user/hal -name "*" -type f -print0 | xargs -0 sed -i -e "s#Common#common#g"
find src/src_user/hal -name "*" -type f -print0 | xargs -0 sed -i -e "s#Sils#sils#g"
#### main ref
echo "rename IfWrapper -> hal"
find_all | xargs -0 sed -i -e "s#IfWrapper#hal#g"
find_all | xargs -0 sed -i -e "s#IF wrapper#HAL#g"
find_all | xargs -0 sed -i -e "s#IF_wrapper#HAL#g"
find_all | xargs -0 sed -i -e "s#IF Wrapper#HAL#g"
find_all | xargs -0 sed -i -e "s#IF_WRAPPER#HAL#g"
find_all | xargs -0 sed -i -e "s#C2A_IF#C2A_HAL#g"
find_all | xargs -0 sed -i -e "s#IF_IMPL#HAL_IMPL#g"