summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2018-05-10 10:04:23 +0100
committerRichard Hughes <richard@hughsie.com>2018-06-12 08:27:42 +0100
commitd301f0cc4e467bdd7d2988056820fafbe3c6cfbf (patch)
treecfb17550db02b245ca3e859bafa50697926b56a1 /client
parent8e1b6174f1f975df38667be09e71d1060bf0ec28 (diff)
downloadappstream-glib-d301f0cc4e467bdd7d2988056820fafbe3c6cfbf.tar.gz
Do not parse firmware files
Firmware should now be distributed using the LVFS and consumed by fwupd.
Diffstat (limited to 'client')
-rw-r--r--client/as-util.c83
1 files changed, 0 insertions, 83 deletions
diff --git a/client/as-util.c b/client/as-util.c
index 31d1512..8c0bcde 100644
--- a/client/as-util.c
+++ b/client/as-util.c
@@ -3541,83 +3541,6 @@ as_util_mirror_screenshots (AsUtilPrivate *priv, gchar **values, GError **error)
}
static gboolean
-as_util_mirror_local_firmware (AsUtilPrivate *priv, gchar **values, GError **error)
-{
- AsApp *app;
- GPtrArray *apps;
- guint i;
- guint j;
- g_autoptr(AsStore) store = NULL;
- g_autoptr(GFile) file = NULL;
-
- /* check args */
- if (g_strv_length (values) != 2) {
- g_set_error_literal (error,
- AS_ERROR,
- AS_ERROR_INVALID_ARGUMENTS,
- "Not enough arguments, expected: "
- "file url");
- return FALSE;
- }
-
- /* open file */
- store = as_store_new ();
- file = g_file_new_for_path (values[0]);
- if (!as_store_from_file (store, file, NULL, NULL, error))
- return FALSE;
-
- /* convert all the screenshots */
- apps = as_store_get_apps (store);
- for (i = 0; i < apps->len; i++) {
- GPtrArray *releases;
- AsRelease *rel;
-
- /* get app */
- app = g_ptr_array_index (apps, i);
- if (as_app_get_kind (app) != AS_APP_KIND_FIRMWARE)
- continue;
- releases = as_app_get_releases (app);
- if (releases->len == 0)
- continue;
- for (j = 0; j < releases->len; j++) {
- AsChecksum *csum;
- const gchar *tmp;
- g_autofree gchar *loc = NULL;
- g_autofree gchar *fn = NULL;
- rel = g_ptr_array_index (releases, j);
-
- /* get the release filename, but fall back to
- * the default location basename if unset */
- csum = as_release_get_checksum_by_target (rel, AS_CHECKSUM_TARGET_CONTAINER);
- if (csum != NULL) {
- tmp = as_checksum_get_filename (csum);
- if (tmp == NULL)
- continue;
- fn = g_strdup (tmp);
- } else {
- tmp = as_release_get_location_default (rel);
- if (tmp == NULL)
- continue;
- fn = g_path_get_basename (tmp);
- }
- loc = g_build_filename (values[1], fn, NULL);
- g_ptr_array_set_size (as_release_get_locations (rel), 0);
- as_release_add_location (rel, loc);
- }
- }
-
- /* save file */
- if (!as_store_to_file (store, file,
- AS_NODE_TO_XML_FLAG_ADD_HEADER |
- AS_NODE_TO_XML_FLAG_FORMAT_INDENT |
- AS_NODE_TO_XML_FLAG_FORMAT_MULTILINE,
- NULL, error))
- return FALSE;
-
- return TRUE;
-}
-
-static gboolean
as_util_agreement_export (AsUtilPrivate *priv, gchar **values, GError **error)
{
AsAgreement *pp;
@@ -4602,12 +4525,6 @@ main (int argc, char *argv[])
_("Mirror upstream screenshots"),
as_util_mirror_screenshots);
as_util_add (priv->cmd_array,
- "mirror-local-firmware",
- NULL,
- /* TRANSLATORS: command description */
- _("Mirror local firmware files"),
- as_util_mirror_local_firmware);
- as_util_add (priv->cmd_array,
"incorporate",
NULL,
/* TRANSLATORS: command description */