[gnome-software/1409-add-available-for-fedora-section-to-the-explore-page: 43/44] gs-cmd: Add "deployment-featured" command line option
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1409-add-available-for-fedora-section-to-the-explore-page: 43/44] gs-cmd: Add "deployment-featured" command line option
- Date: Tue, 10 May 2022 05:45:55 +0000 (UTC)
commit fbbb98ee2271dfcc6972d5da991dd83182b4428a
Author: Milan Crha <mcrha redhat com>
Date: Fri May 6 11:57:56 2022 +0200
gs-cmd: Add "deployment-featured" command line option
It can be used to check the list of the deployment-featured applications
from the command line.
lib/gs-cmd.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
---
diff --git a/lib/gs-cmd.c b/lib/gs-cmd.c
index b15317b4d..659f6af3e 100644
--- a/lib/gs-cmd.c
+++ b/lib/gs-cmd.c
@@ -644,6 +644,37 @@ main (int argc, char **argv)
break;
}
}
+ } else if (argc == 3 && g_strcmp0 (argv[1], "deployment-featured") == 0) {
+ g_auto(GStrv) split = g_strsplit (argv[2], ",", -1);
+ for (i = 0; i < repeat; i++) {
+ g_autoptr(GsPluginJob) plugin_job = NULL;
+ g_autoptr(GDateTime) now = NULL;
+ g_autoptr(GDateTime) released_since = NULL;
+ g_autoptr(GsAppQuery) query = NULL;
+ GsPluginListAppsFlags flags = GS_PLUGIN_LIST_APPS_FLAGS_NONE;
+
+ if (list != NULL)
+ g_object_unref (list);
+
+ now = g_date_time_new_now_local ();
+ released_since = g_date_time_add_seconds (now, -cache_age_secs);
+ query = gs_app_query_new ("deployment-featured", split,
+ "refine-flags", self->refine_flags,
+ "dedupe-flags", GS_APP_LIST_FILTER_FLAG_KEY_ID,
+ "max-results", self->max_results,
+ NULL);
+
+ if (self->interactive)
+ flags |= GS_PLUGIN_LIST_APPS_FLAGS_INTERACTIVE;
+
+ plugin_job = gs_plugin_job_list_apps_new (query, flags);
+ list = gs_plugin_loader_job_process (self->plugin_loader, plugin_job,
+ NULL, &error);
+ if (list == NULL) {
+ ret = FALSE;
+ break;
+ }
+ }
} else if (argc == 2 && g_strcmp0 (argv[1], "recent") == 0) {
if (cache_age_secs == 0)
cache_age_secs = 60 * 60 * 24 * 60;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]