common-id extractor handles 'description' poorly

Bug #1778545 reported by Harald Sitter on 2018-06-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
High
Sergio Schvezov

Bug Description

appdata.xml contains

```
<description>
<p>foobar</p>
</description>

```

Which is valid as per https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#sect-Metadata-GenericComponent

Snapcraft fails to extract this when using the adopt-info and parse-info feature. Supposedly because appstream.py contains

`description = _get_value_from_xml_element(tree, 'description')`

which would get the description node which renders to an empty string. What it probably needs to do is get the description element and then iterate all children of the description and convert them to the plaintext format expected by snaps.

This defect renders the description/summary extraction broken for just about all KDE appdata files as they all contain at least one paragraph. In fact, this likely affects every single appdata file in existence as paragraph wrapping is necessary for localization as explained in the aforementioned appstream documentation.

Changed in snapcraft:
milestone: none → 3.1
Sergio Schvezov (sergiusens) wrote :

sergiusens: git clone --branch Neon/unstable https://anongit.neon.kde.org/kde/kblocks.git
12:21 sergiusens: depending on what you want to do kbruch.git might be better though as it has no additional deps besides the build-snap. in either case you'll need `export SNAPCRAFT_PARTS_URI=https://metadata.neon.kde.org/snap/parts.yaml` for the remaining remote part
<sergiusens> Sergio Schvezov Thanks sitter
12:24 This for appstream desktop files
12:31 <sitter> Harald Sitter sergiusens: kbruch might be better then, it also has a <ul> in the description ;)

tags: added: 19.04 19.04-blue 19.04-external
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: New → In Progress
importance: Undecided → Wishlist
importance: Wishlist → High
assignee: nobody → Sergio Schvezov (sergiusens)
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers