Hello community,

here is the log from the commit of package appstream-glib for openSUSE:Factory 
checked in at 2016-07-01 09:57:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/appstream-glib (Old)
 and      /work/SRC/openSUSE:Factory/.appstream-glib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "appstream-glib"

Changes:
--------
--- /work/SRC/openSUSE:Factory/appstream-glib/appstream-glib.changes    
2016-05-23 17:31:34.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.appstream-glib.new/appstream-glib.changes       
2016-07-01 09:57:15.000000000 +0200
@@ -1,0 +2,22 @@
+Tue Jun 14 09:37:28 UTC 2016 - [email protected]
+
+- Update to version 0.5.16:
+  + Add yast2-branding-openSUSE if an app depends on yast2.
+  + trivial: post release version bump.
+  + Fix g_ptr_array_sort use.
+  + Do not rename a category ID in AsApp.
+  + Never allow NULL to be added to AsApp string array.
+  + Allow setting the id prefix and origin using a symlink file
+    name.
+  + trivial: Do not load Flatpak repos when searching.
+  + Correctly detect new AppStream applications in new directories.
+  + Add elementary to list of project groups.
+  + trivial: Fix make distcheck.
+  + trivial: Fix several issues to ensure changed signal are sent.
+  + Load metainfo files if present.
+  + Release version 0.5.16.
+- Drop
+  0001-Add-yast2-branding-openSUSE-if-an-app-depends-on-yas.patch:
+  fixed upstream.
+
+-------------------------------------------------------------------
@@ -43,0 +66,10 @@
+Thu May 19 19:40:59 CEST 2016 - [email protected]
+
+- Update to GNOME 3.20.2 (FATE#318572).
+
+-------------------------------------------------------------------
+Tue May  3 23:47:22 UTC 2016 - [email protected]
+
+- Update to GNOME 3.20  Fate#318572
+
+-------------------------------------------------------------------
@@ -77 +109 @@
---------------------------------------------------------------------
+-------------------------------------------------------------------

Old:
----
  0001-Add-yast2-branding-openSUSE-if-an-app-depends-on-yas.patch
  appstream-glib-0.5.15.tar.xz

New:
----
  appstream-glib-0.5.16.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ appstream-glib.spec ++++++
--- /var/tmp/diff_new_pack.IIjUmi/_old  2016-07-01 09:57:16.000000000 +0200
+++ /var/tmp/diff_new_pack.IIjUmi/_new  2016-07-01 09:57:16.000000000 +0200
@@ -20,7 +20,7 @@
 %define _build_from_vcs 1
 
 Name:           appstream-glib
-Version:        0.5.15
+Version:        0.5.16
 Release:        0
 Summary:        AppStream Abstraction Library
 License:        LGPL-2.1+
@@ -29,8 +29,6 @@
 #Source:         
http://people.freedesktop.org/~hughsient/appstream-glib/releases/%{name}-%{version}.tar.xz
 Source0:        %{name}-%{version}.tar.xz
 Source1:        openSUSE-appstream-process
-# PATCH-FEATURE-OPENSUSE 
0001-Add-yast2-branding-openSUSE-if-an-app-depends-on-yas.patch 
[email protected] -- Add yast2-branding-openSUSE if an app depends on yast2
-Patch0:         0001-Add-yast2-branding-openSUSE-if-an-app-depends-on-yas.patch
 %if %{_build_from_vcs}
 BuildRequires:  gnome-common
 %else
@@ -167,7 +165,6 @@
 
 %prep
 %setup -q
-%patch0 -p1
 
 %build
 %if %{_build_from_vcs}

++++++ _service ++++++
--- /var/tmp/diff_new_pack.IIjUmi/_old  2016-07-01 09:57:16.000000000 +0200
+++ /var/tmp/diff_new_pack.IIjUmi/_new  2016-07-01 09:57:16.000000000 +0200
@@ -2,9 +2,9 @@
   <service name="tar_scm" mode="disabled">
     <param name="url">https://github.com/hughsie/appstream-glib.git</param>
     <param name="scm">git</param>
-    <param name="versionformat">0.5.15</param>
+    <param name="versionformat">0.5.16</param>
     <param name="changesgenerate">enable</param>
-    <param name="revision">refs/tags/appstream_glib_0_5_15</param>
+    <param name="revision">refs/tags/appstream_glib_0_5_16</param>
   </service>
   <service name="recompress" mode="disabled">
     <param name="file">*.tar</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.IIjUmi/_old  2016-07-01 09:57:16.000000000 +0200
+++ /var/tmp/diff_new_pack.IIjUmi/_new  2016-07-01 09:57:16.000000000 +0200
@@ -1,4 +1,4 @@
 <servicedata>
 <service name="tar_scm">
             <param 
name="url">https://github.com/hughsie/appstream-glib.git</param>
-          <param 
name="changesrevision">164491a6b552e2473fab4658933d0495dec98e44</param></service></servicedata>
\ No newline at end of file
+          <param 
name="changesrevision">dc5963fd88b49324b8b4579bbe9199a1a6336f54</param></service></servicedata>
\ No newline at end of file

++++++ appstream-glib-0.5.15.tar.xz -> appstream-glib-0.5.16.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/NEWS 
new/appstream-glib-0.5.16/NEWS
--- old/appstream-glib-0.5.15/NEWS      2016-05-23 13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/NEWS      2016-06-14 11:37:28.000000000 +0200
@@ -1,3 +1,19 @@
+Version 0.5.16
+~~~~~~~~~~~~~~
+Released: 2016-06-13
+
+New Features:
+ - Add elementary to list of project groups (Fabio Valentini)
+ - Allow setting the id prefix and origin using a symlink name (Richard Hughes)
+
+Bugfixes:
+ - Add yast2-branding-openSUSE if an app depends on yast2 (Dominique 
Leuenberger)
+ - Correctly detect new AppStream apps in new directories (Richard Hughes)
+ - Do not rename a category ID in AsApp (Richard Hughes)
+ - Fix g_ptr_array_sort use (Kalev Lember)
+ - Load metainfo files if present (Richard Hughes)
+ - Never allow NULL to be added to AsApp string array (Richard Hughes)
+
 Version 0.5.15
 ~~~~~~~~~~~~~~
 Released: 2016-05-23
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/RELEASE 
new/appstream-glib-0.5.16/RELEASE
--- old/appstream-glib-0.5.15/RELEASE   2016-05-23 13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/RELEASE   2016-06-14 11:37:28.000000000 +0200
@@ -2,10 +2,10 @@
 
 1. Write NEWS entries for appstream_glib in the same format as usual.
 
-git shortlog appstream_glib_0_5_14.. | grep -i -v trivial | grep -v Merge > 
NEWS.new
+git shortlog appstream_glib_0_5_15.. | grep -i -v trivial | grep -v Merge > 
NEWS.new
 
 
--------------------------------------------------------------------------------
-Version 0.5.15
+Version 0.5.16
 ~~~~~~~~~~~~~~
 Released: 2016-xx-xx
 
@@ -29,8 +29,8 @@
 
 4. Commit changes in git:
 
-git commit -a -m "Release version 0.5.15"
-git tag -s -f -m "Release 0.5.15" appstream_glib_0_5_15
+git commit -a -m "Release version 0.5.16"
+git tag -s -f -m "Release 0.5.16" appstream_glib_0_5_16
 <gpg password>
 git push --tags
 git push
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/client/as-compose.c 
new/appstream-glib-0.5.16/client/as-compose.c
--- old/appstream-glib-0.5.15/client/as-compose.c       2016-05-23 
13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/client/as-compose.c       2016-06-14 
11:37:28.000000000 +0200
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
  *
- * Copyright (C) 2014-2015 Richard Hughes <[email protected]>
+ * Copyright (C) 2014-2016 Richard Hughes <[email protected]>
  * Copyright (C) 2016 Alexander Larsson <[email protected]>
  *
  * Licensed under the GNU General Public License Version 2
@@ -261,9 +261,18 @@
                                        NULL);
        appdata_path = g_build_filename (prefix,
                                         "share",
-                                        "appdata",
+                                        "metainfo",
                                         appdata_basename,
                                         NULL);
