Blob Blame History Raw
From: Andrew Beekhof <andrew@beekhof.net>
Date: Wed, 16 Sep 2015 09:14:39 +1000
Subject: [PATCH] Log: The package version is more informative

(cherry picked from commit 2b4d195e9e94777fc1953832fcce3637ffa2f449)
---
 crmd/cib.c         | 2 +-
 crmd/election.c    | 2 +-
 crmd/main.c        | 5 ++---
 lib/ais/plugin.c   | 2 +-
 lib/common/utils.c | 4 ++--
 mcp/pacemaker.c    | 4 ++--
 6 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/crmd/cib.c b/crmd/cib.c
index 7ec5eda..41e9efb 100644
--- a/crmd/cib.c
+++ b/crmd/cib.c
@@ -113,7 +113,7 @@ revision_check_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, vo
     cmp = compare_version(revision, CRM_FEATURE_SET);
 
     if (cmp > 0) {
-        crm_err("This build (%s) does not support the current resource configuration", VERSION);
+        crm_err("This build (%s) does not support the current resource configuration", PACEMAKER_VERSION);
         crm_err("We can only support up to CRM feature set %s (current=%s)",
                 CRM_FEATURE_SET, revision);
         crm_err("Shutting down the CRM");
diff --git a/crmd/election.c b/crmd/election.c
index b542a66..adab4e3 100644
--- a/crmd/election.c
+++ b/crmd/election.c
@@ -215,7 +215,7 @@ do_dc_takeover(long long action,
     }
 
     update_attr_delegate(fsa_cib_conn, cib_none, XML_CIB_TAG_CRMCONFIG, NULL, NULL, NULL, NULL,
-                         "dc-version", VERSION "-" BUILD_VERSION, FALSE, NULL, NULL);
+                         "dc-version", PACEMAKER_VERSION "-" BUILD_VERSION, FALSE, NULL, NULL);
 
     update_attr_delegate(fsa_cib_conn, cib_none, XML_CIB_TAG_CRMCONFIG, NULL, NULL, NULL, NULL,
                          "cluster-infrastructure", cluster_type, FALSE, NULL, NULL);
diff --git a/crmd/main.c b/crmd/main.c
index e9a69b4..75ed91c 100644
--- a/crmd/main.c
+++ b/crmd/main.c
@@ -89,13 +89,12 @@ main(int argc, char **argv)
         crmd_metadata();
         return 0;
     } else if (argc - optind == 1 && safe_str_eq("version", argv[optind])) {
-        fprintf(stdout, "CRM Version: ");
-        fprintf(stdout, "%s (%s)\n", VERSION, BUILD_VERSION);
+        fprintf(stdout, "CRM Version: %s (%s)\n", PACEMAKER_VERSION, BUILD_VERSION);
         return 0;
     }
 
     crm_log_init(NULL, LOG_INFO, TRUE, FALSE, argc, argv, FALSE);
-    crm_notice("CRM Git Version: %s\n", BUILD_VERSION);
+    crm_notice("CRM Git Version: %s (%s)\n", PACEMAKER_VERSION, BUILD_VERSION);
 
     if (optind > argc) {
         ++argerr;
diff --git a/lib/ais/plugin.c b/lib/ais/plugin.c
index ab534fa..cf2a131 100644
--- a/lib/ais/plugin.c
+++ b/lib/ais/plugin.c
@@ -201,7 +201,7 @@ static struct corosync_exec_handler pcmk_exec_service[] = {
  */
 /* *INDENT-OFF* */
 struct corosync_service_engine pcmk_service_handler = {
-    .name			= (char *)"Pacemaker Cluster Manager "PACKAGE_VERSION,
+    .name			= (char *)"Pacemaker Cluster Manager "PACEMAKER_VERSION,
     .id				= PCMK_SERVICE_ID,
     .private_data_size		= 0,
     .flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED,
diff --git a/lib/common/utils.c b/lib/common/utils.c
index 628cf2f..2364f5c 100644
--- a/lib/common/utils.c
+++ b/lib/common/utils.c
@@ -1603,13 +1603,13 @@ crm_help(char cmd, int exit_code)
     FILE *stream = (exit_code ? stderr : stdout);
 
     if (cmd == 'v' || cmd == '$') {
-        fprintf(stream, "Pacemaker %s\n", VERSION);
+        fprintf(stream, "Pacemaker %s\n", PACEMAKER_VERSION);
         fprintf(stream, "Written by Andrew Beekhof\n");
         goto out;
     }
 
     if (cmd == '!') {
-        fprintf(stream, "Pacemaker %s (Build: %s): %s\n", VERSION, BUILD_VERSION, CRM_FEATURES);
+        fprintf(stream, "Pacemaker %s (Build: %s): %s\n", PACEMAKER_VERSION, BUILD_VERSION, CRM_FEATURES);
         goto out;
     }
 
diff --git a/mcp/pacemaker.c b/mcp/pacemaker.c
index 9f00a21..910d154 100644
--- a/mcp/pacemaker.c
+++ b/mcp/pacemaker.c
@@ -972,7 +972,7 @@ main(int argc, char **argv)
                 shutdown = TRUE;
                 break;
             case 'F':
-                printf("Pacemaker %s (Build: %s)\n Supporting v%s: %s\n", VERSION, BUILD_VERSION,
+                printf("Pacemaker %s (Build: %s)\n Supporting v%s: %s\n", PACEMAKER_VERSION, BUILD_VERSION,
                        CRM_FEATURE_SET, CRM_FEATURES);
                 crm_exit(pcmk_ok);
             default:
@@ -1039,7 +1039,7 @@ main(int argc, char **argv)
         crm_exit(ENODATA);
     }
 
-    crm_notice("Starting Pacemaker %s (Build: %s): %s", VERSION, BUILD_VERSION, CRM_FEATURES);
+    crm_notice("Starting Pacemaker %s (Build: %s): %s", PACEMAKER_VERSION, BUILD_VERSION, CRM_FEATURES);
     mainloop = g_main_new(FALSE);
     sysrq_init();