pmb.helpers.repo: Show progress bar when downloading APKINDEX files (MR 1996)

Run pmbootstrap update to test
This commit is contained in:
Johannes Marbach 2020-12-05 14:41:21 +01:00 committed by Oliver Smith
parent bbf0a70e5b
commit e058841709
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 3 additions and 1 deletions

View File

@ -179,7 +179,8 @@ def update(args, arch=None, force=False, existing_only=False):
" (" + str(len(outdated)) + " file(s))")
# Download and move to right location
for url, target in outdated.items():
for (i, (url, target)) in enumerate(outdated.items()):
pmb.helpers.cli.progress_print(i / len(outdated))
temp = pmb.helpers.http.download(args, url, "APKINDEX", False,
logging.DEBUG, True)
if not temp:
@ -189,6 +190,7 @@ def update(args, arch=None, force=False, existing_only=False):
if not os.path.exists(target_folder):
pmb.helpers.run.root(args, ["mkdir", "-p", target_folder])
pmb.helpers.run.root(args, ["cp", temp, target])
pmb.helpers.cli.progress_flush()
return True