+       /* fall back to the legacy path */
+       if (!g_file_test (appdata_path, G_FILE_TEST_EXISTS)) {
+               g_free (appdata_path);
+               appdata_path = g_build_filename (prefix,
+                                                "share",
+                                                "appdata",
+                                                appdata_basename,
+                                                NULL);
+       }
        g_debug ("Looking for %s", appdata_path);
 
        app = as_app_new ();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/client/as-util.c 
new/appstream-glib-0.5.16/client/as-util.c
--- old/appstream-glib-0.5.15/client/as-util.c  2016-05-23 13:50:12.000000000 
+0200
+++ new/appstream-glib-0.5.16/client/as-util.c  2016-06-14 11:37:28.000000000 
+0200
@@ -1212,13 +1212,6 @@
                                    NULL, error)) {
                        return FALSE;
                }
-       } else if (g_strcmp0 (values[0], "flatpak") == 0) {
-               if (!as_store_load (store,
-                                   AS_STORE_LOAD_FLAG_IGNORE_INVALID |
-                                   AS_STORE_LOAD_FLAG_FLATPAK_SYSTEM,
-                                   NULL, error)) {
-                       return FALSE;
-               }
        } else {
                for (i = 0; values[i] != NULL; i++) {
                        if (!as_util_add_file_to_store (store, values[i], 
error))
@@ -1278,8 +1271,6 @@
                            AS_STORE_LOAD_FLAG_APP_INFO_SYSTEM |
                            AS_STORE_LOAD_FLAG_APP_INFO_USER |
                            AS_STORE_LOAD_FLAG_APPDATA |
-                           AS_STORE_LOAD_FLAG_FLATPAK_USER |
-                           AS_STORE_LOAD_FLAG_FLATPAK_SYSTEM |
                            AS_STORE_LOAD_FLAG_DESKTOP,
                            NULL, error))
                return FALSE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/configure.ac 
