mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-12 05:12:32 +00:00
* fix(flatpak): allow release checks and self-update helpers * test: keep Flatpak permission parsing within strict Clippy rules
28 lines
1.0 KiB
Rust
28 lines
1.0 KiB
Rust
//! 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_or_default()
|
|
.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.gridcraft.bundle.yml"),
|
|
include_str!("../../../packaging/linux/flatpak/ai.storyteller.gridcraft.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}");
|
|
}
|
|
}
|
|
}
|