From 1abd798b447225cbda95254abc343ef15d073334 Mon Sep 17 00:00:00 2001 From: Otavio Pontes Date: Thu, 21 Mar 2019 10:31:04 -0700 Subject: [PATCH] manifest: Don't process header actions anymore Post_update_actions were not being executed so we don't need to parse them. Signed-off-by: Otavio Pontes --- src/globals.c | 2 -- src/manifest.c | 17 ++++------------- src/swupd.h | 1 - 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/globals.c b/src/globals.c index 8c65e0c8..44d4e053 100644 --- a/src/globals.c +++ b/src/globals.c @@ -47,7 +47,6 @@ bool need_update_boot = false; bool need_update_bootloader = false; bool need_systemd_reexec = false; bool update_complete = false; -struct list *post_update_actions = NULL; bool ignore_orphans = true; char *format_string = NULL; char *path_prefix = NULL; /* must always end in '/' */ @@ -519,7 +518,6 @@ void free_globals(void) free_string(&format_string); free_string(&mounted_dirs); free_string(&state_dir); - list_free_list(post_update_actions); free_string(&bundle_to_add); timelist_free(global_times); global_times = NULL; diff --git a/src/manifest.c b/src/manifest.c index a27934c0..96ea4556 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -90,7 +90,7 @@ static struct manifest *alloc_manifest(int version, char *component) return manifest; } -static struct manifest *manifest_from_file(int version, char *component, bool header_only, bool latest, bool is_mix) +static struct manifest *manifest_from_file(int version, char *component, bool header_only, bool is_mix) { FILE *infile; char line[MANIFEST_LINE_MAXLEN], *c, *c2; @@ -203,15 +203,6 @@ static struct manifest *manifest_from_file(int version, char *component, bool he goto err_close; } } - if (latest && strncmp(component, "MoM", 3) == 0) { - if (strncmp(line, "actions:", 8) == 0) { - post_update_actions = list_prepend_data(post_update_actions, strdup_or_die(c)); - if (!post_update_actions->data) { - warn("Unable to read post update action from Manifest.MoM. \ - Another update or verify may be required.\n"); - } - } - } if (strncmp(line, "includes:", 9) == 0) { includes = list_prepend_data(includes, strdup_or_die(c)); } @@ -606,7 +597,7 @@ retry_load: return NULL; } - manifest = manifest_from_file(version, "MoM", false, latest, mix_exists); + manifest = manifest_from_file(version, "MoM", false, mix_exists); if (manifest == NULL) { if (retried == false) { @@ -721,7 +712,7 @@ retry_load: return NULL; } - manifest = manifest_from_file(version, file->filename, header_only, false, file->is_mix); + manifest = manifest_from_file(version, file->filename, header_only, file->is_mix); if (manifest == NULL) { if (retried == false) { @@ -753,7 +744,7 @@ struct manifest *load_manifest_full(int version, bool mix) return NULL; } - manifest = manifest_from_file(version, "full", false, false, false); + manifest = manifest_from_file(version, "full", false, false); if (manifest == NULL) { error("Failed to load %d Manifest.full\n", version); diff --git a/src/swupd.h b/src/swupd.h index f23eaac3..2b5742bb 100644 --- a/src/swupd.h +++ b/src/swupd.h @@ -105,7 +105,6 @@ extern bool update_complete; extern bool need_update_boot; extern bool need_update_bootloader; extern bool need_systemd_reexec; -extern struct list *post_update_actions; extern bool keepcache; extern curl_off_t total_curl_sz;