diff --git a/pungi/phases/pkgset/common.py b/pungi/phases/pkgset/common.py index 2a4e9393..8fd96962 100644 --- a/pungi/phases/pkgset/common.py +++ b/pungi/phases/pkgset/common.py @@ -138,3 +138,12 @@ def materialize_pkgset(compose, pkgset_global, path_prefix): create_arch_repos(compose, path_prefix) return package_sets + + +def get_all_arches(compose): + all_arches = set(["src"]) + for arch in compose.get_arches(): + is_multilib = is_arch_multilib(compose.conf, arch) + arches = get_valid_arches(arch, is_multilib) + all_arches.update(arches) + return all_arches diff --git a/pungi/phases/pkgset/sources/source_koji.py b/pungi/phases/pkgset/sources/source_koji.py index 2c5f9187..f70c4625 100644 --- a/pungi/phases/pkgset/sources/source_koji.py +++ b/pungi/phases/pkgset/sources/source_koji.py @@ -26,11 +26,11 @@ from kobo.shortcuts import force_list, relative_path import pungi.wrappers.kojiwrapper from pungi.wrappers.comps import CompsWrapper import pungi.phases.pkgset.pkgsets -from pungi.arch import get_valid_arches, getBaseArch -from pungi.util import is_arch_multilib, retry, find_old_compose +from pungi.arch import getBaseArch +from pungi.util import retry, find_old_compose from pungi import Modulemd -from pungi.phases.pkgset.common import materialize_pkgset +from pungi.phases.pkgset.common import materialize_pkgset, get_all_arches from pungi.phases.gather import get_packages_to_gather import pungi.phases.pkgset.source @@ -492,11 +492,7 @@ def _find_old_file_cache_path(compose): def populate_global_pkgset(compose, koji_wrapper, path_prefix, event): - all_arches = set(["src"]) - for arch in compose.get_arches(): - is_multilib = is_arch_multilib(compose.conf, arch) - arches = get_valid_arches(arch, is_multilib) - all_arches.update(arches) + all_arches = get_all_arches(compose) # List of compose tags from which we create this compose compose_tags = [] diff --git a/pungi/phases/pkgset/sources/source_repos.py b/pungi/phases/pkgset/sources/source_repos.py index 5dfbffe8..5cb015f1 100644 --- a/pungi/phases/pkgset/sources/source_repos.py +++ b/pungi/phases/pkgset/sources/source_repos.py @@ -20,11 +20,10 @@ from six.moves import cPickle as pickle from kobo.shortcuts import run import pungi.phases.pkgset.pkgsets -from pungi.arch import get_valid_arches -from pungi.util import makedirs, is_arch_multilib +from pungi.util import makedirs from pungi.wrappers.pungi import PungiWrapper -from pungi.phases.pkgset.common import materialize_pkgset +from pungi.phases.pkgset.common import materialize_pkgset, get_all_arches from pungi.phases.gather import get_prepopulate_packages, get_packages_to_gather from pungi.linker import LinkerPool @@ -119,11 +118,7 @@ def get_pkgset_from_repos(compose): def populate_global_pkgset(compose, file_list, path_prefix): - ALL_ARCHES = set(["src"]) - for arch in compose.get_arches(): - is_multilib = is_arch_multilib(compose.conf, arch) - arches = get_valid_arches(arch, is_multilib) - ALL_ARCHES.update(arches) + ALL_ARCHES = get_all_arches(compose) global_pkgset_path = os.path.join(compose.paths.work.topdir(arch="global"), "packages.pickle")