[gnome-software] packagekit local: Set HAS_SOURCE quirk for certain Google packages



commit 4642aa292698e22884ecc819caf0b999e72b98c1
Author: Kalev Lember <klember redhat com>
Date:   Thu Feb 15 15:38:46 2018 +0100

    packagekit local: Set HAS_SOURCE quirk for certain Google packages
    
    google-chrome-stable and others are known to install a .repo file from
    rpm scripts/cron job and we can't detect that they include a .repo file
    just by looking at file lists.

 plugins/packagekit/gs-plugin-packagekit-local.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
diff --git a/plugins/packagekit/gs-plugin-packagekit-local.c b/plugins/packagekit/gs-plugin-packagekit-local.c
index 0194482f..da54016a 100644
--- a/plugins/packagekit/gs-plugin-packagekit-local.c
+++ b/plugins/packagekit/gs-plugin-packagekit-local.c
@@ -130,6 +130,21 @@ gs_plugin_packagekit_refresh_guess_app_id (GsPlugin *plugin,
        return TRUE;
 }
 
+static void
+add_quirks_from_package_name (GsApp *app, const gchar *package_name)
+{
+       /* these packages don't have a .repo file in their file lists, but
+        * instead install one through rpm scripts / cron job */
+       const gchar *packages_with_repos[] = {
+               "google-chrome-stable",
+               "google-earth-pro-stable",
+               "google-talkplugin",
+               NULL };
+
+       if (g_strv_contains (packages_with_repos, package_name))
+               gs_app_add_quirk (app, AS_APP_QUIRK_HAS_SOURCE);
+}
+
 gboolean
 gs_plugin_file_to_app (GsPlugin *plugin,
                       GsAppList *list,
@@ -229,6 +244,7 @@ gs_plugin_file_to_app (GsPlugin *plugin,
        gs_app_set_size_download (app, 0);
        license_spdx = as_utils_license_to_spdx (pk_details_get_license (item));
        gs_app_set_license (app, GS_APP_QUALITY_LOWEST, license_spdx);
+       add_quirks_from_package_name (app, split[PK_PACKAGE_ID_NAME]);
 
        /* look for a desktop file so we can use a valid application id */
        if (!gs_plugin_packagekit_refresh_guess_app_id (plugin,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]