Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppStream metadata needs to be updated #59220

Closed
2 tasks done
sebastic opened this issue Oct 25, 2024 · 7 comments · Fixed by #59769
Closed
2 tasks done

AppStream metadata needs to be updated #59220

sebastic opened this issue Oct 25, 2024 · 7 comments · Fixed by #59769
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@sebastic
Copy link
Contributor

sebastic commented Oct 25, 2024

What is the bug or the crash?

The lintian QA tool reported an issue validating the AppStream metadata using appstreamcli validate-tree.

Issues in question:

org.qgis.qgis.appdata.xml
  I: org.qgis.qgis.desktop:5: developer-name-tag-deprecated
  W: org.qgis.qgis.desktop:8: screenshot-image-not-found
       https://qgis.org/en/_static/images/about-screenshot.png - URL was not found on the
       server.
  W: org.qgis.qgis.desktop:7: screenshot-default-missing
  E: org.qgis.qgis.desktop:106: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:108: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:110: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:112: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:114: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:116: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:118: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:120: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:122: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:124: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:126: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:128: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:130: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:132: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:134: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:136: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:138: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:140: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:142: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:144: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:146: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:148: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:150: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:152: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:154: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:156: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:158: metainfo-localized-description-tag description
  E: org.qgis.qgis.desktop:160: metainfo-localized-description-tag description
  I: org.qgis.qgis.desktop:~: developer-info-missing

? Validation failed: errors: 28, warnings: 2, infos: 2, pedantic: 1

This patch resolves some of the issues:

--- a/linux/org.qgis.qgis.appdata.xml.in
+++ b/linux/org.qgis.qgis.appdata.xml.in
@@ -2,11 +2,10 @@
 <component type="desktop">
   <id>org.qgis.qgis.desktop</id>
   <name>QGIS Desktop</name>
-  <developer_name>QGIS Development Team</developer_name>
+  <developer id="org.qgis">
+    <name>QGIS Development Team</name>
+  </developer>
   <summary>A Free and Open Source Geographic Information System</summary>
-  <screenshots>
-    <screenshot><image type="source">https://qgis.org/en/_static/images/about-screenshot.png</image></screenshot>
-  </screenshots>
   <description><p>QGIS is a user friendly Open Source Geographic Information System (GIS) licensed under the GNU General Public License. QGIS is an official project of the Open Source Geospatial Foundation (OSGeo). It runs on Linux, Unix, Mac OSX, Windows and Android and supports numerous vector, raster, and database formats and functionalities.</p></description>
 
   <metadata_license>CC-BY-3.0</metadata_license>

The screenshot is removed because the new website doesn't seem to offer an alternative.

The paragraphs in the description tag must be translated to resolve metainfo-localized-description-tag error.

In MetaInfo files, this tag should be translated by-paragraph. For enumerations, items are translated individually as well, and not the whole enumeration block. This means that in a translated file, only <p/> and <li/> elements may carry an xml:lang property.

https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description

scripts/ts2appinfo.py will need to be updated to insert <p xml:lang="eo"> elements after the existing untranslated <p> element within the description element. This also requires changing all the translations to not include &lt;p&gt; and &lt;/p&gt; in the source and translation messages.

This patch can be used in the mean time to not included the erroneous <description xml:lang="eo"> elements:

--- a/scripts/ts2appinfo.py
+++ b/scripts/ts2appinfo.py
@@ -29,7 +29,7 @@ strings = {}
 d = et.parse('linux/org.qgis.qgis.appdata.xml.in')
 
 r = d.getroot()
-for elem in ['name', 'summary', 'description']:
+for elem in ['name', 'summary']:
     for c in r.iter(elem):
         if not c.attrib:
             l = list(c)
@@ -68,7 +68,7 @@ for qm in sorted(glob(sys.argv[1] + "/ou
             continue
         strings[s][lang] = translation
 
-for elem in ['name', 'summary', 'description']:
+for elem in ['name', 'summary']:
     for c in r.iter(elem):
         if c.attrib:
             continue

Steps to reproduce the issue

  1. Build qgis Debian package:
    dpkg-buildpackage -us -uc
    
  2. Unpack qgis binary package:
    dpkg-deb -R ../qgis_$(dpkg-parsechangelog -SVersion)_amd64.deb /tmp/qgis
    
  3. Run AppStream validation:
    appstreamcli validate-tree /tmp/qgis
    

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
QGIS version 3.34.11-Prizren QGIS code branch Release 3.34
Qt version 5.15.13
Python version 3.12.7
GDAL/OGR version 3.9.3
PROJ version 9.5.0
EPSG Registry database version v11.016 (2024-08-31)
GEOS version 3.13.0-CAPI-1.19.0
SQLite version 3.46.1
PostgreSQL client version 17.0 (Debian 17.0-1+b2)
SpatiaLite version 5.1.0
QWT version 6.1.4
QScintilla2 version 2.14.1
OS version Debian GNU/Linux trixie/sid
       
Active Python plugins
quick_map_services 0.19.34
grassprovider 2.12.99
processing 2.12.99
db_manager 0.1.20
MetaSearch 0.3.6
QGIS version 3.34.11-Prizren QGIS code branch [Release 3.34](https://github.com/qgis/QGIS/tree/release-3_34) Qt version 5.15.13 Python version 3.12.7 GDAL/OGR version 3.9.3 PROJ version 9.5.0 EPSG Registry database version v11.016 (2024-08-31) GEOS version 3.13.0-CAPI-1.19.0 SQLite version 3.46.1 PostgreSQL client version 17.0 (Debian 17.0-1+b2) SpatiaLite version 5.1.0 QWT version 6.1.4 QScintilla2 version 2.14.1 OS version Debian GNU/Linux trixie/sid

Active Python plugins
quick_map_services
0.19.34
grassprovider
2.12.99
processing
2.12.99
db_manager
0.1.20
MetaSearch
0.3.6

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@sebastic sebastic added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Oct 25, 2024
@m-kuhn
Copy link
Member

m-kuhn commented Oct 25, 2024

Thanks @sebastic do you directly want to open a pull request?

@sebastic
Copy link
Contributor Author

Thanks @sebastic do you directly want to open a pull request?

No, because my patch is incomplete. Someone familiar with the translation infrastructure needs to make the changes for the AppStream description.

@sebastic
Copy link
Contributor Author

sebastic commented Dec 3, 2024

I sat down to also fix the description translations:

https://salsa.debian.org/debian-gis-team/qgis/-/raw/6650da3deb866ed2df797efc46963b2a7a75ce9c/debian/patches/appstream.patch

Due to changes on master it doesn't apply.

@aleixpol
Copy link
Contributor

aleixpol commented Dec 6, 2024

Can you please provide a Pull Request?

@sebastic
Copy link
Contributor Author

sebastic commented Dec 6, 2024

That patch only applies to 3.34, will someone else forward port it to 3.40 after I submit a PR for the 3.34 branch?

@sebastic
Copy link
Contributor Author

sebastic commented Dec 6, 2024

PRs available for 3.34/3.40/master since I don't expect anyone to adapt my patch for the other branches.

@sebastic
Copy link
Contributor Author

@m-kuhn, what's the blocker for also merging #59770?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants