Bug 1964582 - Add git to distribution part build-packages for snap repackage r=sergesanspaille

Depending on the 'snapcraft' version used by the developper; git may or
may not be installed automatically and this is a bit painful of an
experience. Let's add it ourselves.

Differential Revision: https://phabricator.services.mozilla.com/D247876
This commit is contained in:
Alexandre Lissy
2025-05-06 13:34:40 +00:00
committed by alissy@mozilla.com
parent 59cde4b460
commit 8881c2e5f7

View File

@@ -62,6 +62,7 @@ class SnapcraftTransform:
def repack(self): def repack(self):
removed = self.keep_non_build_parts() removed = self.keep_non_build_parts()
self.add_firefox_repack(removed) self.add_firefox_repack(removed)
self.fix_distribution()
self.change_version(self._version, self._buildno) self.change_version(self._version, self._buildno)
self.change_name(self._appname) self.change_name(self._appname)
return yaml.safe_dump(self.snap, sort_keys=False) return yaml.safe_dump(self.snap, sort_keys=False)
@@ -95,6 +96,11 @@ class SnapcraftTransform:
return removed return removed
def fix_distribution(self):
self.snap["parts"]["distribution"].setdefault("build-packages", []).append(
"git"
)
def add_firefox_repack(self, removed): def add_firefox_repack(self, removed):
repack_yaml = """ repack_yaml = """
firefox: firefox: