Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML firmware code doesn't match documentation. #326

Closed
robert-ancell opened this issue Jun 10, 2021 · 5 comments · Fixed by #328
Closed

YAML firmware code doesn't match documentation. #326

robert-ancell opened this issue Jun 10, 2021 · 5 comments · Fixed by #328

Comments

@robert-ancell
Copy link
Contributor

In the firmware documentation it states that runtime firmware has a file, and flashed firmware has a GUID.

In as_component_yaml_emit_provides() the following code seems to have this reversed:

if (fw_runtime != NULL) {
        for (i = 0; i < fw_runtime->len; i++) {
                const gchar *value = g_ptr_array_index (fw_runtime, i);
                as_yaml_mapping_start (emitter);
                        as_yaml_emit_entry (emitter, "type", "runtime");
                as_yaml_emit_entry (emitter, "guid", value);
                        as_yaml_mapping_end (emitter);
        }       
}

if (fw_flashed != NULL) {
        for (i = 0; i < fw_flashed->len; i++) {
                const gchar *value = g_ptr_array_index (fw_flashed, i);
                as_yaml_mapping_start (emitter);
                        as_yaml_emit_entry (emitter, "type", "flashed");
                as_yaml_emit_entry (emitter, "file", value);
                        as_yaml_mapping_end (emitter);
        }
}

Is the YAML code wrong?

@robert-ancell
Copy link
Contributor Author

@hughsie probably knows this best.

@hughsie
Copy link
Collaborator

hughsie commented Jun 10, 2021

The docs are correct and the code is wrong.

@robert-ancell
Copy link
Contributor Author

Thanks @hughsie, should be fixed in #328.

@robert-ancell
Copy link
Contributor Author

Seems the XML is also wrong for flashed firmware - #329

@ximion
Copy link
Owner

ximion commented Jun 13, 2021

Good catch!
The thing is, even though I don't want it to be this way, the YAML variant of AppStream is very much a second-class citizen and underdocumented and also lacking a few tests & features.
It primarily exists because early on, the Debian FTP masters refused to have XML in the archive but did accept YAML, and since programs were to consume AppStream data exclusively through an AppStream database according to the old projects's drafts or the libappstream library respectively, I did think just implementing the YAML variant was the way of least resistance to improve AppStream adoption - then appstream-glib came along and we dropped the database, and things got a lot more complicated and much larger than I ever thought ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants