List enabled features in output for --version arg
authorTomas Mlcoch <tmlcoch@redhat.com>
Fri, 11 Mar 2016 11:36:57 +0000 (12:36 +0100)
committerTomas Mlcoch <tmlcoch@redhat.com>
Fri, 11 Mar 2016 11:41:27 +0000 (12:41 +0100)
This patch adds use of cr_version_string_with_features()
when --version info output is printed to stdout
and when version string is printed into verbose log.

This will help with debuging issues caused by a specific
feature enabled during compilation time.

Signed-off-by: Tomas Mlcoch <tmlcoch@redhat.com>
src/createrepo_c.c
src/mergerepo_c.c
src/modifyrepo_c.c
src/sqliterepo_c.c

index 5bb13e06aa8af270341be7fe850f0f140e110cbc..32325a28126e70cdbd6303e40a084069f82126b6 100644 (file)
@@ -334,9 +334,7 @@ main(int argc, char **argv)
     // Arguments pre-check
     if (cmd_options->version) {
         // Just print version
-        printf("Version: %d.%d.%d\n", CR_VERSION_MAJOR,
-                                      CR_VERSION_MINOR,
-                                      CR_VERSION_PATCH);
+        printf("Version: %s\n", cr_version_string_with_features());
         free_options(cmd_options);
         exit(EXIT_SUCCESS);
     }
@@ -388,9 +386,7 @@ main(int argc, char **argv)
     cr_setup_logging(cmd_options->quiet, cmd_options->verbose);
 
     // Emit debug message with version
-    g_debug("Version: %d.%d.%d\n", CR_VERSION_MAJOR,
-                                   CR_VERSION_MINOR,
-                                   CR_VERSION_PATCH);
+    g_debug("Version: %s", cr_version_string_with_features());
 
     // Set paths of input and output repos
     in_repo = g_strconcat(in_dir, "repodata/", NULL);
index f6df4fc8c18ded2582a921d2d62a0dccd7faf93e..9f997a92eb11ac6016929baa2a09cde0b3f42e86 100644 (file)
@@ -1618,9 +1618,7 @@ main(int argc, char **argv)
     }
 
     if (cmd_options->version) {
-        printf("Version: %d.%d.%d\n", CR_VERSION_MAJOR,
-                                      CR_VERSION_MINOR,
-                                      CR_VERSION_PATCH);
+        printf("Version: %s\n", cr_version_string_with_features());
         free_options(cmd_options);
         exit(0);
     }
@@ -1634,9 +1632,7 @@ main(int argc, char **argv)
         return 1;
     }
 
-    g_debug("Version: %d.%d.%d\n", CR_VERSION_MAJOR,
-                                   CR_VERSION_MINOR,
-                                   CR_VERSION_PATCH);
+    g_debug("Version: %s", cr_version_string_with_features());
 
     g_thread_init(NULL); // Initialize threading
 
index 2b880e0f7f4ef3d608694161cffb3f08409d2eea..649d8b3d336cf6f1b3000259528689ace349b6f3 100644 (file)
@@ -256,9 +256,7 @@ main(int argc, char **argv)
     // Print version if required
 
     if (options.version) {
-        printf("Version: %d.%d.%d\n", CR_VERSION_MAJOR,
-                                      CR_VERSION_MINOR,
-                                      CR_VERSION_PATCH);
+        printf("Version: %s\n", cr_version_string_with_features());
         exit(EXIT_SUCCESS);
     }
 
@@ -276,9 +274,7 @@ main(int argc, char **argv)
 
     // Emit debug message with version
 
-    g_debug("Version: %d.%d.%d\n", CR_VERSION_MAJOR,
-                                   CR_VERSION_MINOR,
-                                   CR_VERSION_PATCH);
+    g_debug("Version: %s", cr_version_string_with_features());
 
     // Prepare list of tasks to do
 
index 4c2e5684f0ddaf4412fee690e6a17e4c99e8346b..f147a651265dd41c2de9244564b0df48d2b63a7d 100644 (file)
@@ -999,9 +999,7 @@ main(int argc, char **argv)
 
     // Print version if required
     if (options->version) {
-        printf("Version: %d.%d.%d\n", CR_VERSION_MAJOR,
-                                      CR_VERSION_MINOR,
-                                      CR_VERSION_PATCH);
+        printf("Version: %s\n", cr_version_string_with_features());
         exit(EXIT_SUCCESS);
     }
 
@@ -1017,9 +1015,7 @@ main(int argc, char **argv)
     }
 
     // Emit debug message with version
-    g_debug("Version: %d.%d.%d\n", CR_VERSION_MAJOR,
-                                   CR_VERSION_MINOR,
-                                   CR_VERSION_PATCH);
+    g_debug("Version: %s", cr_version_string_with_features());
 
     g_thread_init(NULL); // Initialize threading