Add git commit and dirty status if available. Slightly reorder the debug messages at the start.

This commit is contained in:
Mike Brady
2019-04-15 16:27:44 +01:00
parent c985ee6059
commit 1b1348e1ac
2 changed files with 21 additions and 13 deletions
+8 -2
View File
@@ -83,6 +83,8 @@
#include <syslog.h>
#endif
#include "build_details.h"
#ifdef CONFIG_ALSA
void set_alsa_out_dev(char *);
#endif
@@ -1282,11 +1284,15 @@ char *get_version_string() {
char *version_string = malloc(1024);
if (version_string) {
strcpy(version_string, PACKAGE_VERSION);
if (strlen(GITDESCRIPTION)) {
strcat(version_string, "-");
strcat(version_string, GITDESCRIPTION);
}
#ifdef CONFIG_LIBDAEMON
strcat(version_string, "-libdaemon");
strcat(version_string, "-libdaemon");
#endif
#ifdef CONFIG_MBEDTLS
strcat(version_string, "-mbedTLS");
strcat(version_string, "-mbedTLS");
#endif
#ifdef CONFIG_POLARSSL
strcat(version_string, "-PolarSSL");
+13 -11
View File
@@ -1510,6 +1510,19 @@ int main(int argc, char **argv) {
// make sure the program can create files that group and world can read
umask(S_IWGRP | S_IWOTH);
/* print out version */
char *version_dbs = get_version_string();
if (version_dbs) {
debug(1, "software version: \"%s\"", version_dbs);
free(version_dbs);
} else {
debug(1, "can't print the version information!");
}
debug(1, "log verbosity is %d.", debuglev);
config.output = audio_get_output(config.output_name);
if (!config.output) {
audio_ls_outputs();
@@ -1555,18 +1568,7 @@ int main(int argc, char **argv) {
BUFFER_FRAMES * 352 - 22050);
}
/* print out version */
char *version_dbs = get_version_string();
if (version_dbs) {
debug(1, "software version: \"%s\"", version_dbs);
free(version_dbs);
} else {
debug(1, "can't print the version information!");
}
/* Print out options */
debug(1, "log verbosity is %d.", debuglev);
debug(1, "disable resend requests is %s.", config.disable_resend_requests ? "on" : "off");
debug(1, "diagnostic_drop_packet_fraction is %f. A value of 0.0 means no packets will be dropped "
"deliberately.",