diff --git a/include/swupd.h b/include/swupd.h index ddef8b7b..23296183 100644 --- a/include/swupd.h +++ b/include/swupd.h @@ -142,10 +142,10 @@ extern int main_update(void); extern int add_included_manifests(struct manifest *mom); extern int main_verify(int current_version); -extern int try_version_download(void); +extern int get_latest_version(void); extern void read_versions(int *current_version, int *server_version, char *path_prefix); extern int check_versions(int *current_version, int *server_version, char *path_prefix); -extern int read_version_from_subvol_file(char *path_prefix); +extern int get_current_version(char *path_prefix); extern bool check_network(void); diff --git a/src/bundle.c b/src/bundle.c index bc62cb21..f7e30c3a 100644 --- a/src/bundle.c +++ b/src/bundle.c @@ -61,7 +61,7 @@ int list_installable_bundles() return EXIT_FAILURE; } - current_version = read_version_from_subvol_file(path_prefix); + current_version = get_current_version(path_prefix); if (current_version < 0) { printf("Error: Unable to determine current OS version\n"); return ECURRENT_VERSION; @@ -240,7 +240,7 @@ int remove_bundle(const char *bundle_name) goto out_free_curl; } - current_version = read_version_from_subvol_file(path_prefix); + current_version = get_current_version(path_prefix); if (current_version < 0) { printf("Error: Unable to determine current OS version\n"); return ECURRENT_VERSION; @@ -495,7 +495,7 @@ int install_bundles_frontend(char **bundles) return ret; } - current_version = read_version_from_subvol_file(path_prefix); + current_version = get_current_version(path_prefix); if (current_version < 0) { printf("Error: Unable to determine current OS version\n"); return ECURRENT_VERSION; diff --git a/src/search.c b/src/search.c index ef94ed35..42f825e7 100644 --- a/src/search.c +++ b/src/search.c @@ -400,7 +400,7 @@ int download_manifests(struct manifest **MoM) double size; bool did_download = false; - current_version = read_version_from_subvol_file(path_prefix); + current_version = get_current_version(path_prefix); if (current_version < 0) { printf("Error: Unable to determine current OS version\n"); return ECURRENT_VERSION; diff --git a/src/verify.c b/src/verify.c index 211c3c72..8e4e571c 100644 --- a/src/verify.c +++ b/src/verify.c @@ -608,7 +608,7 @@ int verify_main(int argc, char **argv) /* Gather current manifests */ if (!version) { - version = read_version_from_subvol_file(path_prefix); + version = get_current_version(path_prefix); if (version < 0) { printf("Error: Unable to determine current OS version\n"); free_globals(); @@ -617,7 +617,7 @@ int verify_main(int argc, char **argv) } if (version == -1) { - version = try_version_download(); + version = get_latest_version(); if (version == -1) { printf("Unable to get latest version for install\n"); v_lockfile(lock_fd); diff --git a/src/version.c b/src/version.c index 401a3b2d..090be2e6 100644 --- a/src/version.c +++ b/src/version.c @@ -34,7 +34,7 @@ /* this function attempts to download the latest server version string file from * the preferred server to a memory buffer, returning either a negative integer * error code or >= 0 representing the server version */ -int try_version_download(void) +int get_latest_version(void) { char *url = NULL; char *path = NULL; @@ -71,7 +71,7 @@ bool check_network(void) int ret; if (!have_network) { - ret = try_version_download(); + ret = get_latest_version(); if (ret < 0) { have_network = false; } else { @@ -82,7 +82,7 @@ bool check_network(void) return have_network; } -int read_version_from_subvol_file(char *path_prefix) +int get_current_version(char *path_prefix) { char line[LINE_MAX]; FILE *file; @@ -137,10 +137,10 @@ void read_versions(int *current_version, int *server_version, char *path_prefix) { - *current_version = read_version_from_subvol_file(path_prefix); + *current_version = get_current_version(path_prefix); printf("Querying server version.\n"); - *server_version = try_version_download(); + *server_version = get_latest_version(); } int check_versions(int *current_version,