new/appstream-glib-0.5.16/configure.ac
--- old/appstream-glib-0.5.15/configure.ac      2016-05-23 13:50:12.000000000 
+0200
+++ new/appstream-glib-0.5.16/configure.ac      2016-06-14 11:37:28.000000000 
+0200
@@ -2,7 +2,7 @@
 
 m4_define([as_major_version], [0])
 m4_define([as_minor_version], [5])
-m4_define([as_micro_version], [15])
+m4_define([as_micro_version], [16])
 m4_define([as_version],
           [as_major_version.as_minor_version.as_micro_version])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/data/appstream-compose.xml 
new/appstream-glib-0.5.16/data/appstream-compose.xml
--- old/appstream-glib-0.5.15/data/appstream-compose.xml        2016-05-23 
13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/data/appstream-compose.xml        2016-06-14 
11:37:28.000000000 +0200
@@ -13,7 +13,7 @@
       <email>[email protected]</email>
     </author>
     <copyright>
-      <year>2013-2014</year>
+      <year>2013-2016</year>
       <holder>Richard Hughes</holder>
     </copyright>
   </refentryinfo>
@@ -44,8 +44,8 @@
     <para>
       <command>appstream-compose</command> is a simple app that takes a
       prefix (default /usr) and a set of application names.
-      It looks for appdata, desktop and icon files with that
-      basename in $prefix/share/[appdata|applications|icons] and generates
+      It looks for appdata, metainfo, desktop and icon files with that
+      basename in $prefix/share/[appdata|metainfo|applications|icons] and 
generates
       appstream xml files and icons in (by default) $prefix/share/app-info.
     </para>
   </refsect1>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/data/tests/Makefile.am 
new/appstream-glib-0.5.16/data/tests/Makefile.am
--- old/appstream-glib-0.5.15/data/tests/Makefile.am    2016-05-23 
13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/data/tests/Makefile.am    2016-06-14 
11:37:28.000000000 +0200
@@ -8,6 +8,7 @@
        app-1-1.fc21.x86_64.rpm                         \
        app-console-1-1.fc21.noarch.rpm                 \
        app-extra-1-1.fc21.noarch.rpm                   \
+       appstream.xml                                   \
        asb-self-test.xml.gz                            \
        broken.appdata.xml                              \
        broken.metainfo.xml                             \
@@ -26,6 +27,7 @@
        firmware/2_0_2/firmware.bin                     \
        firmware/2_0_2/firmware.inf                     \
        firmware/2_0_2/firmware.metainfo.xml            \
+       flatpak_remote-name.xml                         \
        font-1-1.fc21.noarch.rpm                        \
        font-serif-1-1.fc21.noarch.rpm                  \
        intltool.appdata.xml.in                         \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/data/tests/appstream.xml 
new/appstream-glib-0.5.16/data/tests/appstream.xml
--- old/appstream-glib-0.5.15/data/tests/appstream.xml  1970-01-01 
01:00:00.000000000 +0100
+++ new/appstream-glib-0.5.16/data/tests/appstream.xml  2016-06-14 
11:37:28.000000000 +0200
@@ -0,0 +1,5 @@
+<components origin="flatpak">
+<component type="desktop">
+<id>test.desktop</id>
+</component>
+</components>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/appstream-glib-0.5.15/data/tests/flatpak_remote-name.xml 
new/appstream-glib-0.5.16/data/tests/flatpak_remote-name.xml
--- old/appstream-glib-0.5.15/data/tests/flatpak_remote-name.xml        
1970-01-01 01:00:00.000000000 +0100
+++ new/appstream-glib-0.5.16/data/tests/flatpak_remote-name.xml        
2016-07-01 09:57:16.000000000 +0200
@@ -0,0 +1 @@
+symbolic link to appstream.xml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/appstream-glib-0.5.15/libappstream-builder/asb-task.c 
new/appstream-glib-0.5.16/libappstream-builder/asb-task.c
--- old/appstream-glib-0.5.15/libappstream-builder/asb-task.c   2016-05-23 
13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/libappstream-builder/asb-task.c   2016-06-14 
11:37:28.000000000 +0200
@@ -196,6 +196,15 @@
                                             GINT_TO_POINTER (1));
                        g_ptr_array_add (icon_themes,
                                         g_strdup ("oxygen-icon-theme"));
