From 4b7b091d44b4d434c959ee84da8d3d0f531931dc Mon Sep 17 00:00:00 2001 From: Haiqing Bai Date: Mon, 8 Apr 2024 15:16:09 +0800 Subject: [PATCH] debrepack: Fixed debver inconsistent issue When python yaml module loads meta_data.yaml into a dict with 'yaml.full_load', it discards trailing zeros in the 'debver' that has two digits before the decimal point, and followed by a trailing zero after the decimal point. For example, if the 'debver' in meta_data.yaml is '23.10', the version in debrepack is '23.1' which will cause build failure. Test Plan: Pass: The fix should not impact the normal build build-pkgs -a Pass: Add new package 'mlnx-ofed-kernel_23.10' with 'debver' in meta_data.yaml is '23.10': build-pkgs -c -p mlnx-ofed-kernel Closes-bug: 2060436 Change-Id: I33042f1d15440e72ad8a4b33061390f7dbb9bb64 Signed-off-by: Haiqing Bai [Cherry pick from https://review.opendev.org/c/starlingx/root/+/915251] Signed-off-by: Jiping Ma --- build-tools/stx/debrepack.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-tools/stx/debrepack.py b/build-tools/stx/debrepack.py index 524b38d0..7733de5e 100755 --- a/build-tools/stx/debrepack.py +++ b/build-tools/stx/debrepack.py @@ -237,6 +237,8 @@ class Parser(): if "debver" not in self.meta_data: self.logger.error("No debver defined in meta_data.yaml") raise Exception("No debver defined in meta_data.yaml") + self.meta_data['debver'] = str(self.meta_data['debver']).rstrip("@") + self.logger.info("debver in meta_data %s" % self.meta_data["debver"]) if "debname" in self.meta_data: self.pkginfo["debname"] = self.meta_data["debname"]