Fix download/extract pack message

Swupd incorrectly says "Downloading pack <name>..." 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 <tudor.marcu@intel.com>
This commit is contained in:
Tudor Marcu
2017-04-19 10:12:51 -07:00
committed by tmarcu
parent 2c0019ba95
commit 56efd14d27
2 changed files with 2 additions and 4 deletions
-1
View File
@@ -466,7 +466,6 @@ static int install_bundles(struct list *bundles, struct list **subs, int current
grabtime_start(&times, "Download packs");
(void)rm_staging_dir_contents("download");
printf("Downloading packs...\n");
(void)download_subscribed_packs(*subs, true);
grabtime_stop(&times);
+2 -3
View File
@@ -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;