fix(flatpak): allow release checks and self-update helpers

This commit is contained in:
Dylan M. Taylor
2026-11-11 13:59:22 -05:00
parent d0bb662aa2
commit 24a68f8b5d
3 changed files with 31 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
//! Release and source Flatpaks must allow release checks and host update helpers.
fn finish_args(manifest: &str) -> Vec<&str> {
manifest
.split("finish-args:")
.nth(1)
.unwrap()
.lines()
.take_while(|line| line.is_empty() || line.starts_with(' ') || line.starts_with('#'))
.filter_map(|line| line.trim().strip_prefix("- "))
.map(|arg| arg.trim_matches(['\'', '"']))
.collect()
}
#[test]
fn flatpak_update_permissions() {
let manifests = [
include_str!("../../../packaging/linux/flatpak/ai.storyteller.vectorcraft.bundle.yml"),
include_str!("../../../packaging/linux/flatpak/ai.storyteller.vectorcraft.yml"),
];
let args = manifests.map(finish_args);
assert_eq!(args[0], args[1], "source and release permissions must agree");
for permissions in args {
for required in ["--share=network", "--talk-name=org.freedesktop.Flatpak"] {
assert!(permissions.contains(&required), "missing update permission: {required}");
}
}
}
@@ -17,6 +17,8 @@ runtime-version: '25.08'
sdk: org.freedesktop.Sdk
command: vectorcraft
finish-args:
# The shared updater inspects and updates this installation via flatpak-spawn --host.
- --talk-name=org.freedesktop.Flatpak
- --filesystem=xdg-data/ArtCraft/versions:ro
# X11 shared memory (MIT-SHM). Without it the X11 fallback is slow or fails.
- --share=ipc
@@ -17,6 +17,8 @@ sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
command: vectorcraft
finish-args:
# The shared updater inspects and updates this installation via flatpak-spawn --host.
- --talk-name=org.freedesktop.Flatpak
- --filesystem=xdg-data/ArtCraft/versions:ro
# Keep identical to ai.storyteller.vectorcraft.bundle.yml (the release bundle); comments there.
- --share=ipc