+               /* Applications depending on yast2 have an implicit dependency
+                * on yast2-branding-openSUSE, which brings required icons in 
this case.
+                */
+               } else if (g_strcmp0 (tmp, "yast2-branding-openSUSE") == 0 ||
+                          g_strcmp0 (tmp, "yast2") == 0) {
+                       g_hash_table_insert (hash, g_strdup 
("yast2-branding-openSUSE"),
+                                            GINT_TO_POINTER (1));
+                       g_ptr_array_add (icon_themes,
+                                        g_strdup ("yast2-branding-openSUSE"));
                } else {
                        g_ptr_array_add (array, g_strdup (tmp));
                }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/appstream-glib-0.5.15/libappstream-builder/asb-utils.c 
new/appstream-glib-0.5.16/libappstream-builder/asb-utils.c
--- old/appstream-glib-0.5.15/libappstream-builder/asb-utils.c  2016-05-23 
13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/libappstream-builder/asb-utils.c  2016-06-14 
11:37:28.000000000 +0200
@@ -508,6 +508,12 @@
        return TRUE;
 }
 
+static gint
+my_pstrcmp (const gchar **a, const gchar **b)
+{
+       return g_strcmp0 (*a, *b);
+}
+
 /**
  * asb_utils_write_archive_dir:
  * @filename: archive filename
@@ -535,7 +541,7 @@
                return TRUE;
 
        /* sort by filename for deterministic results */
-       g_ptr_array_sort (files, g_strcmp0);
+       g_ptr_array_sort (files, (GCompareFunc) my_pstrcmp);
 
        /* write tar file */
        return asb_utils_write_archive (filename, directory, files, error);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/libappstream-glib/as-app.c 
