Skip to content

Commit 30a84cf

Browse files
committed
Add reposcan option for variants that should not look at compose
1 parent 5e6427e commit 30a84cf

File tree

4 files changed

+34
-19
lines changed

4 files changed

+34
-19
lines changed

iso/empanadas/empanadas/configs/el9-beta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@
5353
images:
5454
dvd:
5555
disc: True
56+
reposcan: True
5657
variant: 'AppStream'
5758
repos:
5859
- 'BaseOS'
5960
- 'AppStream'
6061
minimal:
6162
disc: True
63+
reposcan: False
6264
isoskip: True
6365
repos:
6466
- 'minimal'

iso/empanadas/empanadas/configs/el9.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,15 @@
5353
images:
5454
dvd:
5555
disc: True
56+
reposcan: True
5657
variant: 'AppStream'
5758
repos:
5859
- 'BaseOS'
5960
- 'AppStream'
6061
minimal:
6162
disc: True
6263
isoskip: True
64+
reposcan: False
6365
repos:
6466
- 'minimal'
6567
- 'BaseOS'

iso/empanadas/empanadas/configs/el9lh.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,15 @@
5353
images:
5454
dvd:
5555
disc: True
56+
reposcan: True
5657
variant: 'AppStream'
5758
repos:
5859
- 'BaseOS'
5960
- 'AppStream'
6061
minimal:
6162
disc: True
6263
isoskip: True
64+
reposcan: False
6365
repos:
6466
- 'minimal'
6567
- 'BaseOS'

iso/empanadas/empanadas/util/iso_utils.py

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -743,9 +743,14 @@ def _extra_iso_build_wrap(self):
743743

744744
for y in images_to_build:
745745
if 'isoskip' in self.iso_map['images'][y] and self.iso_map['images'][y]['isoskip']:
746-
self.log.info(Color.WARN + 'Skipping ' + y + ' image')
746+
self.log.info(Color.WARN + f'Skipping {y} image')
747747
continue
748748

749+
reposcan = True
750+
if 'reposcan' in self.iso_map['images'][y] and not self.iso_map['images'][y]['reposcan']:
751+
self.log.info(Color.WARN + f"Skipping compose repository scans for {y}")
752+
reposcan = False
753+
749754
# Kind of hacky, but if we decide to have more than boot/dvd iso's,
750755
# we need to make sure volname matches the initial lorax image,
751756
# which the volid contains "dvd". AKA, file name doesn't always
@@ -770,6 +775,7 @@ def _extra_iso_build_wrap(self):
770775
a,
771776
y,
772777
self.iso_map['images'][y]['repos'],
778+
reposcan=reposcan
773779
)
774780
self._extra_iso_local_config(a, y, grafts, work_root, volname)
775781

@@ -1091,6 +1097,7 @@ def _generate_graft_points(
10911097
arch,
10921098
iso,
10931099
variants,
1100+
reposcan: bool = True,
10941101
):
10951102
"""
10961103
Get a list of packages for an extras ISO. This should NOT be called
@@ -1120,26 +1127,28 @@ def _generate_graft_points(
11201127
# actually get the boot data
11211128
files = self._get_grafts([lorax_for_var, extra_files_for_var])
11221129

1123-
# This is to get all the packages for each repo
1124-
for repo in variants:
1125-
pkg_for_var = os.path.join(
1126-
self.compose_latest_sync,
1127-
repo,
1128-
arch,
1129-
self.structure['packages']
1130-
)
1131-
rd_for_var = os.path.join(
1132-
self.compose_latest_sync,
1133-
repo,
1134-
arch,
1135-
self.structure['repodata']
1136-
)
1130+
# Some variants cannot go through a proper scan.
1131+
if reposcan:
1132+
# This is to get all the packages for each repo
1133+
for repo in variants:
1134+
pkg_for_var = os.path.join(
1135+
self.compose_latest_sync,
1136+
repo,
1137+
arch,
1138+
self.structure['packages']
1139+
)
1140+
rd_for_var = os.path.join(
1141+
self.compose_latest_sync,
1142+
repo,
1143+
arch,
1144+
self.structure['repodata']
1145+
)
11371146

1138-
for k, v in self._get_grafts([pkg_for_var]).items():
1139-
files[os.path.join(repo, "Packages", k)] = v
1147+
for k, v in self._get_grafts([pkg_for_var]).items():
1148+
files[os.path.join(repo, "Packages", k)] = v
11401149

1141-
for k, v in self._get_grafts([rd_for_var]).items():
1142-
files[os.path.join(repo, "repodata", k)] = v
1150+
for k, v in self._get_grafts([rd_for_var]).items():
1151+
files[os.path.join(repo, "repodata", k)] = v
11431152

11441153
grafts = f'{lorax_base_dir}/{iso}-{arch}-grafts'
11451154

0 commit comments

Comments
 (0)