summaryrefslogtreecommitdiff
path: root/depver_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'depver_test.py')
-rw-r--r--depver_test.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/depver_test.py b/depver_test.py
index 3dcf596..5e25c39 100644
--- a/depver_test.py
+++ b/depver_test.py
@@ -31,7 +31,7 @@ def atomize(spec):
# Not reached
assert False
-def analyze(url, repos, arch):
+def analyze(opts, arch):
pkgs = collections.defaultdict(dict)
newest = {}
providers = collections.defaultdict(list)
@@ -39,8 +39,9 @@ def analyze(url, repos, arch):
print("Loading " + arch + "...", file=sys.stderr)
index = []
- for repo in repos:
- index.extend(Index(url=url + f"/{repo}/{arch}/APKINDEX.tar.gz").packages)
+ for repo in opts.repos:
+ url = f"{opts.url}/{repo}/{arch}/APKINDEX.tar.gz"
+ index.extend(Index(url=url).packages)
for pkg in index:
new = pkg.version
@@ -69,7 +70,6 @@ def analyze(url, repos, arch):
providers[i].append((pkg.name, pver))
yield ["arch", "package", "version", "issue"]
-
for name in sorted(pkgs.keys()):
# DON'T use newest[] here. It is possible that a package
# provides= another package's name with a newer version
@@ -96,6 +96,9 @@ def analyze(url, repos, arch):
else:
yield [arch, name, ver, No(f"Missing {spec}")]
+ if opts.only_missing:
+ continue
+
for _, pver in providers[dep]:
if is_same(pver, newest[dep]):
break
@@ -119,6 +122,10 @@ if __name__ == "__main__":
help="display format",
)
opts.add_argument(
+ "-m", "--only-missing", action="store_true",
+ help="show only missing dependencies",
+ )
+ opts.add_argument(
"url", metavar="URL",
help="base URL (no repository or arch)",
)
@@ -138,5 +145,5 @@ if __name__ == "__main__":
# FIXME: with html, wrapping will repeat for > 1 arch
FORMATTERS[opts.format](
opts,
- analyze(opts.url, opts.repos, arch),
+ analyze(opts, arch),
)