pmb.helpers.pkgrel_bump.auto_apkindex_files: remove (MR 1912)

Replace the call to this function with the almost identical
pmb.helpers.repo.apkindex_files(), so release channel related changes
only need to be done in one place.
This commit is contained in:
Oliver Smith 2020-04-13 01:16:52 +02:00
parent 3ff0b18a08
commit 5a256f66de
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 24 additions and 34 deletions

View file

@ -1,7 +1,6 @@
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import logging
import os
import pmb.helpers.file
import pmb.helpers.pmaports
@ -44,29 +43,6 @@ def package(args, pkgname, reason="", dry=False):
path)
def auto_apkindex_files(args):
"""
Get the paths to the APKINDEX files, that need to be analyzed, sorted by
arch. Relevant are the local pmbootstrap generated APKINDEX as well as the
APKINDEX from the pmOS binary repo.
:returns: {"armhf": "...../APKINDEX.tar.gz", ...}
"""
pmb.helpers.repo.update(args)
ret = {}
for arch in pmb.config.build_device_architectures:
ret[arch] = []
local = args.work + "/packages/" + arch + "/APKINDEX.tar.gz"
if os.path.exists(local):
ret[arch].append(local)
for mirror in args.mirrors_postmarketos:
path = (args.work + "/cache_apk_" + arch + "/APKINDEX." +
pmb.helpers.repo.hash(mirror) + ".tar.gz")
ret[arch].append(path)
return ret
def auto_apkindex_package(args, arch, aport, apk, dry=False):
"""
Bump the pkgrel of a specific package if it is outdated in the given
@ -127,7 +103,8 @@ def auto(args, dry=False):
:returns: list of aport names, where the pkgrel needed to be changed
"""
ret = []
for arch, paths in auto_apkindex_files(args).items():
for arch in pmb.config.build_device_architectures:
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)