patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob dfc05b17ab633bfefc4a55429d6f8cf5349b6c9e 635 bytes (raw)
name: tools/mount-flatpak/src/metadata.rs 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 
// SPDX-License-Identifier: EUPL-1.2+
// SPDX-FileCopyrightText: 2025 Alyssa Ross <hi@alyssa.is>

use std::fs::File;
use std::io::read_to_string;

use crate::keyfile::parse;

pub fn extract_runtime(mut metadata: File) -> Result<String, String> {
    let metadata = read_to_string(&mut metadata).map_err(|e| e.to_string())?;
    let group = parse(&metadata).map_err(|e| e.to_string())?;
    let application = group
        .get("Application")
        .ok_or_else(|| "Application group missing".to_string())?;
    Ok(application
        .get("runtime")
        .ok_or_else(|| "runtime property missing".to_string())?
        .clone())
}

debug log:

solving dfc05b1 ...
found dfc05b1 in https://inbox.spectrum-os.org/spectrum-devel/20251124194846.16338-1-hi@alyssa.is/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20251127202311.42422-2-hi@alyssa.is/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20251201170458.4186683-7-hi@alyssa.is/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20251201044534.977524-5-hi@alyssa.is/

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20251124194846.16338-1-hi@alyssa.is/
diff --git a/tools/mount-flatpak/src/metadata.rs b/tools/mount-flatpak/src/metadata.rs
new file mode 100644
index 0000000..dfc05b1

Checking patch tools/mount-flatpak/src/metadata.rs...
Applied patch tools/mount-flatpak/src/metadata.rs cleanly.

skipping https://inbox.spectrum-os.org/spectrum-devel/20251127202311.42422-2-hi@alyssa.is/ for dfc05b1
skipping https://inbox.spectrum-os.org/spectrum-devel/20251201170458.4186683-7-hi@alyssa.is/ for dfc05b1
skipping https://inbox.spectrum-os.org/spectrum-devel/20251201044534.977524-5-hi@alyssa.is/ for dfc05b1
index at:
100644 dfc05b17ab633bfefc4a55429d6f8cf5349b6c9e	tools/mount-flatpak/src/metadata.rs

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).