diff --git a/include/swupd.h b/include/swupd.h index ed97c246..471f5063 100644 --- a/include/swupd.h +++ b/include/swupd.h @@ -165,7 +165,7 @@ extern void account_delta_hit(void); extern void account_delta_miss(void); extern void print_statistics(int version1, int version2); -extern int download_subscribed_packs(int oldversion, int newversion, bool required); +extern int download_subscribed_packs(bool required); extern void try_delta(struct file *file); extern void full_download(struct file *file); diff --git a/src/bundle.c b/src/bundle.c index 478e77d9..626594fe 100644 --- a/src/bundle.c +++ b/src/bundle.c @@ -406,7 +406,7 @@ int install_bundles(struct list *bundles, int current_version, struct manifest * (void)rm_staging_dir_contents("download"); printf("Downloading required packs...\n"); - ret = download_subscribed_packs(0, current_version, true); + ret = download_subscribed_packs(true); if (ret != 0) { printf("pack downloads failed, cannot proceed with the installation, exiting.\n"); goto out; diff --git a/src/packs.c b/src/packs.c index 0c70c899..4ce40753 100644 --- a/src/packs.c +++ b/src/packs.c @@ -96,7 +96,7 @@ static int download_pack(int oldversion, int newversion, char *module) } /* pull in packs for base and any subscription */ -int download_subscribed_packs(int oldversion, int UNUSED_PARAM newversion, bool required) +int download_subscribed_packs(bool required) { struct list *iter; struct sub *sub = NULL; @@ -115,11 +115,7 @@ int download_subscribed_packs(int oldversion, int UNUSED_PARAM newversion, bool continue; } - if (oldversion != 0) { - oldversion = sub->oldversion; - } - - err = download_pack(oldversion, sub->version, sub->component); + err = download_pack(sub->oldversion, sub->version, sub->component); if (err < 0) { if (required) { return err; diff --git a/src/update.c b/src/update.c index ef11c657..80b0d8eb 100644 --- a/src/update.c +++ b/src/update.c @@ -332,7 +332,7 @@ load_server_manifests: download_packs: /* Step 5: get the packs and untar */ - ret = download_subscribed_packs(current_version, server_version, false); + ret = download_subscribed_packs(false); if (ret == -ENONET) { // packs don't always exist, tolerate that but not ENONET if (retries < MAX_TRIES) { diff --git a/src/verify.c b/src/verify.c index db5c8f05..93c712c6 100644 --- a/src/verify.c +++ b/src/verify.c @@ -228,13 +228,13 @@ static bool hash_needs_work(struct file *file, char *hash) } } -static int get_all_files(int version, struct manifest *official_manifest) +static int get_all_files(struct manifest *official_manifest) { int ret; struct list *iter; /* for install we need everything so synchronously download zero packs */ - ret = download_subscribed_packs(0, version, true); + ret = download_subscribed_packs(true); if (ret < 0) { // require zero pack /* If we hit this point, we know we have a network connection, therefore * the error is server-side. This is also a critical error, so detailed @@ -356,10 +356,10 @@ RETRY_DOWNLOADS: } /* allow optimization of install case */ -static int get_required_files(int version, struct manifest *official_manifest) +static int get_required_files(struct manifest *official_manifest) { if (cmdline_option_install) { - return get_all_files(version, official_manifest); + return get_all_files(official_manifest); } if (cmdline_option_fix) { @@ -671,7 +671,7 @@ int verify_main(int argc, char **argv) if (cmdline_option_fix || cmdline_option_install) { /* when fixing or installing we need input files. */ - ret = get_required_files(version, official_manifest); + ret = get_required_files(official_manifest); if (ret != 0) { goto brick_the_system_and_clean_curl; }