From 0d9f839329ebff6686bd98dfda00d4f2a24b20b4 Mon Sep 17 00:00:00 2001 From: Anas Husseini Date: Wed, 27 Nov 2024 15:25:28 +0200 Subject: [PATCH] fix a bug --- rockcraft/extensions/extension.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rockcraft/extensions/extension.py b/rockcraft/extensions/extension.py index 8e6e65238..d998cc5b1 100644 --- a/rockcraft/extensions/extension.py +++ b/rockcraft/extensions/extension.py @@ -94,10 +94,15 @@ def get_root_snippet_extended(self) -> dict[str, Any]: """Inject chisel as build-snap if needed.""" root_snippet = self.get_root_snippet() if self.is_chisel_needed(): - if root_snippet["parts"][0].get("build-snaps"): - root_snippet["parts"][0]["build-snaps"].append("chisel/latest/stable") + first_part = list(root_snippet["parts"].keys())[0] + if root_snippet["parts"][first_part].get("build-snaps"): + root_snippet["parts"][first_part]["build-snaps"].append( + "chisel/latest/stable" + ) else: - root_snippet["parts"][0]["build-snaps"] = ["chisel/latest/stable"] + root_snippet["parts"][first_part]["build-snaps"] = [ + "chisel/latest/stable" + ] return root_snippet @final