File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -220,11 +220,11 @@ def cmd(args):
220220 os .system ('kconfig-mconf Kconfig' )
221221
222222 os .chdir (beforepath )
223-
224- if platform .system () == "Windows" :
225- os .system ('chcp 65001 > nul' )
226-
223+
224+ from cmd_package import determine_support_chinese
225+ determine_support_chinese (env_root )
227226 return
227+
228228 else :
229229 if float (os_version ) >= 6.2 :
230230 os .system ('kconfig-mconf Kconfig' )
@@ -242,8 +242,8 @@ def cmd(args):
242242 if mtime != mtime2 :
243243 mk_rtconfig (fn )
244244
245- if platform . system () == "Windows" :
246- os . system ( 'chcp 65001 > nul' )
245+ from cmd_package import determine_support_chinese
246+ determine_support_chinese ( env_root )
247247
248248 if platform .system () == "Windows" :
249249 env_kconfig_path = os .path .join (env_root , 'tools\scripts\cmds' )
Original file line number Diff line number Diff line change @@ -696,6 +696,13 @@ def write_storage_file(pkgs_fn, newpkgs):
696696 pkgs_file .close ()
697697
698698
699+ def determine_support_chinese (env_root ):
700+ get_flag_file_path = os .path .join (env_root , 'tools' , 'bin' , 'env_above_ver_1_1' )
701+ if os .path .isfile (get_flag_file_path ):
702+ # change code page to 65001
703+ if platform .system () == "Windows" :
704+ os .system ('chcp 65001 > nul' )
705+
699706def package_update (isDeleteOld = False ):
700707 """Update env's packages.
701708
@@ -705,14 +712,13 @@ def package_update(isDeleteOld=False):
705712 remind the user saved the modified file.
706713 """
707714
708- # change code page to 65001
709- if platform .system () == "Windows" :
710- os .system ('chcp 65001 > nul' )
711-
712715 bsp_root = Import ('bsp_root' )
713716 env_root = Import ('env_root' )
714717 flag = True
715718
719+ # According to the env version, whether Chinese output is supported or not
720+ determine_support_chinese (env_root )
721+
716722 sys_value = pre_package_update ()
717723
718724 if not sys_value :
You can’t perform that action at this time.
0 commit comments