From 1ad97b962844fed233d3409ff21ee540f5d27cfd 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rockcraft_lpci_build/rockcraft_lpci_build.py b/rockcraft_lpci_build/rockcraft_lpci_build.py index 76ef1bb..ab64b19 100755 --- a/rockcraft_lpci_build/rockcraft_lpci_build.py +++ b/rockcraft_lpci_build/rockcraft_lpci_build.py @@ -314,9 +314,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"] - except KeyError: + build_base = self.rockcraft_yaml_raw.get( + "build-base", self.rockcraft_yaml_raw.get("build_base") + ) + + if not build_base: + logging.info(f"No 'build-base' in the rockfile. Using 'base' instead") + logging.info(self.rockcraft_yaml_raw) try: build_base = self.rockcraft_yaml_raw["base"] except KeyError: