Menu

#264 Legacy AppStream metadata format

v6.5.0
closed
nobody
None
1
2018-08-16
2018-08-14
No

SAGA still installs the AppStream metadata in the legacy format:

/usr/share/appdata/saga.appdata.xml

Please update the format for the current specification (0.12):

https://www.freedesktop.org/software/appstream/docs/

And install the metadata in the non-legacy path:

/usr/share/metainfo/org.saga-gis.saga-gui.metainfo.xml

Discussion

  • Volker Wichmann

    Volker Wichmann - 2018-08-14

    Hi Bas,

    thanks for the hint, I will have a look!

    Best regards,
    Volker

     
  • Volker Wichmann

    Volker Wichmann - 2018-08-15

    I've just comitted an update, please see

    https://sourceforge.net/p/saga-gis/code/ci/42dbd92e0f45a44ae5a55e79da523061691bdab0/

    ... keeping this open until you confirm everything is as expected, thanks!

     
  • Bas Couwenberg

    Bas Couwenberg - 2018-08-15

    The file fails to validate:

    $ appstream-util validate src/saga_core/saga_gui/res/org.saga-gis.saga-gui.metainfo.xml 
    src/saga_core/saga_gui/res/org.saga-gis.saga-gui.metainfo.xml: failed to parse src/saga_core/saga_gui/res/org.saga-gis.saga-gui.metainfo.xml: Error on line 32 char 14: Element 'releases' was closed, but the currently open element is 'release'
    

    The fix is trivial:

      <releases>
        <release version="6.5.0"/>
      </releases>
    

    The file still fails to valid then:

    Regular validation

    $ appstream-util validate src/saga_core/saga_gui/res/org.saga-gis.saga-gui.metainfo.xml 
    src/saga_core/saga_gui/res/org.saga-gis.saga-gui.metainfo.xml: FAILED:
    • attribute-invalid     : <component> has invalid type attribute
    • style-invalid         : <caption> cannot end in '.' [The FooBar main window.] attribute-missing     : <release> has no timestamp
    Validation of files failed
    

    Relaxed validation

    $ appstream-util validate-relax src/saga_core/saga_gui/res/org.saga-gis.saga-gui.metainfo.xml 
    src/saga_core/saga_gui/res/org.saga-gis.saga-gui.metainfo.xml: FAILED:
    • attribute-invalid     : <component> has invalid type attribute
    Validation of files failed
    

    Strict validation

    $ appstream-util validate-strict src/saga_core/saga_gui/res/org.saga-gis.saga-gui.metainfo.xml 
    src/saga_core/saga_gui/res/org.saga-gis.saga-gui.metainfo.xml: FAILED:
     attribute-invalid     : <component> has invalid type attribute
     value-missing         : <!-- Copyright [year] [name] --> is not present
     tag-invalid           : <updatecontact> should be <update_contact>
     style-invalid         : <caption> cannot end in '.' [The FooBar main window.]
     attribute-missing     : <release> has no timestamp
     translations-required  : <name> has no translations
     translations-required  : <summary> has no translations
     translations-required  : <description> has no translations
    Validation of files failed
    

    This is with appstream-util 0.7.10 on Debian unstable.

     
  • Bas Couwenberg

    Bas Couwenberg - 2018-08-15

    For the relaxed validation it's sufficient to add the type attribute:

    <component type="desktop">
    

    The caption fix is also trivial:

          <caption>The FooBar main window</caption>
    

    Fixing the release tag is more involved, because the 6.5.0 release is not out yet, and hence no date is known. Perhaps that section should be left out, as it's not required.

    Because saga-gui is not a generic component, but a desktop application, my initial mention of metainfo filename is wrong, it should be:

    /usr/share/metainfo/org.saga-gis.saga-gui.appdata.xml

    Per: https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Application.html

     
  • Bas Couwenberg

    Bas Couwenberg - 2018-08-16

    Thanks for the update, unfortunately it still fails to validate:

    $ appstream-util validate src/saga_core/saga_gui/res/org.saga-gis.saga-gui.appdata.xml 
    src/saga_core/saga_gui/res/org.saga-gis.saga-gui.appdata.xml: FAILED:
    • attribute-invalid     : <component> has invalid type attribute
    • tag-missing           : <translation> not specified
    Validation of files failed
    

    I don't understand the attribute-invalid issue, type="desktop" should be valid for compatibility with older AppStream, but even when changed to type="desktop-application" it fails to validate in the same way.

    I've started a new package build to see if the issues lintian reported about the legacy appstream file are resolved now.

     
  • Bas Couwenberg

    Bas Couwenberg - 2018-08-16

    The lintian issue are resolved now.

     
  • Bas Couwenberg

    Bas Couwenberg - 2018-08-16

    The fix for the component is to remove the attribute from the id:

      <id>org.saga_gis.saga.desktop</id>
    
    $ appstream-util validate src/saga_core/saga_gui/res/org.saga-gis.saga-gui.appdata.xml 
    src/saga_core/saga_gui/res/org.saga-gis.saga-gui.appdata.xml: FAILED:
    • tag-missing           : <translation> not specified
    Validation of files failed
    
    $ appstream-util validate-relax src/saga_core/saga_gui/res/org.saga-gis.saga-gui.appdata.xml 
    src/saga_core/saga_gui/res/org.saga-gis.saga-gui.appdata.xml: OK
    
    $ appstream-util validate-strict src/saga_core/saga_gui/res/org.saga-gis.saga-gui.appdata.xml 
    src/saga_core/saga_gui/res/org.saga-gis.saga-gui.appdata.xml: FAILED:
    • tag-missing           : <translation> not specified
    • translations-required  : <name> has no translations
    • translations-required  : <summary> has no translations
    • translations-required  : <description> has no translations
    Validation of files failed
    

    Adding translations would als fix strict validation.

     
  • Volker Wichmann

    Volker Wichmann - 2018-08-16

    Thanks, I've committed a fix for the id:

    https://sourceforge.net/p/saga-gis/code/ci/de7f1d450af2ac5a078466499297a8efb5165104/

    I don't understand why translation is required, the spec states that the tag is optional. I could easly add the tag, but would I use as "type"? It seems that currently only "gettext" and "qt" are valid. But SAGA comes with its own translation system. It is also not clear to me with what "foobar" in the example is expected to get exchanged:

    <translation type="gettext">foobar</translation>
    

    Do you have an idea how this is supposed to work? Otherwise I would suggest to keep it out and be ok with the relaxed validation.

     
  • Bas Couwenberg

    Bas Couwenberg - 2018-08-16

    Since none of the supported translations are used for Saga those tags can be left out. Relaxed validation passes now, which is good enough for me.

     
  • Volker Wichmann

    Volker Wichmann - 2018-08-16
    • status: open --> closed
     
  • Volker Wichmann

    Volker Wichmann - 2018-08-16

    Ok, fine - thanks again for the help!

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB