worker.sh: read AppStream metainfo under its current name (*.metainfo.xml) too - #3874
Open
budbrain-software wants to merge 1 commit into
Open
worker.sh: read AppStream metainfo under its current name (*.metainfo.xml) too#3874budbrain-software wants to merge 1 commit into
budbrain-software wants to merge 1 commit into
Conversation
Both *.appdata.xml and *.metainfo.xml are copied in, but only *appdata.xml was ever read, so applications shipping the current name lost their description and screenshot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
code/worker.shcopies in both AppStream file names (lines 385-391):but it only ever reads
*appdata.xml:*.metainfo.xmlis the name the AppStream specification asks for today, so anyapplication using it silently falls back to the
.desktopComment=for thedescription and to the automatically taken screenshot — even though its metainfo
file was shipped, copied in, and is perfectly readable.
That it is readable is easy to show: the license block right between those two
ifs already handles both names via*.{appdata,metainfo}.xml, and the licensefrom such a file does end up in the catalogue entry. Only description and
screenshot are lost.
Change
One variable, used by both blocks, preferring
*.appdata.xmlwhen anapplication ships both:
AS_XML=$(ls database/$INPUTBASENAME/*.appdata.xml database/$INPUTBASENAME/*.metainfo.xml 2>/dev/null | head -n 1)As a side effect this also removes two
[ -f <glob> ]tests, which fail with"too many arguments" when an AppDir ships more than one matching file.
Tested
*.metainfo.xml*.appdata.xmlappdata.xmlpreferred (unchanged)With a real AppImage shipping only
de.budbrain.jsPicPuzzler.metainfo.xml, thetwo XPath expressions now return
Jigsaw puzzles from forty photographs, in six sizesand the screenshot URL fromthe metainfo, instead of nothing.