@@ -231,21 +231,20 @@ def install_pkg(env_root, bsp_root, pkg):
231231 if os .path .isfile (submod_path ):
232232 print ("Start to update submodule" )
233233
234- # Modify .gitmodules file
235- replace_list = modify_submod_file_to_mirror (submod_path )
234+ if os . path . isfile ( env_config_file ) and find_macro_in_condfig ( env_config_file , 'SYS_PKGS_DOWNLOAD_ACCELERATE' ):
235+ replace_list = modify_submod_file_to_mirror (submod_path ) # Modify .gitmodules file
236236
237- cmd = 'git submodule init -q'
238- os .system (cmd )
239- cmd = 'git submodule update'
237+ cmd = 'git submodule update --init --recursive'
240238 if not os .system (cmd ):
241239 print ("Submodule update successful" )
242240
243- if len (replace_list ):
244- for item in replace_list :
245- submod_dir_path = os .path .join (repo_path , item [2 ])
246- if os .path .isdir (submod_dir_path ):
247- cmd = 'git remote set-url origin ' + item [0 ]
248- execute_command (cmd , cwd = submod_dir_path )
241+ if os .path .isfile (env_config_file ) and find_macro_in_condfig (env_config_file , 'SYS_PKGS_DOWNLOAD_ACCELERATE' ):
242+ if len (replace_list ):
243+ for item in replace_list :
244+ submod_dir_path = os .path .join (repo_path , item [2 ])
245+ if os .path .isdir (submod_dir_path ):
246+ cmd = 'git remote set-url origin ' + item [0 ]
247+ execute_command (cmd , cwd = submod_dir_path )
249248
250249 cmd = 'git remote set-url origin ' + url_from_json
251250 os .system (cmd )
0 commit comments