Skip to content

Commit

Permalink
Add reposcan option for variants that should not look at compose
Browse files Browse the repository at this point in the history
  • Loading branch information
nazunalika committed Oct 1, 2024
1 parent 5e6427e commit 30a84cf
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 19 deletions.
2 changes: 2 additions & 0 deletions iso/empanadas/empanadas/configs/el9-beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@
images:
dvd:
disc: True
reposcan: True
variant: 'AppStream'
repos:
- 'BaseOS'
- 'AppStream'
minimal:
disc: True
reposcan: False
isoskip: True
repos:
- 'minimal'
Expand Down
2 changes: 2 additions & 0 deletions iso/empanadas/empanadas/configs/el9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@
images:
dvd:
disc: True
reposcan: True
variant: 'AppStream'
repos:
- 'BaseOS'
- 'AppStream'
minimal:
disc: True
isoskip: True
reposcan: False
repos:
- 'minimal'
- 'BaseOS'
Expand Down
2 changes: 2 additions & 0 deletions iso/empanadas/empanadas/configs/el9lh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@
images:
dvd:
disc: True
reposcan: True
variant: 'AppStream'
repos:
- 'BaseOS'
- 'AppStream'
minimal:
disc: True
isoskip: True
reposcan: False
repos:
- 'minimal'
- 'BaseOS'
Expand Down
47 changes: 28 additions & 19 deletions iso/empanadas/empanadas/util/iso_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,14 @@ def _extra_iso_build_wrap(self):

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
Expand All @@ -770,6 +775,7 @@ def _extra_iso_build_wrap(self):
a,
y,
self.iso_map['images'][y]['repos'],
reposcan=reposcan
)
self._extra_iso_local_config(a, y, grafts, work_root, volname)

Expand Down Expand Up @@ -1091,6 +1097,7 @@ def _generate_graft_points(
arch,
iso,
variants,
reposcan: bool = True,
):
"""
Get a list of packages for an extras ISO. This should NOT be called
Expand Down Expand Up @@ -1120,26 +1127,28 @@ def _generate_graft_points(
# 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'

Expand Down

0 comments on commit 30a84cf

Please sign in to comment.