diff options
author | Richard Hughes <richard@hughsie.com> | 2017-05-16 09:09:39 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-05-16 09:13:17 +0100 |
commit | b425d3e292f0197f8507b59e707fe9a314dac8c1 (patch) | |
tree | c8b16eee2cea861cceb9cb1e4b139543c1ded44f | |
parent | 9e0c4c0483cf292a83577a28ea283e4511c4daa6 (diff) | |
download | appstream-glib-b425d3e292f0197f8507b59e707fe9a314dac8c1.tar.gz |
Remove the cache-id functionality
The results when using the partial update were not always the same as doing a
fresh run (some components depend on other components) and even I'm not using
this functionality anymore when running appstream-builder on the whole Fedora,
achive, even across on all branches.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1426166
-rw-r--r-- | client/as-builder.c | 2 | ||||
-rw-r--r-- | libappstream-builder/asb-context.c | 94 | ||||
-rw-r--r-- | libappstream-builder/asb-context.h | 2 | ||||
-rw-r--r-- | libappstream-builder/asb-self-test.c | 166 | ||||
-rw-r--r-- | libappstream-builder/asb-task.c | 24 |
5 files changed, 35 insertions, 253 deletions
diff --git a/client/as-builder.c b/client/as-builder.c index 1833091..908bd62 100644 --- a/client/as-builder.c +++ b/client/as-builder.c @@ -244,7 +244,7 @@ main (int argc, char **argv) if (hidpi_enabled) flags |= ASB_CONTEXT_FLAG_HIDPI_ICONS; if (add_cache_id) - flags |= ASB_CONTEXT_FLAG_ADD_CACHE_ID; + g_print ("--add-cache-id now does nothing and will be removed in future versions\n"); if (embedded_icons) flags |= ASB_CONTEXT_FLAG_EMBEDDED_ICONS; if (include_failed) diff --git a/libappstream-builder/asb-context.c b/libappstream-builder/asb-context.c index b22de61..fe56dc0 100644 --- a/libappstream-builder/asb-context.c +++ b/libappstream-builder/asb-context.c @@ -115,9 +115,9 @@ asb_context_set_api_version (AsbContext *ctx, gdouble api_version) /** * asb_context_set_flags: * @ctx: A #AsbContext - * @flags: #AsbContextFlags, e.g. %ASB_CONTEXT_FLAG_ADD_CACHE_ID + * @flags: #AsbContextFlags, e.g. %ASB_CONTEXT_FLAG_NO_NETWORK * - * Sets if the cache id should be included in the metadata. + * Sets flags to be used when building the metadata. * * Since: 0.3.5 **/ @@ -125,11 +125,6 @@ void asb_context_set_flags (AsbContext *ctx, AsbContextFlags flags) { AsbContextPrivate *priv = GET_PRIVATE (ctx); - if (flags & ASB_CONTEXT_FLAG_ADD_CACHE_ID) { - as_store_add_metadata_index (priv->store_failed, "X-CacheID"); - as_store_add_metadata_index (priv->store_ignore, "X-CacheID"); - as_store_add_metadata_index (priv->store_old, "X-CacheID"); - } priv->flags = flags; } @@ -464,12 +459,6 @@ asb_context_add_filename (AsbContext *ctx, const gchar *filename, GError **error { g_autoptr(AsbPackage) pkg = NULL; - /* can find in existing metadata */ - if (asb_context_find_in_cache (ctx, filename)) { - g_debug ("Found %s in old metadata", filename); - return TRUE; - } - /* open */ #ifdef HAVE_RPM if (g_str_has_suffix (filename, ".rpm")) @@ -796,10 +785,6 @@ asb_context_write_xml (AsbContext *ctx, GError **error) g_print ("Writing %s...\n", filename); as_store_set_origin (store, priv->origin); as_store_set_api_version (store, priv->api_version); - if (priv->flags & ASB_CONTEXT_FLAG_ADD_CACHE_ID) { - g_autofree gchar *builder_id = asb_utils_get_builder_id (); - as_store_set_builder_id (store, builder_id); - } return as_store_to_file (store, file, AS_NODE_TO_XML_FLAG_ADD_HEADER | @@ -1028,10 +1013,6 @@ asb_context_write_xml_fail (AsbContext *ctx, GError **error) basename_failed = g_strdup_printf ("%s-failed", priv->origin); as_store_set_origin (priv->store_failed, basename_failed); as_store_set_api_version (priv->store_failed, priv->api_version); - if (priv->flags & ASB_CONTEXT_FLAG_ADD_CACHE_ID) { - g_autofree gchar *builder_id = asb_utils_get_builder_id (); - as_store_set_builder_id (priv->store_failed, builder_id); - } return as_store_to_file (priv->store_failed, file, AS_NODE_TO_XML_FLAG_ADD_HEADER | @@ -1048,10 +1029,6 @@ asb_context_write_xml_ignore (AsbContext *ctx, GError **error) g_autofree gchar *filename = NULL; g_autoptr(GFile) file = NULL; - /* no need to create */ - if ((priv->flags & ASB_CONTEXT_FLAG_ADD_CACHE_ID) == 0) - return TRUE; - /* the store is already populated */ filename = g_strdup_printf ("%s/%s-ignore.xml.gz", priv->output_dir, priv->basename); @@ -1061,10 +1038,6 @@ asb_context_write_xml_ignore (AsbContext *ctx, GError **error) basename_cache = g_strdup_printf ("%s-ignore", priv->origin); as_store_set_origin (priv->store_ignore, basename_cache); as_store_set_api_version (priv->store_ignore, priv->api_version); - if (priv->flags & ASB_CONTEXT_FLAG_ADD_CACHE_ID) { - g_autofree gchar *builder_id = asb_utils_get_builder_id (); - as_store_set_builder_id (priv->store_ignore, builder_id); - } return as_store_to_file (priv->store_ignore, file, AS_NODE_TO_XML_FLAG_ADD_HEADER | @@ -1300,44 +1273,15 @@ asb_context_process (AsbContext *ctx, GError **error) * @ctx: A #AsbContext * @filename: cache-id * - * Finds an application in the cache. This will only return results if - * asb_context_set_old_metadata() has been used. + * This function used to find an application in the cache, and now does nothing. * - * Returns: %TRUE to skip exploding the package + * Returns: always %FALSE * * Since: 0.1.0 **/ gboolean asb_context_find_in_cache (AsbContext *ctx, const gchar *filename) { - AsApp *app; - AsbContextPrivate *priv = GET_PRIVATE (ctx); - guint i; - g_autofree gchar *cache_id = NULL; - g_autofree gchar *builder_id = NULL; - g_autoptr(GPtrArray) apps = NULL; - g_autoptr(GPtrArray) apps_ignore = NULL; - - /* the package was successfully parsed last time */ - cache_id = asb_utils_get_cache_id_for_filename (filename); - apps = as_store_get_apps_by_metadata (priv->store_old, - "X-CacheID", - cache_id); - if (apps->len > 0) { - for (i = 0; i < apps->len; i++) { - app = g_ptr_array_index (apps, i); - asb_context_add_app (ctx, (AsbApp *) app); - } - return TRUE; - } - - /* the package was ignored last time */ - apps_ignore = as_store_get_apps_by_metadata (priv->store_ignore, - "X-CacheID", - cache_id); - if (apps_ignore->len > 0) - return TRUE; - return FALSE; } @@ -1390,43 +1334,17 @@ asb_context_add_app (AsbContext *ctx, AsbApp *app) void asb_context_add_app_ignore (AsbContext *ctx, AsbPackage *pkg) { - AsApp *app_tmp; AsbContextPrivate *priv = GET_PRIVATE (ctx); g_autofree gchar *name_arch = NULL; g_autoptr(AsApp) app = NULL; - g_autoptr(GPtrArray) apps = NULL; - - /* only do this when we are using a cache-id */ - if ((priv->flags & ASB_CONTEXT_FLAG_ADD_CACHE_ID) == 0) - return; - - /* check not already added a dummy application for this package */ - apps = as_store_get_apps_by_metadata (priv->store_ignore, - "X-CacheID", - asb_package_get_basename (pkg)); - if (apps->len > 0) { - g_debug ("already found CacheID of %s", - asb_package_get_basename (pkg)); - return; - } - /* package name already exists, but with a different CacheID */ + /* never encountered before, so add */ + app = as_app_new (); name_arch = g_strdup_printf ("%s.%s", asb_package_get_name (pkg), asb_package_get_arch (pkg)); - app_tmp = as_store_get_app_by_id (priv->store_ignore, name_arch); - if (app_tmp != NULL) { - as_app_add_metadata (AS_APP (app_tmp), "X-CacheID", - asb_package_get_basename (pkg)); - return; - } - - /* never encountered before, so add */ - app = as_app_new (); as_app_set_id (app, name_arch); as_app_add_pkgname (app, asb_package_get_name (pkg)); - as_app_add_metadata (app, "X-CacheID", - asb_package_get_basename (pkg)); as_store_add_app (priv->store_ignore, app); } diff --git a/libappstream-builder/asb-context.h b/libappstream-builder/asb-context.h index 62990a8..1e588f9 100644 --- a/libappstream-builder/asb-context.h +++ b/libappstream-builder/asb-context.h @@ -51,7 +51,7 @@ struct _AsbContextClass * @ASB_CONTEXT_FLAG_NONE: No special actions to use * @ASB_CONTEXT_FLAG_IGNORE_MISSING_INFO: Ignore missing information * @ASB_CONTEXT_FLAG_IGNORE_MISSING_PARENTS: Ignore missing parents - * @ASB_CONTEXT_FLAG_ADD_CACHE_ID: Add cache ID to reuse metadata + * @ASB_CONTEXT_FLAG_ADD_CACHE_ID: Unused * @ASB_CONTEXT_FLAG_HIDPI_ICONS: Include HiDPI icons * @ASB_CONTEXT_FLAG_EMBEDDED_ICONS: Embed the icons in the XML * @ASB_CONTEXT_FLAG_NO_NETWORK: Do not download files diff --git a/libappstream-builder/asb-self-test.c b/libappstream-builder/asb-self-test.c index ad95a59..5a780d3 100644 --- a/libappstream-builder/asb-self-test.c +++ b/libappstream-builder/asb-self-test.c @@ -294,18 +294,10 @@ asb_test_plugin_loader_func (void) g_assert_cmpstr (plugin->name, ==, "appdata"); } -#ifdef HAVE_RPM - -typedef enum { - ASB_TEST_CONTEXT_MODE_NO_CACHE, - ASB_TEST_CONTEXT_MODE_WITH_CACHE, - ASB_TEST_CONTEXT_MODE_WITH_OLD_CACHE, - ASB_TEST_CONTEXT_MODE_LAST -} AsbTestContextMode; - static void -asb_test_context_test_func (AsbTestContextMode mode) +asb_test_context_func (void) { +#ifdef HAVE_RPM AsApp *app; AsbPluginLoader *loader; GError *error = NULL; @@ -334,13 +326,20 @@ asb_test_context_test_func (AsbTestContextMode mode) "colorhug-als-2.0.2.cab", /* firmware */ NULL}; + /* remove icons */ + ret = asb_utils_rmtree ("/tmp/asbuilder/temp/icons", &error); + g_assert_no_error (error); + g_assert (ret); + + ret = asb_utils_rmtree ("/tmp/asbuilder/output", &error); + g_assert_no_error (error); + g_assert (ret); + /* set up the context */ ctx = asb_context_new (); - g_assert (!asb_context_get_flag (ctx, ASB_CONTEXT_FLAG_ADD_CACHE_ID)); asb_context_set_max_threads (ctx, 1); asb_context_set_api_version (ctx, 0.9); - asb_context_set_flags (ctx, ASB_CONTEXT_FLAG_ADD_CACHE_ID | - ASB_CONTEXT_FLAG_NO_NETWORK | + asb_context_set_flags (ctx, ASB_CONTEXT_FLAG_NO_NETWORK | ASB_CONTEXT_FLAG_INCLUDE_FAILED | ASB_CONTEXT_FLAG_HIDPI_ICONS); asb_context_set_basename (ctx, "appstream"); @@ -349,21 +348,6 @@ asb_test_context_test_func (AsbTestContextMode mode) asb_context_set_output_dir (ctx, "/tmp/asbuilder/output"); asb_context_set_temp_dir (ctx, "/tmp/asbuilder/temp"); asb_context_set_icons_dir (ctx, "/tmp/asbuilder/temp/icons"); - switch (mode) { - case ASB_TEST_CONTEXT_MODE_WITH_CACHE: - asb_context_set_old_metadata (ctx, "/tmp/asbuilder/output"); - break; - case ASB_TEST_CONTEXT_MODE_WITH_OLD_CACHE: - { - g_autofree gchar *old_cache_dir = NULL; - old_cache_dir = asb_test_get_filename ("."); - asb_context_set_old_metadata (ctx, old_cache_dir); - } - break; - default: - break; - } - g_assert (asb_context_get_flag (ctx, ASB_CONTEXT_FLAG_ADD_CACHE_ID)); g_assert_cmpstr (asb_context_get_temp_dir (ctx), ==, "/tmp/asbuilder/temp"); loader = asb_context_get_plugin_loader (ctx); asb_plugin_loader_set_dir (loader, TESTPLUGINDIR); @@ -384,16 +368,7 @@ asb_test_context_test_func (AsbTestContextMode mode) } /* verify queue size */ - switch (mode) { - case ASB_TEST_CONTEXT_MODE_NO_CACHE: - case ASB_TEST_CONTEXT_MODE_WITH_OLD_CACHE: - g_assert_cmpint (asb_context_get_packages(ctx)->len, ==, 9); - break; - default: - /* no packages should need extracting */ - g_assert_cmpint (asb_context_get_packages(ctx)->len, ==, 0); - break; - } + g_assert_cmpint (asb_context_get_packages(ctx)->len, ==, 9); /* run the plugins */ ret = asb_context_process (ctx, &error); @@ -426,7 +401,7 @@ asb_test_context_test_func (AsbTestContextMode mode) /* check it matches what we expect */ xml = as_store_to_xml (store, AS_NODE_TO_XML_FLAG_FORMAT_MULTILINE); expected_xml = - "<components builder_id=\"appstream-glib:4\" origin=\"asb-self-test\" version=\"0.9\">\n" + "<components origin=\"asb-self-test\" version=\"0.9\">\n" #ifdef HAVE_FONTS "<component type=\"font\">\n" "<id>Liberation</id>\n" @@ -444,7 +419,11 @@ asb_test_context_test_func (AsbTestContextMode mode) "<project_license>GPL-2.0+</project_license>\n" "<url type=\"homepage\">http://fedorahosted.org/liberation-fonts/</url>\n" "<screenshots>\n" - "<screenshot type=\"default\" priority=\"-32\">\n" + "<screenshot type=\"default\">\n" + "<caption>Liberation Serif – Regular</caption>\n" + "<image type=\"source\" height=\"48\" width=\"640\">file:/LiberationSerif-" AS_TEST_WILDCARD_MD5 ".png</image>\n" + "</screenshot>\n" + "<screenshot priority=\"-32\">\n" "<caption>Liberation Serif – Bold</caption>\n" "<image type=\"source\" height=\"48\" width=\"640\">file:/LiberationSerif-" AS_TEST_WILDCARD_MD5 ".png</image>\n" "</screenshot>\n" @@ -455,9 +434,6 @@ asb_test_context_test_func (AsbTestContextMode mode) "<languages>\n" "<lang>en</lang>\n" "</languages>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">font-1-1.fc21.noarch.rpm</value>\n" - "</metadata>\n" "</component>\n" #endif "<component type=\"addon\">\n" @@ -468,9 +444,6 @@ asb_test_context_test_func (AsbTestContextMode mode) "<project_license>GPL-2.0+</project_license>\n" "<url type=\"homepage\">http://people.freedesktop.org/</url>\n" "<extends>app.desktop</extends>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">app-1-1.fc25.x86_64.rpm</value>\n" - "</metadata>\n" "</component>\n" "<component type=\"addon\">\n" "<id>app-extra</id>\n" @@ -481,9 +454,6 @@ asb_test_context_test_func (AsbTestContextMode mode) "<project_license>GPL-2.0+</project_license>\n" "<url type=\"homepage\">http://people.freedesktop.org/</url>\n" "<extends>app.desktop</extends>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">app-extra-1-1.fc25.noarch.rpm</value>\n" - "</metadata>\n" "</component>\n" "<component type=\"desktop\">\n" "<id>app.desktop</id>\n" @@ -524,9 +494,6 @@ asb_test_context_test_func (AsbTestContextMode mode) "<lang percentage=\"100\">en_GB</lang>\n" "<lang percentage=\"33\">ru</lang>\n" "</languages>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">app-1-1.fc25.x86_64.rpm</value>\n" - "</metadata>\n" "</component>\n" #ifdef HAVE_GCAB "<component type=\"firmware\">\n" @@ -554,9 +521,6 @@ asb_test_context_test_func (AsbTestContextMode mode) "<provides>\n" "<firmware type=\"flashed\">84f40464-9272-4ef7-9399-cd95f12da696</firmware>\n" "</provides>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">colorhug-als-2.0.2.cab</value>\n" - "</metadata>\n" "</component>\n" #endif "</components>\n"; @@ -579,7 +543,7 @@ asb_test_context_test_func (AsbTestContextMode mode) /* check output */ xml_failed = as_store_to_xml (store_failed, AS_NODE_TO_XML_FLAG_FORMAT_MULTILINE); expected_xml = - "<components builder_id=\"appstream-glib:4\" origin=\"asb-self-test-failed\" version=\"0.9\">\n" + "<components origin=\"asb-self-test-failed\" version=\"0.9\">\n" #ifdef HAVE_FONTS "<component type=\"font\">\n" "<id>LiberationSerif</id>\n" @@ -599,7 +563,11 @@ asb_test_context_test_func (AsbTestContextMode mode) "<url type=\"homepage\">http://people.freedesktop.org/</url>\n" "<extends>Liberation</extends>\n" "<screenshots>\n" - "<screenshot type=\"default\" priority=\"-32\">\n" + "<screenshot type=\"default\">\n" + "<caption>Liberation Serif – Regular</caption>\n" + "<image type=\"source\" height=\"48\" width=\"640\">file:/LiberationSerif-" AS_TEST_WILDCARD_MD5 ".png</image>\n" + "</screenshot>\n" + "<screenshot priority=\"-32\">\n" "<caption>Liberation Serif – Bold</caption>\n" "<image type=\"source\" height=\"48\" width=\"640\">file:/LiberationSerif-" AS_TEST_WILDCARD_MD5 ".png</image>\n" "</screenshot>\n" @@ -610,9 +578,6 @@ asb_test_context_test_func (AsbTestContextMode mode) "<languages>\n" "<lang>en</lang>\n" "</languages>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">font-serif-1-1.fc21.noarch.rpm</value>\n" - "</metadata>\n" "</component>\n" #endif "</components>\n"; @@ -630,41 +595,26 @@ asb_test_context_test_func (AsbTestContextMode mode) /* check output */ xml_ignore = as_store_to_xml (store_ignore, AS_NODE_TO_XML_FLAG_FORMAT_MULTILINE); expected_xml = - "<components builder_id=\"appstream-glib:4\" origin=\"asb-self-test-ignore\" version=\"0.9\">\n" + "<components origin=\"asb-self-test-ignore\" version=\"0.9\">\n" "<component type=\"generic\">\n" "<id>app-console.noarch</id>\n" "<pkgname>app-console</pkgname>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">app-console-1-1.fc25.noarch.rpm</value>\n" - "</metadata>\n" "</component>\n" "<component type=\"generic\">\n" "<id>app.i686</id>\n" "<pkgname>app</pkgname>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">app-1-1.fc25.i686.rpm</value>\n" - "</metadata>\n" "</component>\n" "<component type=\"generic\">\n" "<id>composite.x86_64</id>\n" "<pkgname>composite</pkgname>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">composite-1-1.fc21.x86_64.rpm</value>\n" - "</metadata>\n" "</component>\n" "<component type=\"generic\">\n" "<id>font-serif.noarch</id>\n" "<pkgname>font-serif</pkgname>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">font-serif-1-1.fc21.noarch.rpm</value>\n" - "</metadata>\n" "</component>\n" "<component type=\"generic\">\n" "<id>test.noarch</id>\n" "<pkgname>test</pkgname>\n" - "<metadata>\n" - "<value key=\"X-CacheID\">test-0.1-1.fc21.noarch.rpm</value>\n" - "</metadata>\n" "</component>\n" "</components>\n"; ret = asb_test_compare_lines (xml_ignore->str, expected_xml, &error); @@ -675,66 +625,6 @@ asb_test_context_test_func (AsbTestContextMode mode) g_assert (g_file_test ("/tmp/asbuilder/temp/icons/64x64/app.png", G_FILE_TEST_EXISTS)); g_assert (g_file_test ("/tmp/asbuilder/temp/icons/128x128/app.png", G_FILE_TEST_EXISTS)); g_assert (!g_file_test ("/tmp/asbuilder/temp/icons/app.png", G_FILE_TEST_EXISTS)); -} -#endif - -static void -asb_test_context_nocache_func (void) -{ - GError *error = NULL; - gboolean ret; - - /* remove icons */ - ret = asb_utils_rmtree ("/tmp/asbuilder/temp/icons", &error); - g_assert_no_error (error); - g_assert (ret); - -#ifdef HAVE_RPM - ret = asb_utils_rmtree ("/tmp/asbuilder/output", &error); - g_assert_no_error (error); - g_assert (ret); - asb_test_context_test_func (ASB_TEST_CONTEXT_MODE_NO_CACHE); -#endif -} - -static void -asb_test_context_cache_func (void) -{ -return; -#ifdef HAVE_RPM - GError *error = NULL; - gboolean ret; - - /* remove icons */ - ret = asb_utils_rmtree ("/tmp/asbuilder/temp/icons", &error); - g_assert_no_error (error); - g_assert (ret); - - /* run again, this time using the old metadata as a cache */ - asb_test_context_test_func (ASB_TEST_CONTEXT_MODE_WITH_CACHE); - - /* remove temp space */ - ret = asb_utils_rmtree ("/tmp/asbuilder", &error); - g_assert_no_error (error); - g_assert (ret); -#endif -} - -static void -asb_test_context_oldcache_func (void) -{ -return; -#ifdef HAVE_RPM - GError *error = NULL; - gboolean ret; - - /* run again, this time using the old metadata as a cache */ - asb_test_context_test_func (ASB_TEST_CONTEXT_MODE_WITH_OLD_CACHE); - - /* remove temp space */ - ret = asb_utils_rmtree ("/tmp/asbuilder", &error); - g_assert_no_error (error); - g_assert (ret); #endif } @@ -875,9 +765,7 @@ main (int argc, char **argv) g_test_add_func ("/AppStreamBuilder/utils{glob}", asb_test_utils_glob_func); g_test_add_func ("/AppStreamBuilder/plugin-loader", asb_test_plugin_loader_func); g_test_add_func ("/AppStreamBuilder/firmware", asb_test_firmware_func); - g_test_add_func ("/AppStreamBuilder/context{no-cache}", asb_test_context_nocache_func); - g_test_add_func ("/AppStreamBuilder/context{cache}", asb_test_context_cache_func); - g_test_add_func ("/AppStreamBuilder/context{old-cache}", asb_test_context_oldcache_func); + g_test_add_func ("/AppStreamBuilder/context", asb_test_context_func); #ifdef HAVE_RPM g_test_add_func ("/AppStreamBuilder/package{rpm}", asb_test_package_rpm_func); #endif diff --git a/libappstream-builder/asb-task.c b/libappstream-builder/asb-task.c index a458de6..2de0bc3 100644 --- a/libappstream-builder/asb-task.c +++ b/libappstream-builder/asb-task.c @@ -320,7 +320,6 @@ asb_task_process (AsbTask *task, GError **error_not_used) GList *l; GPtrArray *array; gboolean ret; - gchar *cache_id; guint i; guint nr_added = 0; g_autoptr(GError) error = NULL; @@ -358,15 +357,6 @@ asb_task_process (AsbTask *task, GError **error_not_used) app2 = asb_app_new (priv->pkg, as_app_get_id (app_tmp)); as_app_subsume (AS_APP (app2), app_tmp); asb_context_add_app (priv->ctx, app2); - - /* set cache-id in case we want to use the metadata directly */ - if (asb_context_get_flag (priv->ctx, ASB_CONTEXT_FLAG_ADD_CACHE_ID)) { - cache_id = asb_utils_get_cache_id_for_filename (priv->filename); - as_app_add_metadata (AS_APP (app2), - "X-CacheID", - cache_id); - g_free (cache_id); - } nr_added++; } g_debug ("added %u apps from archive", apps_tmp->len); @@ -527,15 +517,6 @@ asb_task_process (AsbTask *task, GError **error_not_used) goto skip; } - /* set cache-id in case we want to use the metadata directly */ - if (asb_context_get_flag (priv->ctx, ASB_CONTEXT_FLAG_ADD_CACHE_ID)) { - cache_id = asb_utils_get_cache_id_for_filename (priv->filename); - as_app_add_metadata (AS_APP (app), - "X-CacheID", - cache_id); - g_free (cache_id); - } - /* set the VCS information into the metadata */ if (asb_package_get_vcs (priv->pkg) != NULL) { as_app_add_metadata (AS_APP (app), @@ -556,11 +537,6 @@ asb_task_process (AsbTask *task, GError **error_not_used) nr_added++; } skip: - /* add a dummy element to the AppStream metadata so that we don't keep - * parsing this every time */ - if (asb_context_get_flag (priv->ctx, ASB_CONTEXT_FLAG_ADD_CACHE_ID) && nr_added == 0) - asb_context_add_app_ignore (priv->ctx, priv->pkg); - /* delete tree */ g_debug ("deleting temp files: %s", asb_package_get_name (priv->pkg)); if (!asb_utils_rmtree (priv->tmpdir, &error)) { |