app: let's also check the appstream in the legacy location as fallback.

For some reason, our flatpak is moving the appstream file elsewhere,
after installation (since all our scripts explicitly install it under
metainfo/).

So in flatpak, it is in /app/share/appdata/ (i.e. $DATADIR/appdata/).

This is not right and should not be done by the flatpak system, but
let's still verify this other location as it is legacy so it would not
be totally impossible that some distributions do something similar when
packaging GIMP.

See also: https://github.com/flatpak/flatpak/issues/4775
This commit is contained in:
Jehan 2022-02-23 20:51:46 +01:00
parent aaafa8683d
commit eb9b936d23
1 changed files with 16 additions and 0 deletions

View File

@ -92,6 +92,22 @@ welcome_dialog_create (Gimp *gimp)
appdata_path = g_build_filename (DESKTOP_DATADIR, "metainfo",
"org.gimp.GIMP.appdata.xml",
NULL);
if (! g_file_test (appdata_path, G_FILE_TEST_IS_REGULAR))
{
/* This should not happen since we install explicitly this file in
* metainfo/, but flatpak at least is overriding our install and
* moving the file to appdata/ (which used to be the legacy
* location). Hopefully they are the only ones doing it, but just
* in case, let's make an alternative check in this other
* location.
*/
g_printerr ("%s: AppStream file '%s' is not a regular file.\n",
G_STRFUNC, appdata_path);
g_free (appdata_path);
appdata_path = g_build_filename (DESKTOP_DATADIR, "appdata",
"org.gimp.GIMP.appdata.xml",
NULL);
}
if (g_file_test (appdata_path, G_FILE_TEST_IS_REGULAR))
{
AsRelease *release;