@@ -196,7 +196,10 @@ def install_pkg(env_root, bsp_root, pkg):
196196 #print "url:",package_url
197197 #print "url_from_json: ",url_from_json
198198 #print("==================================================>")
199-
199+
200+ get_package_url = None
201+ get_ver_sha = None
202+
200203 if os .path .isfile (env_config_file ) and find_macro_in_condfig (env_config_file , 'SYS_PKGS_DOWNLOAD_ACCELERATE' ):
201204 get_package_url , get_ver_sha = get_url_from_mirror_server (
202205 pkgs_name_in_json , pkg ['ver' ])
@@ -264,7 +267,7 @@ def install_pkg(env_root, bsp_root, pkg):
264267
265268 # unpack package
266269 if not os .path .exists (pkg_dir ):
267- package .unpack (pkg_fullpath , bsp_pkgs_path , pkg )
270+ package .unpack (pkg_fullpath , bsp_pkgs_path , pkg , pkgs_name_in_json )
268271 ret = True
269272
270273 return ret
@@ -440,22 +443,9 @@ def update_latest_packages(read_back_pkgs_json, bsp_packages_path):
440443 (pkgs_name_in_json ))
441444
442445
443- def package_update ():
444- """Update env's packages.
446+ def pre_package_update ():
445447
446- Compare the old and new software package list and update the package.
447- Remove unwanted packages and download the newly selected package.
448- Check if the files in the deleted packages have been changed, and if so,
449- remind the user saved the modified file.
450- """
451-
452448 bsp_root = Import ('bsp_root' )
453- env_root = Import ('env_root' )
454-
455- flag = True
456-
457- #print bsp_root
458- #print env_root
459449
460450 if not os .path .exists ('.config' ):
461451 print (
@@ -509,6 +499,30 @@ def package_update():
509499 with open (pkgs_fn , 'r' ) as f :
510500 oldpkgs = json .load (f )
511501
502+ return [oldpkgs , newpkgs , pkgs_fn , bsp_packages_path , dbsqlite_pathname ]
503+
504+
505+ def package_update ():
506+ """Update env's packages.
507+
508+ Compare the old and new software package list and update the package.
509+ Remove unwanted packages and download the newly selected package.
510+ Check if the files in the deleted packages have been changed, and if so,
511+ remind the user saved the modified file.
512+ """
513+
514+ bsp_root = Import ('bsp_root' )
515+ env_root = Import ('env_root' )
516+
517+ flag = True
518+
519+ sys_value = pre_package_update ()
520+ oldpkgs = sys_value [0 ]
521+ newpkgs = sys_value [1 ]
522+ pkgs_fn = sys_value [2 ]
523+ bsp_packages_path = sys_value [3 ]
524+ dbsqlite_pathname = sys_value [4 ]
525+
512526 #print "newpkgs:",newpkgs
513527 #print "oldpkgs:",oldpkgs
514528
0 commit comments