After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791861 - [PATCH] AppStream IDs differ between appdata.xml file and Flatpak metadata
[PATCH] AppStream IDs differ between appdata.xml file and Flatpak metadata
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Data
git master
Other Linux
: Normal blocker
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2017-12-22 00:13 UTC by Nate Graham
Modified: 2018-01-14 02:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Two entries for GIMP due to differing AppStream IDs (405.90 KB, image/png)
2017-12-22 00:13 UTC, Nate Graham
  Details
Patch (683 bytes, patch)
2017-12-22 00:15 UTC, Nate Graham
none Details | Review

Description Nate Graham 2017-12-22 00:13:55 UTC
Created attachment 365860 [details]
Two entries for GIMP due to differing AppStream IDs

GIMP's Appstream ID on Flathub is org.gimp.GIMP (https://github.com/flathub/org.gimp.GIMP/blob/master/org.gimp.GIMP.json#L2)

But GIMP's appdata.xml file uses a different AppStream ID: gimp.desktop (https://git.gnome.org/browse/gimp/tree/desktop/gimp.appdata.xml.in#n4)

This causes problems. The point of AppStream IDs is that each App has a unique one; if the same app has different AppStream IDs in different distribution channels, then it'll show up as different apps in clients that can display content from multiple sources, such as GNOME Software Center and KDE Discover. I'm attaching a screenshot of what it looks like in KDE Discover (and it's the same in GNOME Software).

I'm also attaching a trivial patch.
Comment 1 Nate Graham 2017-12-22 00:15:10 UTC
Created attachment 365861 [details] [review]
Patch
Comment 2 Jehan 2017-12-22 01:37:43 UTC
Thanks. I actually had a local patch/stash where I changed this but I decided in the end to hold onto it for now because I actually liked that it had different IDs since that made me 2 choices (depending on whether I install it as flatpak or not) in overview (so I can choose to run one or the other variant), etc.

Actually I think one of the reasons flatpak has the "rename-desktop-file" and "rename-appdata-file" is also to allow for different application ID.

So yes, I knew about:

> if the same app has different AppStream IDs in different distribution channels, then it'll show up as different apps in clients that can display content from multiple sources, such as GNOME Software Center and KDE Discover.

And I am still not sure if I should really consider this as a bug or as a feature.

In any case, if we want to change the app id, I think just changing this one line is not enough. If I remember correctly, in my stash, I was also changing the desktop file name (and more stuff maybe?). Anyway I should check again the spec since I have not been looking at this for a few months now.
I will check. :-)
Comment 3 Nate Graham 2017-12-22 01:48:26 UTC
I'm not married to my little patch. :) Whatever approach you want to take is fine, but appstream IDs are supposed to tied to their apps, no matter the distribution channel. We discussed this recently on the Appstream mailing list: https://lists.freedesktop.org/archives/appstream/2017-December/000203.html

I don't have GNOME software handy right now, but Discover does a good job of showing the user that there are different possible sources for an app when multiple distribution channels contain entries with the same app ID. If GNOME software doesn't have this feature, it definitely should! But regardless of whether we consider this a bug or a feature, IMHO we really should follow the Appstream spec and have a single ID for all the different distribution channels that GIMP appears in.
Comment 4 Jehan 2017-12-22 01:53:06 UTC
Setting as a 2.10 blocker so that I can at least look at the spec and other sources more in detail and make a decision before we release GIMP 2.10.
Thanks for the report and the patch.
Comment 5 Nate Graham 2017-12-22 06:37:43 UTC
Awesome, thanks! Let me know if there's any way I can be of assistance.

Here's the relevant section of the AppStream spec: https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Application.html

In brief: once you change the id tag's value to "org.gimp.GIMP", you'll need to do one of the following to retain the connection between the AppStream data and the desktop file:
- Rename the desktop file to be "org.gimp.GIMP.desktop"
- Add the following line to desktop/gimp.appdata.xml.in "<launchable type="desktop-id">gimp.desktop</launchable>"

[note: not an AppStream expert, take this with a grain of salt, etc]
Comment 6 Nate Graham 2017-12-23 19:19:42 UTC
I've submitted another patch to add release information to your AppStream file: https://bugzilla.gnome.org/show_bug.cgi?id=791900
Comment 7 Jehan 2018-01-14 02:03:24 UTC
I just pushed your patch and added another one. Let's try to go the more conventional way.

By the way, your patch was not git-formatted. How did you create it? Did you just `git diff` it into a file? If so, that explains the problem. I was forced to apply it and recreate a new commit with your authorship.
For info, if you do further patches, you must run `git format-patch origin/master` instead. It will create a file and output a new file name. Just upload this file.

Thanks for being persistent.

commit d39f7d6fbec5c6cef225359fdf9478c0821d9f3f
Author: Nathaniel Graham <pointedstick@zoho.com>
Date:   Sat Jan 13 03:39:50 2018 +0100

    Bug 791861 - Update appdata.xml AppStream ID to match rDNS-style...
    
    ... used for Flatpak.
    
    Additional comments by Jehan after review:
    «
    This is not only to sync with flatpak. This format is the recommended
    format in AppStream spec, even though many historical application still
    use the old format.
    If ever we decide to propose a dbus service, this may even become
    required.
    However just changing this is not enough for a proper ID change. I will
    make additional change in further commits.
    »

 desktop/gimp.appdata.xml.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 54dda25cfcebedd6f2353f95170ebe904eb6906a
Author: Jehan <jehan@girinstud.io>
Date:   Sat Jan 13 04:37:38 2018 +0100

    desktop: update the appdata to take care of the id change.
    
    From AppStream docs:
    «
    In previous AppStream releases, the <id/> was used to associate metainfo
    files with their .desktop files to merge in data from .desktop files
    into the AppStream generator's final output. In modern metainfo files,
    the component-ID for desktop-application components can be an arbitrary
    string (matching the naming rules applying to all AppStream metadata),
    while the <launchable/> tag is used to associate .desktop files with
    their metainfo files.
    »

 desktop/gimp.appdata.xml.in | 9 +++++++++
 1 file changed, 9 insertions(+)