Skip to content

Commit ead860f

Browse files
committed
Fix null minor version bug
Red Hat includes the minor version for Rocky 10 advisories meaning we need to include the minor version in our repo config tables for Rocky 10. Red Hat 8 and 9 don't seem to include the minor version so our config should also NOT contain minor versions. This allows for generation to correctly NOT include minor versions.
1 parent c6c9983 commit ead860f

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

scripts/generate_rocky_config.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -730,12 +730,21 @@ def generate_rocky_config(
730730
continue
731731

732732
# Skip if version filter specified and doesn't match
733-
if (
734-
version
735-
and metadata["version"] != version
736-
and metadata["version"] != UNKNOWN_VALUE
737-
):
738-
continue
733+
# Support matching major version only (e.g., "9" matches "9.6")
734+
if version and metadata["version"] != UNKNOWN_VALUE:
735+
version_matches = False
736+
737+
# If filter version has no minor (e.g., "9"), match by major version only
738+
if "." not in version:
739+
# Extract major version from metadata version
740+
metadata_major = metadata["version"].split(".")[0] if "." in metadata["version"] else metadata["version"]
741+
version_matches = (metadata_major == version)
742+
else:
743+
# Exact match required for full versions (e.g., "9.6")
744+
version_matches = (metadata["version"] == version)
745+
746+
if not version_matches:
747+
continue
739748

740749
# Skip debug repos if not wanted
741750
if not include_debug and metadata["repo_type"] == "debug":

0 commit comments

Comments
 (0)