From b8127ad5fb73c993ac8107b5d25bda147f8ed02b Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Jul 22 2025 20:29:34 +0000 Subject: [PATCH 1/3] build_context: update suffix handling of local runtime OCI tarball artifacts are no longer compressed, as their contents already are. This adapts the --local-runtime argument handling to match. This is a follow-up to commit 56f8f7b87f0ab000028ad5a239733cc8f2084df9. --- diff --git a/flatpak_module_tools/build_context.py b/flatpak_module_tools/build_context.py index 68b7a65..76b6f6a 100644 --- a/flatpak_module_tools/build_context.py +++ b/flatpak_module_tools/build_context.py @@ -74,10 +74,12 @@ class BuildContext(ABC): if not self.local_runtime.exists(): raise ClickException(f"{self.local_runtime}: does not exist") - if not self.local_runtime.name.endswith(".tar.gz"): - raise ClickException(f"{self.local_runtime}: does not end with .tar.gz") + # must match local_outname in container_builder.py + local_outname_suffix = ".tar" + if not self.local_runtime.name.endswith(local_outname_suffix): + raise ClickException(f"{self.local_runtime}: does not end with .oci.tar") - base = self.local_runtime.name[0:-7] + base = self.local_runtime.name[0:-len(local_outname_suffix)] result = self.local_runtime.with_name(base + suffix) if not result.exists(): From c643683ef89b22b49aff496eea2812c681e44db6 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Jul 22 2025 20:32:33 +0000 Subject: [PATCH 2/3] flatpak_generator: convert runtime-version to string Some runtimes' versions could be misinterpreted as a float otherwise. --- diff --git a/flatpak_module_tools/flatpak_generator.py b/flatpak_module_tools/flatpak_generator.py index ad0c278..6595ed5 100644 --- a/flatpak_module_tools/flatpak_generator.py +++ b/flatpak_module_tools/flatpak_generator.py @@ -103,7 +103,7 @@ class FlatpakGenerator(str): app_id = manifest['id'] if runtime_name is None: flathub_runtime = manifest['runtime'] - flathub_runtime_version = manifest['runtime-version'] + flathub_runtime_version = str(manifest['runtime-version']) if flathub_runtime == 'org.kde.Platform' and flathub_runtime_version.split('.')[0] == '6': runtime_name = 'flatpak-kde6-runtime' elif flathub_runtime == 'org.kde.Platform' and flathub_runtime_version.split('.')[0] == '5': From bb5c2d449282c235093198009f07955e6d0bdcc4 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Jul 22 2025 21:00:43 +0000 Subject: [PATCH 3/3] container_spec: accept locale-subset extension parameter, false values locale-subset (enabled by default with .Locale extensions) does work with OCI registry images; the entire image is downloaded, but only the selected locale(s) are installed. Also, accept and register 'false' values for any of the boolean parameters of add-extensions. --- diff --git a/flatpak_module_tools/container_spec.py b/flatpak_module_tools/container_spec.py index 8508f5f..4aa4cb9 100644 --- a/flatpak_module_tools/container_spec.py +++ b/flatpak_module_tools/container_spec.py @@ -179,10 +179,12 @@ class ExtensionSpec(BaseSpec): if val: self.args += [f"--extension={extname}={arg}={val}"] # boolean, optional - for arg in ('subdirectories', 'no-autodownload', 'autodelete'): - val = self._get_bool(arg, False) + for arg in ('subdirectories', 'no-autodownload', 'autodelete', 'locale-subset'): + val = self._get_bool(arg, None) if val: self.args += [f"--extension={extname}={arg}=true"] + elif val is not None: + self.args += [f"--extension={extname}={arg}=false"] class ExtraDataSpec(BaseSpec):