summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/verbs/install.py9
-rw-r--r--src/verbs/sync.py6
2 files changed, 10 insertions, 5 deletions
diff --git a/src/verbs/install.py b/src/verbs/install.py
index d5bb834..d801b79 100644
--- a/src/verbs/install.py
+++ b/src/verbs/install.py
@@ -373,11 +373,12 @@ def install_multiple(to_install, args, options, config, terminology=("install",
if package_path == "":
print(colors.RED + f"Failed to download {package}")
- downloaded += size
+ else:
+ downloaded += size
- pkg_files.append(
- (package, package_path, sources[source], key, repo, info)
- )
+ pkg_files.append(
+ (package, package_path, sources[source], key, repo, info)
+ )
util.loading_bar(int(length/divisor), int(length/divisor), "Downloaded packages", unit=unit)
print(colors.RESET)
diff --git a/src/verbs/sync.py b/src/verbs/sync.py
index 70adcd1..5559fcb 100644
--- a/src/verbs/sync.py
+++ b/src/verbs/sync.py
@@ -3,6 +3,7 @@ import util
import colors
import shutil
import time
+import sys
CACHE_DIR = "/var/cache/xipkg"
@@ -16,7 +17,10 @@ def list_packages(url):
if status != 200:
return {}, -1
else:
- duration /= len(response)
+ if len(response) > 0:
+ duration /= len(response)
+ else:
+ duration = float('inf')
return {
line.split()[0].split(".")[0]: " ".join(line.split()[1:])
for line in response.split("\n") if len(line.split()) > 0