Add function to get all arches in a compose
The same logic is used in two places. This deserves a common function. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
51d638d5db
commit
eeaee1c20f
@ -138,3 +138,12 @@ def materialize_pkgset(compose, pkgset_global, path_prefix):
|
|||||||
create_arch_repos(compose, path_prefix)
|
create_arch_repos(compose, path_prefix)
|
||||||
|
|
||||||
return package_sets
|
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
|
||||||
|
@ -26,11 +26,11 @@ from kobo.shortcuts import force_list, relative_path
|
|||||||
import pungi.wrappers.kojiwrapper
|
import pungi.wrappers.kojiwrapper
|
||||||
from pungi.wrappers.comps import CompsWrapper
|
from pungi.wrappers.comps import CompsWrapper
|
||||||
import pungi.phases.pkgset.pkgsets
|
import pungi.phases.pkgset.pkgsets
|
||||||
from pungi.arch import get_valid_arches, getBaseArch
|
from pungi.arch import getBaseArch
|
||||||
from pungi.util import is_arch_multilib, retry, find_old_compose
|
from pungi.util import retry, find_old_compose
|
||||||
from pungi import Modulemd
|
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
|
from pungi.phases.gather import get_packages_to_gather
|
||||||
|
|
||||||
import pungi.phases.pkgset.source
|
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):
|
def populate_global_pkgset(compose, koji_wrapper, path_prefix, event):
|
||||||
all_arches = set(["src"])
|
all_arches = get_all_arches(compose)
|
||||||
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)
|
|
||||||
|
|
||||||
# List of compose tags from which we create this compose
|
# List of compose tags from which we create this compose
|
||||||
compose_tags = []
|
compose_tags = []
|
||||||
|
@ -20,11 +20,10 @@ from six.moves import cPickle as pickle
|
|||||||
from kobo.shortcuts import run
|
from kobo.shortcuts import run
|
||||||
|
|
||||||
import pungi.phases.pkgset.pkgsets
|
import pungi.phases.pkgset.pkgsets
|
||||||
from pungi.arch import get_valid_arches
|
from pungi.util import makedirs
|
||||||
from pungi.util import makedirs, is_arch_multilib
|
|
||||||
from pungi.wrappers.pungi import PungiWrapper
|
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.phases.gather import get_prepopulate_packages, get_packages_to_gather
|
||||||
from pungi.linker import LinkerPool
|
from pungi.linker import LinkerPool
|
||||||
|
|
||||||
@ -119,11 +118,7 @@ def get_pkgset_from_repos(compose):
|
|||||||
|
|
||||||
|
|
||||||
def populate_global_pkgset(compose, file_list, path_prefix):
|
def populate_global_pkgset(compose, file_list, path_prefix):
|
||||||
ALL_ARCHES = set(["src"])
|
ALL_ARCHES = get_all_arches(compose)
|
||||||
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)
|
|
||||||
|
|
||||||
global_pkgset_path = os.path.join(compose.paths.work.topdir(arch="global"), "packages.pickle")
|
global_pkgset_path = os.path.join(compose.paths.work.topdir(arch="global"), "packages.pickle")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user