diff options
-rw-r--r-- | libappstream-glib/as-store.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index 9f0e1dc..7a29e28 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -1430,7 +1430,9 @@ as_store_watch_source_added (AsStore *store, const gchar *filename) /* we helpfully saved this */ 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); + path_data = g_hash_table_lookup (priv->appinfo_dirs, filename); + if (path_data == NULL) + path_data = g_hash_table_lookup (priv->appinfo_dirs, dirname); if (path_data == NULL) { g_warning ("no path data for %s", dirname); return; @@ -1524,13 +1526,6 @@ as_store_add_path_data (AsStore *store, return; } - /* 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, as_app_scope_to_string (scope), arch); - return; - } - /* check not already exists */ path_data = g_hash_table_lookup (priv->appinfo_dirs, path); if (path_data != NULL) { @@ -1606,6 +1601,7 @@ as_store_from_file_internal (AsStore *store, /* watch for file changes */ if (watch_flags > 0) { + as_store_add_path_data (store, filename, scope, arch); if (!as_monitor_add_file (priv->monitor, filename, cancellable, |