Skip to content

Commit 1060e17

Browse files
committed
【完善】:断网状态下的错误提示信息
1 parent 2cee3ba commit 1060e17

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cmds/cmd_package.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ def install_pkg(env_root, bsp_root, pkg):
280280
except Exception, e:
281281
print("\nFailed to download software package with git. Please check the network connection.")
282282
# sys.exit(0)
283+
return False
283284

284285
if upstream_change_flag:
285286
cmd = 'git remote set-url origin ' + url_from_json
@@ -610,16 +611,14 @@ def error_packages_handle(error_packages_list, read_back_pkgs_json, pkgs_fn):
610611
if len(error_packages_redownload_error_list):
611612
print("%s" % error_packages_redownload_error_list)
612613
print ("Packages:%s,%s redownloed error, you need to use <pkgs --update> command again to redownload them." %
613-
(pkg['name'], pkg['ver']))
614+
(pkg['name'].encode("utf-8"), pkg['ver'].encode("utf-8")))
614615
write_back_pkgs_json = sub_list(
615616
read_back_pkgs_json, error_packages_redownload_error_list)
616617
read_back_pkgs_json = write_back_pkgs_json
617618
# print("write_back_pkgs_json:%s"%write_back_pkgs_json)
618619
pkgs_file = file(pkgs_fn, 'w')
619620
pkgs_file.write(json.dumps(write_back_pkgs_json, indent=1))
620621
pkgs_file.close()
621-
else:
622-
print("\nAll the selected packages have been downloaded successfully.\n")
623622

624623
return flag
625624

@@ -822,7 +821,7 @@ def package_update(isDeleteOld=False):
822821
if len(pkgs_download_fail_list):
823822
print("Package download failed pkgs_download_fail_list: %s \n" %
824823
pkgs_download_fail_list)
825-
print("You need to reuse the <pkgs -update> command to download again.\n")
824+
print("You need to reuse the <pkgs -update> command to download again.")
826825

827826
# update pkgs.json and SConscript
828827
write_storage_file(pkgs_fn, newpkgs)

0 commit comments

Comments
 (0)