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

Confusing “release required” error #375

Open
jtojnar opened this issue Jul 13, 2020 · 9 comments · May be fixed by #376
Open

Confusing “release required” error #375

jtojnar opened this issue Jul 13, 2020 · 9 comments · May be fixed by #376

Comments

@jtojnar
Copy link
Contributor

jtojnar commented Jul 13, 2020

Running appstream-util validate --nonet on https://gitlab.gnome.org/GNOME/buoh/-/blob/7f31a7722b2b1e6fc95c548459cdca033225b59c/data/org.gnome.buoh.appdata.xml.in complains:

• tag-missing           : <release> required

but the <release> tags are there.

@hughsie
Copy link
Owner

hughsie commented Jul 18, 2020

<releases> is the parent for <release> -- i.e. it's not a valid file.

@jtojnar
Copy link
Contributor Author

jtojnar commented Jul 18, 2020

Yes, I discovered that later. The issue is that the error message is not really useful for determining that.

@hughsie
Copy link
Owner

hughsie commented Jul 18, 2020

Pull request welcome dude.

@jtojnar
Copy link
Contributor Author

jtojnar commented Jul 18, 2020

Look like the validator does not work with the XML DOM but AsApp object:

releases = as_app_get_releases (app);
if (require_release && releases->len == 0) {
ai_app_validate_add (helper,
AS_PROBLEM_KIND_TAG_MISSING,
"<release> required");
return TRUE;
}

Not sure how to do that nicely, other than adding a releases_present boolean field to AsAppPrivate and enabling it in the parser when releases is encountered:

if (g_strcmp0 (tmp, "Releases") == 0) {
for (c = n->children; c != NULL; c = c->next) {
g_autoptr(AsRelease) rel = NULL;
rel = as_release_new ();
if (!as_release_node_parse_dep11 (rel, c, ctx, error))
return FALSE;
as_app_add_release (app, rel);
}
continue;
}

@hughsie
Copy link
Owner

hughsie commented Jul 18, 2020

other than adding a releases_present boolean field to AsAppPrivate

I think that's probably fine, thanks.

@jtojnar
Copy link
Contributor Author

jtojnar commented Jul 18, 2020

Looking into it more, maybe the problems field would be more suitable.

@jtojnar jtojnar linked a pull request Jul 18, 2020 that will close this issue
@Newbytee
Copy link

Newbytee commented Mar 31, 2021

I'm having this issue, except I don't have any <releases> nor <release> tags at all. From what I can tell they should be optional: https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#qsr-app-contents-suggestions

What gives?

Here's the XML: https://github.com/Newbytee/mirage/blob/eb35114670699f7f1e29d22a8ff4106a6a361861/packaging/mirage.appdata.xml

@hughsie
Copy link
Owner

hughsie commented Mar 31, 2021

Maybe use validate-relax? Release notes are kinda important...

@CendioOssman
Copy link

Related to #457 perhaps?

I think it is odd that it checks for <url> and <releases> on the same level, as the specification separate those two under "recommended" and "suggested":

https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html

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.

4 participants