Add helper function to create version string

And remove all the duplicate code.

Depending on the situation prof_get_version() will return:
* 0.13.1
* 0.13.1dev
* 0.13.1dev.master.69d8c1f9
This commit is contained in:
Michael Vetter
2023-07-25 20:58:15 +02:00
parent 13af6c96dc
commit 22b1d14b67
9 changed files with 35 additions and 89 deletions

View File

@@ -35,10 +35,6 @@
*/
#include "config.h"
#ifdef HAVE_GIT_VERSION
#include "gitversion.h"
#endif
#ifdef HAVE_GTK
#include "ui/tray.h"
#endif
@@ -180,15 +176,8 @@ _init(char* log_level, char* config_file, char* log_file, char* theme_name)
log_init(prof_log_level, log_file);
log_stderr_init(PROF_LEVEL_ERROR);
if (strcmp(PACKAGE_STATUS, "development") == 0) {
#ifdef HAVE_GIT_VERSION
log_info("Starting Profanity (%sdev.%s.%s)…", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
#else
log_info("Starting Profanity (%sdev)…", PACKAGE_VERSION);
#endif
} else {
log_info("Starting Profanity (%s)…", PACKAGE_VERSION);
}
auto_gchar gchar* prof_version = prof_get_version();
log_info("Starting Profanity (%s)…", prof_version);
chat_log_init();
groupchat_log_init();