8000 解了如果kl文件中有#注释掉的键值 最终会被替换 · home-coder/yun-update-source@f2c7760 · GitHub
[go: up one dir, main page]

Skip to content

Commit f2c7760

Browse files
committed
解了如果kl文件中有#注释掉的键值 最终会被替换
1 parent cf48877 commit f2c7760

File tree

5 files changed

+15
-46
lines changed

5 files changed

+15
-46
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ SED:
5858
--
5959
http://man.linuxde.net/sed
6060

61-
61+
正则:
62+
--
63+
http://www.blogjava.net/jasmine214--love/archive/2011/10/12/361040.html
6264

6365
###################################################一些说明##############################################################################
64-
1.为防止manifest中key对应的修改的文件可能不止一个,所以没有把key-path配置成类似custom_branch_platform形式的配置文件
66+

edit_util.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function write_kl_file()
130130
param_value_1="$3"
131131
#如果对应的键值是不同的,则如下方式更新[原因是本地kl文件可能是单项或者多项] 并将retflag置1;否则维持不变依据0+0+0==0
132132
if [[ "$param_value_1"x != "$key_value_1"x || -n "$key_value_2" ]]; then
133-
sed -i '/'[[:space:]]$key_num[[:space:]]'/s/.*/'key' '$key_num' '$param_value_1'/g' $param_file
133+
sed -i '/'^'key\([[:space:]]\)\+'$key_num[[:space:]]'/s/.*/'key' '$key_num' '$param_value_1'/g' $param_file
134134
debug_info "change "key $key_num $key_value_1 $key_value_2" -->"key $key_num $param_value_1""
135135
retflag=1
136136
else
@@ -141,7 +141,7 @@ function write_kl_file()
141141
param_value_2="$4"
142142
#如果对应的键值是不同的,则如下方式更新[原因是本地kl文件可能是单项或者多项] 并将retflag置1;否则维持不变依据0+0+0==0
143143
if [[ "$param_value_1"x != "$key_value_1"x || "$param_value_2"x != "$key_value_2"x ]]; then
144-
sed -i '/'[[:space:]]$key_num[[:space:]]'/s/.*/'key' '$key_num' '$param_value_1' '$param_value_2'/g' $param_file
144+
sed -i '/'^'key\([[:space:]]\)\+'$key_num[[:space:]]'/s/.*/'key' '$key_num' '$param_value_1' '$param_value_2'/g' $param_file
145145
debug_info "change "key $key_num $key_value_1 $key_value_2" -->"key $key_num $param_value_1 $param_value_2""
146146
retflag=1
147147
else

process_server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function process_keyboard_layout()
8686
case $CURENT_DEVICE in
8787
"dolphin-cantv-h2")
8888
#TODO 改成文件名,然后统一处理路径问题
89-
local path="$path_tmp/custom_ir_${irlabel}.kl"
89+
local path="$path_tmp/customer_ir_${irlabel}.kl"
9090
;;
9191
#TODO 638
9292
#TODO z11

test_data/custom_ir_1044.kl

Lines changed: 0 additions & 37 deletions
This file was deleted.

test_data/customer_ir_1044.kl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ key 16 DEL
1111
key 17 6
1212
key 18 5
1313
key 21 3
14-
#key 22 FUCK
15-
key 22 OK
14+
#key 22 HELLO
15+
key 22 MENU
1616
key 23 INFO
17-
key 24 MENU
17+
key 24 MAAENU
1818
key 25 MEDIA_PLAY_PAUSE
1919
key 26 DPAD_UP
2020
key 28 POWER WAKE
2121
key 65 SETTINGS
22-
key 66 WORLD
22+
key 66 3
2323
key 71 DPAD_LEFT
2424
key 72 DPAD_DOWN
2525
key 75 VOLUME_UP
@@ -32,3 +32,7 @@ key 91 APPS
3232
key 92 MEDIA_NEXT
3333
key 93 MEDIA_PREVIOUS
3434
key 95 MOVIE
35+
key 55 2
36+
key 44 1
37+
key 11 BACK
38+
key 33 0 WAKE

0 commit comments

Comments
 (0)
0