summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-01-17 19:39:42 +0000
committerRichard Hughes <richard@hughsie.com>2016-01-17 19:39:44 +0000
commitad7396c84ba32ea7d5c47cfcd2a4ef661facaaa4 (patch)
treef424c43fd9fd2b2ab1ff86243ac3e95fc12362dc
parent2394abeb8d3d797c9180a44199e654d0de9c0e56 (diff)
downloadappstream-glib-ad7396c84ba32ea7d5c47cfcd2a4ef661facaaa4.tar.gz
Move the blacklisted application list to the front-end client
At the moment the blacklist list is being used to filter applications that have an AppData file, and also installed desktop files. I agree it's wrong to filter applications with valid AppData files from the metadata, and the various runtime blacklist entries are better suited to the front-end application which can adjust it as the design dictates.
-rw-r--r--libappstream-glib/Makefile.am3
-rw-r--r--libappstream-glib/appstream-glib.gresource.xml1
-rw-r--r--libappstream-glib/as-app-desktop.c4
-rw-r--r--libappstream-glib/as-blacklist-ids.txt12
-rw-r--r--libappstream-glib/as-self-test.c4
-rw-r--r--libappstream-glib/as-utils.c17
-rw-r--r--libappstream-glib/as-utils.h3
7 files changed, 3 insertions, 41 deletions
diff --git a/libappstream-glib/Makefile.am b/libappstream-glib/Makefile.am
index a0bf163..feb7d21 100644
--- a/libappstream-glib/Makefile.am
+++ b/libappstream-glib/Makefile.am
@@ -34,7 +34,6 @@ endif
as-resources.c: appstream-glib.gresource.xml \
as-stock-icons.txt \
as-license-ids.txt \
- as-blacklist-ids.txt \
as-category-ids.txt \
as-environment-ids.txt
$(AM_V_GEN) \
@@ -48,7 +47,6 @@ as-resources.c: appstream-glib.gresource.xml \
as-resources.h: appstream-glib.gresource.xml \
as-stock-icons.txt \
as-license-ids.txt \
- as-blacklist-ids.txt \
as-category-ids.txt \
as-environment-ids.txt
$(AM_V_GEN) \
@@ -240,7 +238,6 @@ DISTCLEANFILES = \
EXTRA_DIST = \
appstream-glib.gresource.xml \
appstream-glib.pc.in \
- as-blacklist-ids.txt \
as-category-ids.txt \
as-environment-ids.txt \
as-license-ids.txt \
diff --git a/libappstream-glib/appstream-glib.gresource.xml b/libappstream-glib/appstream-glib.gresource.xml
index b0c31d8..e6435eb 100644
--- a/libappstream-glib/appstream-glib.gresource.xml
+++ b/libappstream-glib/appstream-glib.gresource.xml
@@ -2,7 +2,6 @@
<gresources>
<gresource prefix="/org/freedesktop/appstream-glib">
<file>as-stock-icons.txt</file>
- <file>as-blacklist-ids.txt</file>
<file>as-license-ids.txt</file>
<file>as-category-ids.txt</file>
<file>as-environment-ids.txt</file>
diff --git a/libappstream-glib/as-app-desktop.c b/libappstream-glib/as-app-desktop.c
index f84570e..e45119d 100644
--- a/libappstream-glib/as-app-desktop.c
+++ b/libappstream-glib/as-app-desktop.c
@@ -438,10 +438,6 @@ as_app_parse_desktop_file (AsApp *app,
}
}
- /* is blacklisted */
- if (as_utils_is_blacklisted_id (app_id))
- as_app_add_veto (app, "%s is not an application", app_id);
-
/* Ubuntu helpfully put the package name in the desktop file name */
tmp = g_strstr_len (app_id, -1, ":");
if (tmp != NULL)
diff --git a/libappstream-glib/as-blacklist-ids.txt b/libappstream-glib/as-blacklist-ids.txt
deleted file mode 100644
index 21708d5..0000000
--- a/libappstream-glib/as-blacklist-ids.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-# these are desktop IDs that have been blacklisted as they are not apps
-freeciv-server.desktop
-nm-connection-editor.desktop
-plank.desktop
-*release-notes*.desktop
-*Release_Notes*.desktop
-remote-viewer.desktop
-Rodent-*.desktop
-rygel-preferences.desktop
-system-config-keyboard.desktop
-tracker-preferences.desktop
-Uninstall*.desktop
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c
index fd1e8d2..4279878 100644
--- a/libappstream-glib/as-self-test.c
+++ b/libappstream-glib/as-self-test.c
@@ -3556,10 +3556,6 @@ as_test_utils_func (void)
g_assert (as_utils_is_category_id ("AudioVideoEditing"));
g_assert (!as_utils_is_category_id ("SpellEditing"));
- /* blacklist */
- g_assert (as_utils_is_blacklisted_id ("freeciv-server.desktop"));
- g_assert (!as_utils_is_blacklisted_id ("gimp.desktop"));
-
/* valid description markup */
tmp = as_markup_convert_simple ("<p>Hello world!</p>", &error);
g_assert_no_error (error);
diff --git a/libappstream-glib/as-utils.c b/libappstream-glib/as-utils.c
index 1c8dc78..50b5a54 100644
--- a/libappstream-glib/as-utils.c
+++ b/libappstream-glib/as-utils.c
@@ -510,23 +510,6 @@ as_utils_is_spdx_license_id (const gchar *license_id)
gboolean
as_utils_is_blacklisted_id (const gchar *desktop_id)
{
- guint i;
- g_autoptr(GBytes) data = NULL;
- g_autofree gchar *key = NULL;
- g_auto(GStrv) split = NULL;
-
- /* load the readonly data section and look for the icon name */
- data = g_resource_lookup_data (as_get_resource (),
- "/org/freedesktop/appstream-glib/as-blacklist-ids.txt",
- G_RESOURCE_LOOKUP_FLAGS_NONE,
- NULL);
- if (data == NULL)
- return FALSE;
- split = g_strsplit (g_bytes_get_data (data, NULL), "\n", -1);
- for (i = 0; split[i] != NULL; i++) {
- if (fnmatch (split[i], desktop_id, 0) == 0)
- return TRUE;
- }
return FALSE;
}
diff --git a/libappstream-glib/as-utils.h b/libappstream-glib/as-utils.h
index 93e4db4..e84c02f 100644
--- a/libappstream-glib/as-utils.h
+++ b/libappstream-glib/as-utils.h
@@ -142,7 +142,10 @@ gboolean as_utils_is_spdx_license_id (const gchar *license_id);
gboolean as_utils_is_spdx_license (const gchar *license);
gboolean as_utils_is_environment_id (const gchar *environment_id);
gboolean as_utils_is_category_id (const gchar *category_id);
+
+G_DEPRECATED
gboolean as_utils_is_blacklisted_id (const gchar *desktop_id);
+
gchar **as_utils_spdx_license_tokenize (const gchar *license);
gchar *as_utils_spdx_license_detokenize (gchar **license_tokens);
gchar *as_utils_license_to_spdx (const gchar *license);