diff --git a/pmb/chroot/apk.py b/pmb/chroot/apk.py index 0fdb3b17..34411c1d 100644 --- a/pmb/chroot/apk.py +++ b/pmb/chroot/apk.py @@ -261,4 +261,4 @@ def installed(args, suffix="native"): } """ path = f"{args.work}/chroot_{suffix}/lib/apk/db/installed" - return pmb.parse.apkindex.parse(args, path, False) + return pmb.parse.apkindex.parse(path, False) diff --git a/pmb/helpers/frontend.py b/pmb/helpers/frontend.py index fa7a30be..996484c9 100644 --- a/pmb/helpers/frontend.py +++ b/pmb/helpers/frontend.py @@ -458,7 +458,7 @@ def apkbuild_parse(args): def apkindex_parse(args): - result = pmb.parse.apkindex.parse(args, args.apkindex_path) + result = pmb.parse.apkindex.parse(args.apkindex_path) if args.package: if args.package not in result: raise RuntimeError("Package not found in the APKINDEX: " + diff --git a/pmb/helpers/pkgrel_bump.py b/pmb/helpers/pkgrel_bump.py index de2f40e7..86146871 100644 --- a/pmb/helpers/pkgrel_bump.py +++ b/pmb/helpers/pkgrel_bump.py @@ -107,7 +107,7 @@ def auto(args, dry=False): paths = pmb.helpers.repo.apkindex_files(args, arch, alpine=False) for path in paths: logging.info("scan " + path) - index = pmb.parse.apkindex.parse(args, path, False) + index = pmb.parse.apkindex.parse(path, False) for pkgname, apk in index.items(): origin = apk["origin"] # Only increase once! diff --git a/pmb/parse/apkindex.py b/pmb/parse/apkindex.py index 4fc7c2e8..f1f3c005 100644 --- a/pmb/parse/apkindex.py +++ b/pmb/parse/apkindex.py @@ -142,7 +142,7 @@ def parse_add_block(ret, block, alias=None, multiple_providers=True): ret[alias] = block -def parse(args, path, multiple_providers=True): +def parse(path, multiple_providers=True): """ Parse an APKINDEX.tar.gz file, and return its content as dictionary. @@ -293,7 +293,7 @@ def providers(args, package, arch=None, must_exist=True, indexes=None): ret = collections.OrderedDict() for path in indexes: # Skip indexes not providing the package - index_packages = parse(args, path) + index_packages = parse(path) if package not in index_packages: continue diff --git a/test/test_parse_apkindex.py b/test/test_parse_apkindex.py index 7821b94e..fe54fc88 100644 --- a/test/test_parse_apkindex.py +++ b/test/test_parse_apkindex.py @@ -177,7 +177,7 @@ def test_parse_add_block_multiple_providers(args): def test_parse_invalid_path(args): - assert pmb.parse.apkindex.parse(args, "/invalid/path/APKINDEX") == {} + assert pmb.parse.apkindex.parse("/invalid/path/APKINDEX") == {} def test_parse_cached(args, tmpdir): @@ -195,12 +195,12 @@ def test_parse_cached(args, tmpdir): # Verify cache usage func = pmb.parse.apkindex.parse - assert func(args, path, True) == "cached_result_multiple" - assert func(args, path, False) == "cached_result_single" + assert func(path, True) == "cached_result_multiple" + assert func(path, False) == "cached_result_single" # Make cache invalid pmb.helpers.other.cache["apkindex"][path]["lastmod"] -= 10 - assert func(args, path, True) == {} + assert func(path, True) == {} # Delete the cache (run twice for both code paths) assert pmb.parse.apkindex.clear_cache(args, path) is True @@ -233,7 +233,7 @@ def test_parse(args): 'curl': block_curl, 'musl': block_musl, 'so:libc.musl-x86_64.so.1': block_musl} - assert pmb.parse.apkindex.parse(args, path, False) == ret_single + assert pmb.parse.apkindex.parse(path, False) == ret_single assert pmb.helpers.other.cache["apkindex"][path]["single"] == ret_single # Test with multiple_providers @@ -241,7 +241,7 @@ def test_parse(args): 'curl': {"curl": block_curl}, 'musl': {"musl": block_musl}, 'so:libc.musl-x86_64.so.1': {"musl": block_musl}} - assert pmb.parse.apkindex.parse(args, path, True) == ret_multiple + assert pmb.parse.apkindex.parse(path, True) == ret_multiple assert ( pmb.helpers.other.cache["apkindex"][path]["multiple"] == ret_multiple ) @@ -261,7 +261,7 @@ def test_parse_virtual(args): 'timestamp': '1500000000', 'version': '2-r0'} ret = {"hello-world": block, "cmd:hello-world": block} - assert pmb.parse.apkindex.parse(args, path, False) == ret + assert pmb.parse.apkindex.parse(path, False) == ret assert pmb.helpers.other.cache["apkindex"][path]["single"] == ret