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.
This commit is contained in:
Oliver Smith 2019-03-02 16:28:39 +01:00
parent 008b1761a7
commit d7ec81a00e
1 changed files with 1 additions and 1 deletions

View File

@ -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"