From 0024c48d0b421e0f8afe055e04f799207043e631 Mon Sep 17 00:00:00 2001 From: Joel Capitao Date: Wed, 4 Feb 2026 14:54:27 +0100 Subject: [PATCH] build-rootfs: Fix crash when parsing short version strings get_treefile() crashes when parsing versions with fewer than 3 components (e.g., "44"). Now we pad the version parts list with "0" to ensure we always have at least 3 elements. As a follow-up of e6d3ed2. --- build-rootfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-rootfs b/build-rootfs index e811b1fb..e1005759 100755 --- a/build-rootfs +++ b/build-rootfs @@ -74,7 +74,7 @@ def get_treefile(manifest_path, osid, stream, version): with tempfile.NamedTemporaryFile(suffix='.json', mode='w') as tmp_manifest: # Substitute in a few values from build-args into the treefile. ## Split the version to get components for releasever and osversion - (x, y, _) = version.split('.', 2) + (x, y, _) = version.split('.', 2) if '.' in version else (version, '0', '0') osversion = f"{osid}-{x}" if osid == "rhel": # For RHCOS we add the minor to the osversion