mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-19 11:42:43 +00:00
print package count
This commit is contained in:
parent
eb26bf3f4f
commit
518d14334b
@ -168,6 +168,7 @@ def apt_mirror(base_url: str, dist: str, repo: str, arch: str, dest_base_dir: Pa
|
||||
# Download packages
|
||||
err = 0
|
||||
deb_count = 0
|
||||
deb_size = 0
|
||||
for pkg in pkgidx_content.split('\n\n'):
|
||||
if len(pkg) < 10: # ignore blanks
|
||||
continue
|
||||
@ -209,6 +210,7 @@ def apt_mirror(base_url: str, dist: str, repo: str, arch: str, dest_base_dir: Pa
|
||||
print(f"Failed to download {dest_filename}")
|
||||
err = 1
|
||||
deb_count += 1
|
||||
deb_size += pkg_size
|
||||
# if deb_count == 2:
|
||||
# break
|
||||
try:
|
||||
@ -224,6 +226,7 @@ def apt_mirror(base_url: str, dist: str, repo: str, arch: str, dest_base_dir: Pa
|
||||
return 1
|
||||
|
||||
print(f"Mirroring {base_url} {dist}, {repo}, {arch} done!")
|
||||
print(f"{deb_count} packages, {deb_size} bytes in total")
|
||||
return err
|
||||
|
||||
def main():
|
||||
|
Loading…
x
Reference in New Issue
Block a user