Skip to content

Commit

Permalink
Merge pull request #168 from pi-hole/tweak/versiondisplay_travis
Browse files Browse the repository at this point in the history
Improve version display
  • Loading branch information
DL6ER authored Dec 10, 2017
2 parents e3a63d3 + c9d990f commit 888bda2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion args.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ void parse_args(int argc, char* argv[])
if(strcmp(argv[i], "-v") == 0 ||
strcmp(argv[i], "version") == 0)
{
if(strcmp(GIT_BRANCH, "master") == 0)
char version[] = GIT_VERSION;
// Check if version is of format vX.YY
// '.' can never be part of a commit hash
if(strstr(version, ".") != NULL)
printf("%s\n",GIT_VERSION);
else
printf("vDev-%s\n",GIT_HASH);
Expand Down
3 changes: 2 additions & 1 deletion log.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ void log_counter_info(void)
void log_FTL_version(void)
{
logg("FTL branch: %s", GIT_BRANCH);
logg("FTL hash: %s", GIT_VERSION);
logg("FTL version: %s", GIT_VERSION);
logg("FTL tag: %s", GIT_TAG);
logg("FTL date: %s", GIT_DATE);
logg("FTL user: %s", username);
}
3 changes: 2 additions & 1 deletion request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,8 @@ void getVersion(int *sock)
{
char server_message[SOCKETBUFFERLEN];

if(strcmp(GIT_BRANCH, "master") == 0)
char version[] = GIT_VERSION;
if(strstr(version, ".") != NULL)
sprintf(server_message,"version %s\ntag %s\nbranch %s\ndate %s\n", GIT_VERSION, GIT_TAG, GIT_BRANCH, GIT_DATE);
else
sprintf(server_message,"version vDev-%s\ntag %s\nbranch %s\ndate %s\n", GIT_HASH, GIT_TAG, GIT_BRANCH, GIT_DATE);
Expand Down

0 comments on commit 888bda2

Please sign in to comment.