From a3d321a0b1e62dd496850f1f459cfa61dbe3f20c Mon Sep 17 00:00:00 2001 From: Cristovao Cordeiro Date: Tue, 9 Apr 2024 10:48:41 +0200 Subject: [PATCH] fix(rockcraft_lpci_build): both build-base and build_base are allowed --- rockcraft_lpci_build/rockcraft_lpci_build.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rockcraft_lpci_build/rockcraft_lpci_build.py b/rockcraft_lpci_build/rockcraft_lpci_build.py index 76ef1bb..a55fe98 100755 --- a/rockcraft_lpci_build/rockcraft_lpci_build.py +++ b/rockcraft_lpci_build/rockcraft_lpci_build.py @@ -315,9 +315,13 @@ def get_rock_archs(self) -> list: def get_rock_build_base(self) -> str: """Infer the Ubuntu series for lpci, from the rockcraft.yaml file""" try: - build_base = self.rockcraft_yaml_raw["build_base"] + build_base = self.rockcraft_yaml_raw.get( + "build-base", self.rockcraft_yaml_raw["build_base"] + ) except KeyError: try: + logging.info(f"No 'build-base' in the rockfile. Using 'base' instead") + logging.info(self.rockcraft_yaml_raw) build_base = self.rockcraft_yaml_raw["base"] except KeyError: logging.exception("%s is missing the 'base' field", self.rockcraft_yaml)