From d7ec81a00e75dc302aea953c81c2332214ae3201 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sat, 2 Mar 2019 16:28:39 +0100 Subject: [PATCH] repo.py: fix downloading too many APKINDEX files (!1764) In pmb.helpers.repo.alpine_apkindex_path(), default to arch = args.arch_native *before* calling pmb.helpers.repo.update(). Because otherwise update() defaults to all arches instead of args.arch_native. This caused the APKINDEX files for all arches to get downloaded, as pmb.chroot.apk_static.init() calls alpine_apkindex_path() without setting arch = args.arch_native explicitly. --- pmb/helpers/repo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmb/helpers/repo.py b/pmb/helpers/repo.py index 3c5627e8..3577e1a2 100644 --- a/pmb/helpers/repo.py +++ b/pmb/helpers/repo.py @@ -202,10 +202,10 @@ def alpine_apkindex_path(args, repo="main", arch=None): raise RuntimeError("Invalid Alpine repository: " + repo) # Download the file + arch = arch or args.arch_native update(args, arch) # Find it on disk - arch = arch or args.arch_native repo_link = args.mirror_alpine + args.alpine_version + "/" + repo cache_folder = args.work + "/cache_apk_" + arch return cache_folder + "/APKINDEX." + hash(repo_link) + ".tar.gz"