new/appstream-glib-0.5.16/libappstream-glib/as-app.c
--- old/appstream-glib-0.5.15/libappstream-glib/as-app.c        2016-05-23 
13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/libappstream-glib/as-app.c        2016-06-14 
11:37:28.000000000 +0200
@@ -2179,6 +2179,8 @@
 {
        AsAppPrivate *priv = GET_PRIVATE (app);
 
+       g_return_if_fail (category != NULL);
+
        /* handle untrusted */
        if ((priv->trust_flags & AS_APP_TRUST_FLAG_CHECK_VALID_UTF8) > 0 &&
            !as_app_validate_utf8 (category)) {
@@ -2190,10 +2192,6 @@
                return;
        }
 
-       /* simple substitution */
-       if (g_strcmp0 (category, "Feed") == 0)
-               category = "News";
-
        /* split this meta-category up */
        if (g_strcmp0 (category, "AudioVideo") == 0) {
                as_app_add_category (app, "Audio");
@@ -2218,6 +2216,8 @@
 {
        AsAppPrivate *priv = GET_PRIVATE (app);
 
+       g_return_if_fail (compulsory_for_desktop != NULL);
+
        /* handle untrusted */
        if ((priv->trust_flags & AS_APP_TRUST_FLAG_CHECK_VALID_UTF8) > 0 &&
            !as_app_validate_utf8 (compulsory_for_desktop)) {
@@ -2253,6 +2253,8 @@
        GPtrArray *tmp;
        g_autofree gchar *tmp_locale = NULL;
 
+       g_return_if_fail (keyword != NULL);
+
        /* handle untrusted */
        if ((priv->trust_flags & AS_APP_TRUST_FLAG_CHECK_VALID_UTF8) > 0 &&
            !as_app_validate_utf8 (keyword)) {
@@ -2290,6 +2292,8 @@
 {
        AsAppPrivate *priv = GET_PRIVATE (app);
 
+       g_return_if_fail (kudo != NULL);
+
        /* handle untrusted */
        if ((priv->trust_flags & AS_APP_TRUST_FLAG_CHECK_VALID_UTF8) > 0 &&
            !as_app_validate_utf8 (kudo)) {
@@ -2316,6 +2320,8 @@
 {
        AsAppPrivate *priv = GET_PRIVATE (app);
 
+       g_return_if_fail (permission != NULL);
+
        /* handle untrusted */
        if ((priv->trust_flags & AS_APP_TRUST_FLAG_CHECK_VALID_UTF8) > 0 &&
            !as_app_validate_utf8 (permission)) {
@@ -2357,6 +2363,8 @@
 {
        AsAppPrivate *priv = GET_PRIVATE (app);
 
+       g_return_if_fail (mimetype != NULL);
+
        /* handle untrusted */
        if ((priv->trust_flags & AS_APP_TRUST_FLAG_CHECK_VALID_UTF8) > 0 &&
            !as_app_validate_utf8 (mimetype)) {
@@ -2700,6 +2708,8 @@
 {
        AsAppPrivate *priv = GET_PRIVATE (app);
 
+       g_return_if_fail (pkgname != NULL);
+
        /* handle untrusted */
        if ((priv->trust_flags & AS_APP_TRUST_FLAG_CHECK_VALID_UTF8) > 0 &&
            !as_app_validate_utf8 (pkgname)) {
@@ -2728,6 +2738,8 @@
 {
        AsAppPrivate *priv = GET_PRIVATE (app);
 
+       g_return_if_fail (arch != NULL);
+
        /* handle untrusted */
        if ((priv->trust_flags & AS_APP_TRUST_FLAG_CHECK_VALID_UTF8) > 0 &&
            !as_app_validate_utf8 (arch)) {
@@ -4749,6 +4761,7 @@
                const gchar *project_group;
                const gchar *url_glob;
        } table[] = {
+               { "elementary",         "http*://elementary.io*" },
                { "Enlightenment",      "http://*enlightenment.org*"; },
                { "GNOME",              "http*://*.gnome.org*" },
                { "GNOME",              "http://gnome-*.sourceforge.net/"; },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/appstream-glib-0.5.15/libappstream-glib/as-environment-ids.txt 
new/appstream-glib-0.5.16/libappstream-glib/as-environment-ids.txt
--- old/appstream-glib-0.5.15/libappstream-glib/as-environment-ids.txt  
2016-05-23 13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/libappstream-glib/as-environment-ids.txt  
2016-06-14 11:37:28.000000000 +0200
@@ -10,3 +10,4 @@
 XFCE
 EDE
 Cinnamon
+elementary
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/appstream-glib-0.5.15/libappstream-glib/as-self-test.c 
new/appstream-glib-0.5.16/libappstream-glib/as-self-test.c
--- old/appstream-glib-0.5.15/libappstream-glib/as-self-test.c  2016-05-23 
13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/libappstream-glib/as-self-test.c  2016-06-14 
11:37:28.000000000 +0200
@@ -2921,6 +2921,49 @@
                         "flatpak-user:org.gnome.Software.desktop");
 }
 
+/* load a store with a origin and scope encoded in the symlink name */
+static void
+as_test_store_flatpak_func (void)
+{
+       AsApp *app;
+       GError *error = NULL;
+       GPtrArray *apps;
+       gboolean ret;
+       g_autofree gchar *filename = NULL;
+       g_autofree gchar *filename_root = NULL;
+       g_autoptr(AsStore) store = NULL;
+       g_autoptr(GFile) file = NULL;
+
+       /* make throws us under a bus, yet again */
+       g_setenv ("AS_SELF_TEST_PREFIX_DELIM", "_", TRUE);
+
+       /* load a symlinked file to the store */
+       store = as_store_new ();
+       filename_root = as_test_get_filename (".");
+       filename = g_build_filename (filename_root, "flatpak_remote-name.xml", 
NULL);
+       if (!g_file_test (filename, G_FILE_TEST_IS_SYMLINK)) {
+               g_debug ("not doing symlink test in distcheck as regular file");
+               return;
+       }
+       file = g_file_new_for_path (filename);
+       ret = as_store_from_file (store, file, NULL, NULL, &error);
+       g_assert_no_error (error);
+       g_assert (ret);
+
+       /* test extraction of symlink data */
+       g_assert_cmpstr (as_store_get_origin (store), ==, "flatpak");
+       g_assert_cmpint (as_store_get_size (store), ==, 1);
+       apps = as_store_get_apps (store);
+       g_assert_cmpint (apps->len, ==, 1);
+       app = g_ptr_array_index (apps, 0);
+       g_assert_cmpstr (as_app_get_id (app), ==, "flatpak:test.desktop");
+       g_assert_cmpstr (as_app_get_origin (app), ==, "flatpak_remote-name");
+       g_assert_cmpstr (as_app_get_source_file (app), ==, filename);
+
+       /* back to normality */
+       g_unsetenv ("AS_SELF_TEST_PREFIX_DELIM");
+}
+
 /* demote the .desktop "application" to an addon */
 static void
 as_test_store_demote_func (void)
@@ -4871,6 +4914,7 @@
                g_test_add_func ("/AppStream/store{auto-reload-dir}", 
as_test_store_auto_reload_dir_func);
                g_test_add_func ("/AppStream/store{auto-reload-file}", 
as_test_store_auto_reload_file_func);
        }
+       g_test_add_func ("/AppStream/store{flatpak}", 
as_test_store_flatpak_func);
        g_test_add_func ("/AppStream/store{prefix}", as_test_store_prefix_func);
        g_test_add_func ("/AppStream/store{demote}", as_test_store_demote_func);
        g_test_add_func ("/AppStream/store{cab}", as_test_store_cab_func);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/libappstream-glib/as-store.c 
new/appstream-glib-0.5.16/libappstream-glib/as-store.c
--- old/appstream-glib-0.5.15/libappstream-glib/as-store.c      2016-05-23 
13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/libappstream-glib/as-store.c      2016-06-14 
11:37:28.000000000 +0200
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
  *
- * Copyright (C) 2013-2014 Richard Hughes <[email protected]>
+ * Copyright (C) 2013-2016 Richard Hughes <[email protected]>
  *
  * Licensed under the GNU Lesser General Public License Version 2.1
  *
@@ -1030,14 +1030,22 @@
        AsNode *apps;
        AsNode *n;
        const gchar *tmp;
+       const gchar *origin_delim = ":";
+       gchar *str;
        g_autofree AsNodeContext *ctx = NULL;
        g_autofree gchar *icon_path = NULL;
+       g_autofree gchar *id_prefix_app = NULL;
        g_autofree gchar *origin_app = NULL;
        _cleanup_uninhibit_ guint32 *tok = NULL;
        g_autoptr(AsProfileTask) ptask = NULL;
 
        g_return_val_if_fail (AS_IS_STORE (store), FALSE);
 
+       /* make throws us under a bus, yet again */
+       tmp = g_getenv ("AS_SELF_TEST_PREFIX_DELIM");
+       if (tmp != NULL)
+               origin_delim = tmp;
+
        /* profile */
        ptask = as_profile_start_literal (priv->profile, 
"AsStore:store-from-root");
 
@@ -1067,14 +1075,64 @@
        if (tmp != NULL)
                as_store_set_origin (store, tmp);
 
-       /* special case flatpak */
-       if (source_filename != NULL &&
-           as_bundle_kind_from_string (priv->origin) == 
AS_BUNDLE_KIND_FLATPAK) {
+       /* origin has prefix already specified in the XML */
+       if (priv->origin != NULL) {
+               str = g_strstr_len (priv->origin, -1, origin_delim);
+               if (str != NULL) {
+                       id_prefix_app = g_strdup (priv->origin);
+                       str = g_strstr_len (id_prefix_app, -1, origin_delim);
+                       if (str != NULL) {
+                               str[0] = '\0';
+                               origin_app = g_strdup (str + 1);
+                       }
+               }
+       }
+
+       /* special case flatpak symlinks -- scope:name.xml.gz */
+       if (origin_app == NULL &&
+           g_strcmp0 (priv->origin, "flatpak") == 0 &&
+           source_filename != NULL &&
+           g_file_test (source_filename, G_FILE_TEST_IS_SYMLINK)) {
+               g_autofree gchar *source_basename = NULL;
+
+               /* get the origin */
+               source_basename = g_path_get_basename (source_filename);
+               str = g_strrstr (source_basename, ".xml");
+               if (str != NULL) {
+                       str[0] = '\0';
+                       origin_app = g_strdup (source_basename);
+               }
+
+               /* get the id-prefix */
+               str = g_strstr_len (source_basename, -1, origin_delim);
+               if (str != NULL) {
+                       str[0] = '\0';
+                       id_prefix_app = g_strdup (source_basename);
+               }
+       }
+
+       /* FIXME: we can remove this helper when nuking FLATPAK */
+       if (origin_app == NULL &&
+           source_filename != NULL &&
+           g_strcmp0 (priv->origin, "flatpak") == 0) {
+               id_prefix_app = g_strdup (id_prefix);
                origin_app = as_store_get_origin_for_flatpak (source_filename);
+       }
+
+       /* fallback */
+       if (origin_app == NULL) {
+               id_prefix_app = g_strdup (id_prefix);
+               origin_app = g_strdup (priv->origin);
+       }
+
+       /* print what cleverness we did */
+       if (g_strcmp0 (origin_app, priv->origin) != 0) {
                g_debug ("using app origin of '%s' rather than '%s'",
                         origin_app, priv->origin);
-       } else {
-               origin_app = g_strdup (priv->origin);
+       }
+       if (g_strcmp0 (id_prefix_app, id_prefix) != 0) {
+               g_debug ("using app prefix of '%s' rather than '%s'",
+                        id_prefix_app, id_prefix);
        }
 
        /* guess the icon path after we've read the origin and then look for
@@ -1084,12 +1142,12 @@
                topdir = g_path_get_basename (icon_prefix);
                if ((g_strcmp0 (topdir, "xmls") == 0 ||
                     g_strcmp0 (topdir, "yaml") == 0)
-                   && priv->origin != NULL) {
+                   && origin_app != NULL) {
                        g_autofree gchar *dirname = NULL;
                        dirname = g_path_get_dirname (icon_prefix);
                        icon_path = g_build_filename (dirname,
                                                      "icons",
-                                                     priv->origin,
+                                                     origin_app,
                                                      NULL);
                } else {
                        icon_path = g_build_filename (icon_prefix, "icons", 
NULL);
@@ -1136,7 +1194,7 @@
                }
 
                /* set the correct scope */
-               as_store_fixup_id_prefix (app, id_prefix);
+               as_store_fixup_id_prefix (app, id_prefix_app);
 
                if (origin_app != NULL)
                        as_app_set_origin (app, origin_app);
@@ -1282,6 +1340,7 @@
        GPtrArray *apps;
        guint i;
        const gchar *tmp;
+       _cleanup_uninhibit_ guint32 *tok = NULL;
        g_autoptr(GPtrArray) ids = NULL;
 
        /* find any applications in the store with this source file */
@@ -1295,6 +1354,7 @@
        }
 
        /* remove these from the store */
+       tok = as_store_changed_inhibit (store);
        for (i = 0; i < ids->len; i++) {
                tmp = g_ptr_array_index (ids, i);
                g_debug ("removing %s as %s invalid", tmp, filename);
@@ -1302,6 +1362,7 @@
        }
 
        /* the store changed */
+       as_store_changed_uninhibit (&tok);
        as_store_perhaps_emit_changed (store, "remove-by-source-file");
 }
 
@@ -1313,6 +1374,7 @@
 {
        AsStorePrivate *priv = GET_PRIVATE (store);
        AsStorePathData *path_data;
+       g_autofree gchar *dirname = NULL;
        g_autoptr(GError) error = NULL;
        g_autoptr(GFile) file = NULL;
 
@@ -1321,10 +1383,11 @@
                return;
 
        /* we helpfully saved this */
-       g_debug ("parsing new file %s", filename);
-       path_data = g_hash_table_lookup (priv->appinfo_dirs, filename);
+       dirname = g_path_get_dirname (filename);
+       g_debug ("parsing new file %s from %s", filename, dirname);
+       path_data = g_hash_table_lookup (priv->appinfo_dirs, dirname);
        if (path_data == NULL) {
-               g_warning ("no path data for %s", filename);
+               g_warning ("no path data for %s", dirname);
                return;
        }
        file = g_file_new_for_path (filename);
@@ -1368,6 +1431,7 @@
                if (g_hash_table_contains (priv->flatpak_dirs, filename))
                        as_store_rescan_flatpak_dir (store, filename);
        }
+       as_store_changed_uninhibit (&tok);
        as_store_perhaps_emit_changed (store, "file changed");
 }
 
@@ -1389,6 +1453,7 @@
                if (g_hash_table_contains (priv->flatpak_dirs, filename))
                        as_store_rescan_flatpak_dir (store, filename);
        }
+       as_store_changed_uninhibit (&tok);
        as_store_perhaps_emit_changed (store, "file added");
 }
 
@@ -1417,16 +1482,40 @@
  **/
 static void
 as_store_add_path_data (AsStore *store,
-                       const gchar *filename,
+                       const gchar *path,
                        const gchar *id_prefix,
                        const gchar *arch)
 {
        AsStorePrivate *priv = GET_PRIVATE (store);
-       AsStorePathData *path_data = g_slice_new0 (AsStorePathData);
+       AsStorePathData *path_data;
+
+       /* check is a directory */
+       if (!g_file_test (path, G_FILE_TEST_IS_DIR)) {
+               g_warning ("not adding path %s [%s:%s] as not a directory",
+                          path, id_prefix, arch);
+               return;
+       }
+
+       /* check not already exists */
+       path_data = g_hash_table_lookup (priv->appinfo_dirs, path);
+       if (path_data != NULL) {
+               if (g_strcmp0 (path_data->id_prefix, id_prefix) != 0 ||
+                   g_strcmp0 (path_data->arch, arch) != 0) {
+                       g_warning ("already added path %s [%s:%s] vs new 
[%s:%s]",
+                                  path, path_data->id_prefix, path_data->arch,
+                                  id_prefix, arch);
+               } else {
+                       g_debug ("already added path %s [%s:%s]",
+                                path, path_data->id_prefix, path_data->arch);
+               }
+               return;
+       }
 
+       /* create new */
+       path_data = g_slice_new0 (AsStorePathData);
        path_data->id_prefix = g_strdup (id_prefix);
        path_data->arch = g_strdup (arch);
-       g_hash_table_insert (priv->appinfo_dirs, g_strdup (filename), 
path_data);
+       g_hash_table_insert (priv->appinfo_dirs, g_strdup (path), path_data);
 }
 
 /**
@@ -1479,7 +1568,6 @@
 
        /* watch for file changes */
        if (priv->watch_flags > 0) {
-               as_store_add_path_data (store, filename, id_prefix, arch);
                if (!as_monitor_add_file (priv->monitor,
                                          filename,
                                          cancellable,
@@ -1519,7 +1607,9 @@
                    GCancellable *cancellable,
                    GError **error)
 {
-       return as_store_from_file_internal (store, file, NULL, NULL,
+       return as_store_from_file_internal (store, file,
+                                           NULL, /* id_prefix */
+                                           NULL, /* arch */
                                            cancellable, error);
 }
 
@@ -1604,7 +1694,6 @@
 {
        g_autoptr(GError) error_local = NULL;
        g_autoptr(AsNode) root = NULL;
-       const gchar *id_prefix = NULL;
 
        g_return_val_if_fail (AS_IS_STORE (store), FALSE);
        g_return_val_if_fail (data != NULL, FALSE);
@@ -1624,7 +1713,9 @@
                             error_local->message);
                return FALSE;
        }
-       return as_store_from_root (store, root, id_prefix, icon_root,
+       return as_store_from_root (store, root,
+                                  NULL, /* id_prefix */
+                                  icon_root,
                                   NULL, /* filename */
                                   NULL, /* arch */
                                   error);
@@ -2743,6 +2834,15 @@
                if (!as_store_search_installed (store, flags, "user",
                                                dest, cancellable, error))
                        return FALSE;
+       }
+
+       /* MetaInfo */
+       if ((flags & AS_STORE_LOAD_FLAG_APPDATA) > 0) {
+               g_autofree gchar *dest = NULL;
+               dest = g_build_filename (g_get_user_data_dir (), "metainfo", 
NULL);
+               if (!as_store_search_installed (store, flags, "user",
+                                               dest, cancellable, error))
+                       return FALSE;
        }
 
        /* desktop files */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/po/ko.po 
new/appstream-glib-0.5.16/po/ko.po
--- old/appstream-glib-0.5.15/po/ko.po  2016-05-23 13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/po/ko.po  2016-06-14 11:37:28.000000000 +0200
@@ -10,9 +10,9 @@
 msgstr ""
 "Project-Id-Version: appstream-glib\n"
 "Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2016-04-20 08:59+0100\n"
-"PO-Revision-Date: 2016-04-20 07:59+0000\n"
-"Last-Translator: Richard Hughes <[email protected]>\n"
+"POT-Creation-Date: 2016-06-13 10:53+0100\n"
+"PO-Revision-Date: 2016-05-29 13:40+0000\n"
+"Last-Translator: Seong-ho Cho <[email protected]>\n"
 "Language-Team: Korean 
(http://www.transifex.com/freedesktop/appstream-glib/language/ko/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -277,7 +277,7 @@
 
 #. TRANSLATORS: command description
 msgid "Search for AppStream applications by package name"
-msgstr ""
+msgstr "꾸러미 이름으로 AppStream 프로그램 검색"
 
 #. TRANSLATORS: command description
 msgid "Display application search tokens"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/appstream-glib-0.5.15/po/oc.po 
new/appstream-glib-0.5.16/po/oc.po
--- old/appstream-glib-0.5.15/po/oc.po  2016-05-23 13:50:12.000000000 +0200
+++ new/appstream-glib-0.5.16/po/oc.po  2016-06-14 11:37:28.000000000 +0200
@@ -6,14 +6,15 @@
 # Cédric Valmary <[email protected]>, 2015
 # Cédric Valmary <[email protected]>, 2016
 # Cédric Valmary <[email protected]>, 2016
+# Tot en òc <[email protected]>, 2016
 # Yannig Marchegay (Kokoyaya) <[email protected]>, 2007
 msgid ""
 msgstr ""
 "Project-Id-Version: appstream-glib\n"
 "Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2016-05-23 09:40+0100\n"
-"PO-Revision-Date: 2016-04-23 06:47+0000\n"
-"Last-Translator: Cédric Valmary <[email protected]>\n"
+"POT-Creation-Date: 2016-06-13 10:53+0100\n"
+"PO-Revision-Date: 2016-06-12 22:44+0000\n"
+"Last-Translator: Tot en òc <[email protected]>\n"
 "Language-Team: Occitan (post 1500) 
(http://www.transifex.com/freedesktop/appstream-glib/language/oc/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -238,11 +239,11 @@
 
 #. TRANSLATORS: application was removed
 msgid "Removed"
-msgstr ""
+msgstr "Suprimit"
 
 #. TRANSLATORS: application was added
 msgid "Added"
-msgstr ""
+msgstr "Apondut"
 
 #. TRANSLATORS: this is the --nonet argument
 msgid "Do not use network access"

++++++ openSUSE-appstream-process ++++++
--- /var/tmp/diff_new_pack.IIjUmi/_old  2016-07-01 09:57:16.000000000 +0200
+++ /var/tmp/diff_new_pack.IIjUmi/_new  2016-07-01 09:57:16.000000000 +0200
@@ -52,3 +52,7 @@
 # off to a mirror to catch the file, improving performance
 read md5 fn_catchall <<<$(md5sum ${DEST}/appdata-icons.tar.gz)
 mv ${DEST}/appdata-icons.tar.gz ${DEST}/appdata-icons-${md5}.tar.gz
+
+# also rename the appdata.xml.gz file in the same style
+read md5 fn_catchall <<<$(md5sum ${DEST}/appdata.xml.gz)
+mv ${DEST}/appdata.xml.gz ${DEST}/appdata-${md5}.xml.gz


Reply via email to