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

Error reporting of 'appstream-util validate' is too vague. #459

Open
van-de-bugger opened this issue Oct 1, 2022 · 4 comments
Open

Error reporting of 'appstream-util validate' is too vague. #459

van-de-bugger opened this issue Oct 1, 2022 · 4 comments

Comments

@van-de-bugger
Copy link

$ appstream-util --version
Version:	0.8.0

$ appstream-util validate ./io.sourceforge.kbd-tapper.metainfo.xml 
./io.sourceforge.kbd-tapper.metainfo.xml: FAILED:
• tag-invalid           : Expected children for tag
Validation of files failed

Ok, a tag in my metainfo file is invalid. But could appstream-validate give me a little hint which one? Either line number or at least invalid tag name would be appreciated.

The wrong metainfo file is attached. I have to replace .xml suffix with .txt in order to upload the file: github does not allow to upload xml files.

io.sourceforge.kbd-tapper.metainfo.txt

@ximion
Copy link
Collaborator

ximion commented Oct 2, 2022

Using appstream-glib for this is no longer ideal, because it does not validate a lot of new concepts used in AppStream today.
Validating with appstreamcli instead gives you:

~$ appstreamcli validate io.sourceforge.kbd-tapper.metainfo.xml
W: io.sourceforge.kbd-tapper:25: tag-empty requires
E: io.sourceforge.kbd-tapper:26: tag-invalid-text-content recommends
I: io.sourceforge.kbd-tapper:3: cid-contains-hyphen io.sourceforge.kbd-tapper

✘ Validation failed: errors: 1, warnings: 1, infos: 1

So, your requires tag in line 25 is empty, and your recommends tag in line 26 is invalid (see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-relations for how this should look like).

@van-de-bugger
Copy link
Author

Using appstream-glib for this is no longer ideal, because it does not validate a lot of new concepts used in AppStream today.

Thanks for replacement, but it does not solve the issue. Is appstream-util still maintained or completely abandoned? I see no reason why it doesn't print the warning like this one:

$ appstream-util validate ./io.sourceforge.kbd-tapper.metainfo.xml 
Warning: 'appstream-util validate' is outdated, use 'appstreamcli' instead.
...

@ximion
Copy link
Collaborator

ximion commented Oct 2, 2022

Is appstream-util still maintained or completely abandoned?

I think @hughsie would call it "deep maintenance mode" ;-) - no major new features, but bugfixes are still applied and releases made.
Appstream-glib is a separate project from AppStream itself, I'm not sure if it should print a warning like this... (would certainly not be a decision that I should make, as I am very biased and not the project's maintainer).

How does using the newer tool not solve the issue? As far as I can see, it tells you exactly what you want to know...

@van-de-bugger
Copy link
Author

van-de-bugger commented Oct 2, 2022

How does using the newer tool not solve the issue? As far as I can see, it tells you exactly what you want to know...

Your suggestion solves my problem. But it does not solve the problem the ticket is about: "Error reporting of 'appstream-util validate' is too vague." I understand appstream-util is in "deep maintenance mode", but I think it is good idea to inform users about it.

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

No branches or pull requests

2 participants