Skip to content

Commit

Permalink
Ensure the generated flathub:: values is compliant
Browse files Browse the repository at this point in the history
According to the spec, <metadata> is not a thing. <custom> is the
correct one.

https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-custom

Fixes flathub/flathub#4917
  • Loading branch information
aleixpol authored and barthalion committed Feb 6, 2024
1 parent 0bccbbb commit f84f9af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cmd_publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,14 @@ pub fn rewrite_appstream_xml(

let mut set_value = |key: &str, value: Option<&str>| {
if let Some(value) = value {
let custom = find_or_create_element(component, "custom", None);
find_or_create_element(custom, "value", Some(("key", key))).set_text(value);

// the <metadata> element isn't compliant with appstream
// leaving for backwards compatibility with older GNOME Software releases
let metadata = find_or_create_element(component, "metadata", None);
find_or_create_element(metadata, "value", Some(("key", key))).set_text(value);

changed = true;
}
};
Expand Down

0 comments on commit f84f9af

Please sign in to comment.