Use git revision in elog

This commit is contained in:
2015-12-22 10:03:33 +01:00
parent 37da0441da
commit 51cda31f5d
2 changed files with 16 additions and 11 deletions
+15 -7
View File
@@ -20,12 +20,12 @@
Contents: Electronic logbook utility
$Id$
\********************************************************************/
#include "elog-version.h"
char svn_revision[] = "$Id$";
#include "git-revision.h"
const char *_git_revision = GIT_REVISION;
#include <stdio.h>
#include <sys/types.h>
@@ -73,6 +73,17 @@ char text[TEXT_SIZE], old_text[TEXT_SIZE], new_text[TEXT_SIZE];
/*------------------------------------------------------------------*/
const char *git_revision()
{
const char *p = _git_revision;
if (strrchr(p, '-'))
p = strrchr(p, '-')+2;
return p;
}
/*------------------------------------------------------------------*/
char *map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
void base64_encode(unsigned char *s, unsigned char *d, int size)
@@ -1051,10 +1062,7 @@ int main(int argc, char *argv[])
} else {
usage:
printf("%s ", ELOGID);
strcpy(str, svn_revision + 13);
if (strchr(str, ' '))
*strchr(str, ' ') = 0;
printf("revision %s\n", str);
printf("revision %s\n", git_revision());
printf("\nusage: elog\n");
printf("elog -h <hostname> [-p port] [-d subdir]\n");
printf(" Location where elogd is running\n");
+1 -4
View File
@@ -187,10 +187,7 @@
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
HAVE_SSL,
DEBUG,
);
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
OTHER_LDFLAGS = "-lssl";
PRODUCT_NAME = "$(TARGET_NAME)";