• Bug#1077784: media-player-info: Incorrect component type in Appstream m

    From Petter Reinholdtsen@21:1/5 to All on Fri Aug 2 07:50:01 2024
    Package: media-player-info
    Verion: 25-1
    Tags: patch
    User: pere@hungry.com
    Usertags: appstream-modalias

    The Appstream validation report the following problem with the metadata
    I submitted in BTS #1076991.

    Errors

    * gui-app-without-icon
    The component is a GUI application (application which has a .desktop
    file for the XDG menu and Type=Application), but we could not find a
    matching icon for this application.

    Warnings

    * asv-desktop-app-launchable-missing
    org.freedesktop.media_player_info.metainfo.xml -
    This `desktop-application` component is missing a `desktop-id`
    launchable tag. This means that this application can not be launched
    and has no association with its desktop-entry file. It also means no
    icon data or category information from the desktop-entry file will
    be available, which will result in this application being ignored
    entirely.
    * missing-launchable-desktop-file
    The MetaInfo file references a .desktop file with ID
    'org.freedesktop.media_player_info.desktop' in its launchable tag,
    but the file was not found in the same source tree. In order to be
    able to launch the software once it was installed, please place the
    MetaInfo file and its .desktop files in the same package.

    I am very sorry about this. These block the metadata from being
    included in the published database. The metadata got the incorrect
    component (cut-n-paste error on my part), and should look like this
    instead:

    --- media-player-info-25.orig/tools/mpi2appstream.py
    +++ media-player-info-25/tools/mpi2appstream.py
    @@ -48,7 +48,7 @@ for f in sys.argv[1:]:
    parse_mpi(f, modaliases)

    print("""<?xml version="1.0" encoding="UTF-8"?>
    -<component type="desktop">
    +<component>
    <id>org.freedesktop.media_player_info</id>
    <metadata_license>MIT</metadata_license>
    <name>media-player-info</name>

    With the correct type, the file validates:

    % appstreamcli validate-tree --no-net --explain debian/media-player-info
    org.freedesktop.media_player_info.metainfo.xml
    I: org.freedesktop.media_player_info:~: developer-info-missing
    This component contains no `developer` element with information
    about its author.


    ? Validation was successful: infos: 1, pedantic: 1
    %

    --
    Happy hacking
    Petter Reinholdtsen

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Pitt@21:1/5 to All on Sat Aug 3 09:10:01 2024
    Control: tag -1 upstream fixed-upstream pending

    Hello Petter,

    Petter Reinholdtsen [2024-08-02 7:40 +0200]:
    The Appstream validation report the following problem with the metadata
    I submitted in BTS #1076991.

    Errors

    * gui-app-without-icon
    [...]

    I did that when I committed that upstream:

    | ❱❱❱ appstream-util -v validate org.freedesktop.media_player_info.metainfo.xml
    | org.freedesktop.media_player_info.metainfo.xml: FAILED:
    | • tag-missing : <content_rating> required [use https://odrs.gnome.org/oars]
    | • tag-missing : <release> required
    | Validation of files failed

    but that looks completely different. Even with "validate-strict" it doesn't pick up the erroneous type="desktop". I'd like to add that to "make check"; but both errors are "meh", so I skipped it.

    % appstreamcli validate-tree --no-net --explain debian/media-player-info
    org.freedesktop.media_player_info.metainfo.xml

    Thanks for that magic command! It puts up quite a fight [1]. However, there's `appstreamcli validate` which is much more useful.

    https://gitlab.freedesktop.org/media-player-info/media-player-info/-/commit/1833b2061eda0a3c443e2c97c5b3a77a74452e4a
    https://gitlab.freedesktop.org/media-player-info/media-player-info/-/commit/38ef219e37e579128d71e8af5adf07ef2480936e

    I'll do a new release/Debian upload now.

    Martin


    [1] when I try to run this in an upstream tree:

    appstreamcli validate-tree --no-net --explain .
    appstreamcli validate-tree --no-net --explain . org.freedesktop.media_player_info.metainfo.xml
    make install DESTDIR=/tmp/i
    appstreamcli validate-tree --no-net --explain /tmp/i/ org.freedesktop.media_player_info.metainfo.xml

    They all fail with "No AppStream metadata was found in this directory or directory tree."

    And --help is not really helpful, the positional args aren't documented at all. `strace` shows that it only looks into /tmp/i/usr/share/metainfo, not /tmp/i/usr/local/share/metainfo. That feels like an outright bug to me. It also doesn't react to $XDG_DATA_DIRS.

    This works:

    mkdir -p usr/share
    ln -s ../.. usr/share/metainfo
    appstreamcli validate-tree --no-net --explain . org.freedesktop.media_player_info.metainfo.xml

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)