From 56efd14d27e6f80cfecbd3a860e84fdc71084510 Mon Sep 17 00:00:00 2001 From: Tudor Marcu Date: Mon, 17 Apr 2017 23:58:23 -0700 Subject: [PATCH] Fix download/extract pack message Swupd incorrectly says "Downloading pack ..." even if it does not really download the pack. Fix this by saying downloading packs and only printing if we downloaded a pack to extract. Signed-off-by: Tudor Marcu --- src/bundle.c | 1 - src/packs.c | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bundle.c b/src/bundle.c index c61eabbd..f2f6e5b8 100644 --- a/src/bundle.c +++ b/src/bundle.c @@ -466,7 +466,6 @@ static int install_bundles(struct list *bundles, struct list **subs, int current grabtime_start(×, "Download packs"); (void)rm_staging_dir_contents("download"); - printf("Downloading packs...\n"); (void)download_subscribed_packs(*subs, true); grabtime_stop(×); diff --git a/src/packs.c b/src/packs.c index 0f7d0341..c64e48c0 100644 --- a/src/packs.c +++ b/src/packs.c @@ -52,8 +52,6 @@ static int download_pack(int oldversion, int newversion, char *module) return 0; } - printf("Downloading %s pack for version %i\n", module, newversion); - string_or_die(&url, "%s/%i/pack-%s-from-%i.tar", content_url, newversion, module, oldversion); err = swupd_curl_get_file(url, filename, NULL, NULL, true); @@ -68,7 +66,7 @@ static int download_pack(int oldversion, int newversion, char *module) free(url); - printf("Extracting pack.\n"); + printf("Extracting %s pack for version %i\n", module, newversion); string_or_die(&tar, TAR_COMMAND " -C %s " TAR_PERM_ATTR_ARGS " -xf %s/pack-%s-from-%i-to-%i.tar 2> /dev/null", state_dir, state_dir, module, oldversion, newversion); @@ -104,6 +102,7 @@ int download_subscribed_packs(struct list *subs, bool required) return -ENOSWUPDSERVER; } + printf("Downloading packs...\n"); iter = list_head(subs); while (iter) { sub = iter->data;