8000 无用优化 · home-coder/yun-update-source@6250365 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6250365

Browse files
committed
无用优化
1 parent 1f5bf38 commit 6250365

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

edit_util.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function write_kl_file()
136136
debug_info "change "key $key_num $key_value_1 $key_value_2" -->"key $key_num $param_value_1""
137137
retflag=1
138138
else
139-
debug_info "same code, skip"
139+
debug_info "same code, skip 666"
140140
fi
141141
elif [[ $# -eq 4 ]]; then
142142
param_value_1="$3"
@@ -147,7 +147,7 @@ function write_kl_file()
147147
debug_info "change "key $key_num $key_value_1 $key_value_2" -->"key $key_num $param_value_1 $param_value_2""
148148
retflag=1
149149
else
150-
debug_info "same code, skip"
150+
debug_info "same code, skip 666"
151151
fi
152152
else
153153
debug_error "undefined kl inner format, just support like 1 'POWER' or 2 'POWER WAKE', this case maybe 3 'POWER WAKE HELLO', exit (-1)"
@@ -206,25 +206,30 @@ function write_fex_file()
206206
while read line; do
207207
let num=num+1
208208

209+
#块区[ ]开始标志
209210
if [ X"$line" = X"[$param_section]" ];then
210211
has_section=1
211212
begin_section=1
212213
continue
213214
fi
214215

215216
if [ $begin_section -eq 1 ];then
217+
#块区[ ]结束标志
216218
end_section=$(echo $line | awk 'BEGIN{ret=0} /^\[.*\]$/{ret=1} END{print ret}')
217219
if [ $end_section -eq 1 ];then
218220
break
219221
fi
220222

223+
#跳过 ; 开头的注释行
221224
need_ignore=$(echo $line | awk 'BEGIN{ret=0} /^;/{ret=1} /^$/{ret=1} END{print ret}')
222225
if [ $need_ignore -eq 1 ];then
223226
continue
224227
fi
228+
#获取过程
225229
item=$(echo $line | awk -F= '{gsub(" |\t","",$1); print $1}')
226230
value=$(echo $line | awk -F= '{gsub(" |\t","",$2); print $2}')
227231

232+
#匹配过程
228233
if [ "$param_item"x == "$item"x ];then
229234
has_item=1
230235
debug_import "fex modify line num = $num, section[$param_section], item[$param_item], value[$param_value]"
@@ -237,6 +242,7 @@ function write_fex_file()
237242

238243
#sed -i '99s/'"port:PA15<1><default><default><1>"'/'"port:PA12<1><default><default><1>"'/' $param_file
239244

245+
#业务逻辑
240246
if [[ ($has_section -ne 0)&&($has_item -ne 0)&&("$value"x != "$param_value"x) ]]; then
241247
sed -i "${num}s/$value/$param_value/" $param_file
242248
debug_import "$num: $param_item = $param_value"

include.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function creat_manifest_map()
5555
}
5656

5757
#
58-
#@PARM:以字符串形式对应map, @FUNC: 根据名称分别dump。 此方法有重复代码,未优化
58+
#@PARM:以字符串形式对应map, @FUNC: 根据名称分别dump。XXX:可以简化吗
5959
#
6060
function dump_map()
6161
{

r-config/mstar638_register

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
#manifest字段 本地对应字段 本地修改地址
1+
#manifest所有字段 本地对应字段 本地修改地址
22

3-
AAA inside_model ./test_data/env.cfg
4-
BBB launcher_channelid ./test_data/env.cfg
5-
CCC product_company ./test_data/external_product.txt
6-
DDD product_hotline ./test_data/external_product.txt
7-
EEE product_email ./test_data/external_product.txt
3+
AAA inside_model ./test_data/external_product.txt
4+
BBB launcher_channelid xxx
5+
CCC product_company xxx
6+
DDD product_hotline xxx
7+
EEE product_email xxx
88
FFF PRODUCT_MANUFACTURER ./test_data/dolphin_cantv_h2.mk
9-
GGG customer_code ./test_data/custom_ir
9+
GGG customer_code ./test_data
1010
HHH gpio1 ./test_data/sys_config.fex
1111
JJJ
1212
KKK business_model ./test_data/env.cfg
1313
LLL fake_flash ./test_data/env.cfg
1414

15+
#keyboad layout

0 commit comments

Comments
 (0)
0