From 30a84cfed5037bf73fc58f8a8613b49ad40f7b86 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Tue, 1 Oct 2024 13:56:56 -0700 Subject: [PATCH] Add reposcan option for variants that should not look at compose --- iso/empanadas/empanadas/configs/el9-beta.yaml | 2 + iso/empanadas/empanadas/configs/el9.yaml | 2 + iso/empanadas/empanadas/configs/el9lh.yaml | 2 + iso/empanadas/empanadas/util/iso_utils.py | 47 +++++++++++-------- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/iso/empanadas/empanadas/configs/el9-beta.yaml b/iso/empanadas/empanadas/configs/el9-beta.yaml index a88db8c..4862d87 100644 --- a/iso/empanadas/empanadas/configs/el9-beta.yaml +++ b/iso/empanadas/empanadas/configs/el9-beta.yaml @@ -53,12 +53,14 @@ images: dvd: disc: True + reposcan: True variant: 'AppStream' repos: - 'BaseOS' - 'AppStream' minimal: disc: True + reposcan: False isoskip: True repos: - 'minimal' diff --git a/iso/empanadas/empanadas/configs/el9.yaml b/iso/empanadas/empanadas/configs/el9.yaml index c005bac..ebc502b 100644 --- a/iso/empanadas/empanadas/configs/el9.yaml +++ b/iso/empanadas/empanadas/configs/el9.yaml @@ -53,6 +53,7 @@ images: dvd: disc: True + reposcan: True variant: 'AppStream' repos: - 'BaseOS' @@ -60,6 +61,7 @@ minimal: disc: True isoskip: True + reposcan: False repos: - 'minimal' - 'BaseOS' diff --git a/iso/empanadas/empanadas/configs/el9lh.yaml b/iso/empanadas/empanadas/configs/el9lh.yaml index d087d0c..b97c627 100644 --- a/iso/empanadas/empanadas/configs/el9lh.yaml +++ b/iso/empanadas/empanadas/configs/el9lh.yaml @@ -53,6 +53,7 @@ images: dvd: disc: True + reposcan: True variant: 'AppStream' repos: - 'BaseOS' @@ -60,6 +61,7 @@ minimal: disc: True isoskip: True + reposcan: False repos: - 'minimal' - 'BaseOS' diff --git a/iso/empanadas/empanadas/util/iso_utils.py b/iso/empanadas/empanadas/util/iso_utils.py index cb48331..ce50035 100644 --- a/iso/empanadas/empanadas/util/iso_utils.py +++ b/iso/empanadas/empanadas/util/iso_utils.py @@ -743,9 +743,14 @@ class IsoBuild: for y in images_to_build: if 'isoskip' in self.iso_map['images'][y] and self.iso_map['images'][y]['isoskip']: - self.log.info(Color.WARN + 'Skipping ' + y + ' image') + self.log.info(Color.WARN + f'Skipping {y} image') continue + reposcan = True + if 'reposcan' in self.iso_map['images'][y] and not self.iso_map['images'][y]['reposcan']: + self.log.info(Color.WARN + f"Skipping compose repository scans for {y}") + reposcan = False + # Kind of hacky, but if we decide to have more than boot/dvd iso's, # we need to make sure volname matches the initial lorax image, # which the volid contains "dvd". AKA, file name doesn't always @@ -770,6 +775,7 @@ class IsoBuild: a, y, self.iso_map['images'][y]['repos'], + reposcan=reposcan ) self._extra_iso_local_config(a, y, grafts, work_root, volname) @@ -1091,6 +1097,7 @@ class IsoBuild: arch, iso, variants, + reposcan: bool = True, ): """ Get a list of packages for an extras ISO. This should NOT be called @@ -1120,26 +1127,28 @@ class IsoBuild: # actually get the boot data files = self._get_grafts([lorax_for_var, extra_files_for_var]) - # This is to get all the packages for each repo - for repo in variants: - pkg_for_var = os.path.join( - self.compose_latest_sync, - repo, - arch, - self.structure['packages'] - ) - rd_for_var = os.path.join( - self.compose_latest_sync, - repo, - arch, - self.structure['repodata'] - ) + # Some variants cannot go through a proper scan. + if reposcan: + # This is to get all the packages for each repo + for repo in variants: + pkg_for_var = os.path.join( + self.compose_latest_sync, + repo, + arch, + self.structure['packages'] + ) + rd_for_var = os.path.join( + self.compose_latest_sync, + repo, + arch, + self.structure['repodata'] + ) - for k, v in self._get_grafts([pkg_for_var]).items(): - files[os.path.join(repo, "Packages", k)] = v + for k, v in self._get_grafts([pkg_for_var]).items(): + files[os.path.join(repo, "Packages", k)] = v - for k, v in self._get_grafts([rd_for_var]).items(): - files[os.path.join(repo, "repodata", k)] = v + for k, v in self._get_grafts([rd_for_var]).items(): + files[os.path.join(repo, "repodata", k)] = v grafts = f'{lorax_base_dir}/{iso}-{arch}-grafts'