adopt-info not finding desktop files

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

Bug Description

Version: 2.43.1+18.04

the adopt-info based on appstream isn't working as intended.

the method `_desktop_file_id_to_path` in appstream.py fails to actually resolve the desktop file paths because the working directory is wrong.

I've added

```
        print(desktop_file_path)
        print(os.getcwd())
```

which results in

```
usr/share/applications/org.kde.kblocks.desktop
/home/me/src/git/kblocks
```

this is of course wrong as the working directory should be inside the part's directory `/home/me/src/git/kblocks/parts/kblocks/install/` or thereabout. Or the desktop_file_path relative path would need adjusting to contain the relevant prefix.

This results in `extract` actually not coming back with any desktop files being detected and rendering the automatic desktop file detection from the build state entirely broken.

ADDITIONALLY

The very same problem appears in the `_adopt_keys` method at snapping time, where the working directory is also the actual working directory of snapcraft while the desktop_file_path (which as I understand is basically what `_desktop_file_id_to_path` returned) would also be relative to "root". So it too fails a path check for exactly the same reason.

Changed in snapcraft:
milestone: none → 3.1
assignee: nobody → Sergio Schvezov (sergiusens)
importance: Undecided → High
status: New → Triaged
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

tags: added: 19.04 19.04-blue 19.04-external
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: Triaged → In Progress
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