@@ -218,7 +218,7 @@ def determine_url_valid(url_from_srv):
218
218
print ('Network connection error or the url : %s is invalid.\n ' % url_from_srv .encode ("utf-8" ))
219
219
220
220
221
- def install_pkg (env_root , bsp_root , pkg ):
221
+ def install_pkg (env_root , pkgs_root , bsp_root , pkg ):
222
222
"""Install the required packages."""
223
223
224
224
# default true
@@ -234,7 +234,7 @@ def install_pkg(env_root, bsp_root, pkg):
234
234
pkg_path = pkg ['path' ]
235
235
if pkg_path [0 ] == '/' or pkg_path [0 ] == '\\ ' :
236
236
pkg_path = pkg_path [1 :]
237
- pkg_path = os .path .join (env_root , 'packages' , pkg_path , 'package.json' )
237
+ pkg_path = os .path .join (pkgs_root , pkg_path , 'package.json' )
238
238
package .parse (pkg_path )
239
239
240
240
url_from_json = package .get_url (pkg ['ver' ])
@@ -354,6 +354,7 @@ def package_list():
354
354
355
355
fn = '.config'
356
356
env_root = Import ('env_root' )
357
+ pkgs_root = Import ('pkgs_root' )
357
358
358
359
if not os .path .isfile (fn ):
359
360
if platform .system () == "Windows" :
@@ -378,7 +379,7 @@ def package_list():
378
379
if pkg_path [0 ] == '/' or pkg_path [0 ] == '\\ ' :
379
380
pkg_path = pkg_path [1 :]
380
381
381
- pkg_path = os .path .join (env_root , 'packages' , pkg_path , 'package.json' )
382
+ pkg_path = os .path .join (pkgs_root , pkg_path , 'package.json' )
382
383
package .parse (pkg_path )
383
384
384
385
pkgs_name_in_json = package .get_name ()
@@ -451,6 +452,7 @@ def update_latest_packages(pkgs_fn, bsp_packages_path):
451
452
"""
452
453
453
454
env_root = Import ('env_root' )
455
+ pkgs_root = Import ('pkgs_root' )
454
456
455
457
env_kconfig_path = os .path .join (env_root , 'tools\scripts\cmds' )
456
458
env_config_file = os .path .join (env_kconfig_path , '.config' )
@@ -464,7 +466,7 @@ def update_latest_packages(pkgs_fn, bsp_packages_path):
464
466
if pkg_path [0 ] == '/' or pkg_path [0 ] == '\\ ' :
465
467
pkg_path = pkg_path [1 :]
466
468
467
- pkg_path = os .path .join (env_root , 'packages' , pkg_path , 'package.json' )
469
+ pkg_path = os .path .join (pkgs_root , pkg_path , 'package.json' )
468
470
package .parse (pkg_path )
469
471
pkgs_name_in_json = package .get_name ()
470
472
@@ -606,6 +608,7 @@ def pre_package_update():
606
608
def error_packages_handle (error_packages_list , read_back_pkgs_json , pkgs_fn ):
607
609
bsp_root = Import ('bsp_root' )
608
610
env_root = Import ('env_root' )
611
+ pkgs_root = Import ('pkgs_root' )
609
612
610
613
flag = None
611
614
@@ -619,7 +622,7 @@ def error_packages_handle(error_packages_list, read_back_pkgs_json, pkgs_fn):
619
622
print ("Warning: Packages should be deleted in <menuconfig> command.\n " )
620
623
621
624
for pkg in error_packages_list : # Redownloaded the packages in error_packages_list
622
- if install_pkg (env_root , bsp_root , pkg ):
625
+ if install_pkg (env_root , pkgs_root , bsp_root , pkg ):
623
626
print ("==============================> %s %s is redownloaded successfully. \n " % (
624
627
pkg ['name' ].encode ("utf-8" ), pkg ['ver' ].encode ("utf-8" )))
625
628
else :
@@ -739,6 +742,7 @@ def package_update(isDeleteOld=False):
739
742
740
743
bsp_root = Import ('bsp_root' )
741
744
env_root = Import ('env_root' )
745
+ pkgs_root = Import ('pkgs_root' )
742
746
flag = True
743
747
744
748
# According to the env version, whether Chinese output is supported or not
@@ -829,7 +833,7 @@ def package_update(isDeleteOld=False):
829
833
pkgs_download_fail_list = []
830
834
831
835
for pkg in casedownload :
832
- if install_pkg (env_root , bsp_root , pkg ):
836
+ if install_pkg (env_root , pkgs_root , bsp_root , pkg ):
833
837
print ("==============================> %s %s is downloaded successfully. \n " % (
834
838
pkg ['name' ], pkg ['ver' ]))
835
839
else :
@@ -980,6 +984,7 @@ def upgrade_packages_index():
980
984
"""Update the package repository index."""
981
985
982
986
env_root = Import ('env_root' )
987
+ pkgs_root = Import ('pkgs_root' )
983
988
env_kconfig_path = os .path .join (env_root , 'tools\scripts\cmds' )
984
989
env_config_file = os .path .join (env_kconfig_path , '.config' )
985
990
if (not os .path .isfile (env_config_file )) or (os .path .isfile (env_config_file ) and find_macro_in_config (env_config_file , 'SYS_PKGS_DOWNLOAD_ACCELERATE' )):
@@ -992,7 +997,7 @@ def upgrade_packages_index():
992
997
else :
993
998
git_repo = 'https://github.com/RT-Thread/packages.git'
994
999
995
- packages_root = os . path . join ( env_root , 'packages' )
1000
+ packages_root = pkgs_root
996
1001
pkgs_path = os .path .join (packages_root , 'packages' )
997
1002
998
1003
if not os .path .isdir (pkgs_path ):
0 commit comments