Rename the version-getter functions

Since we are either determining the current OS version, or the latest OS
version, at any given time, rename these functions to reflect that.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2016-04-18 11:23:56 -07:00
parent 0ea8b9deb4
commit ef101ba126
5 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -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);
+3 -3
View File
@@ -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;
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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);
+5 -5
View File
@@ -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,