Use git revision in elog

This commit is contained in:
Stefan Ritt 2015-12-22 10:03:33 +01:00
parent 37da0441da
commit 51cda31f5d
2 changed files with 16 additions and 11 deletions

View File

@ -20,12 +20,12 @@
Contents: Electronic logbook utility Contents: Electronic logbook utility
$Id$
\********************************************************************/ \********************************************************************/
#include "elog-version.h" #include "elog-version.h"
char svn_revision[] = "$Id$"; #include "git-revision.h"
const char *_git_revision = GIT_REVISION;
#include <stdio.h> #include <stdio.h>
#include <sys/types.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+/"; char *map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
void base64_encode(unsigned char *s, unsigned char *d, int size) void base64_encode(unsigned char *s, unsigned char *d, int size)
@ -1051,10 +1062,7 @@ int main(int argc, char *argv[])
} else { } else {
usage: usage:
printf("%s ", ELOGID); printf("%s ", ELOGID);
strcpy(str, svn_revision + 13); printf("revision %s\n", git_revision());
if (strchr(str, ' '))
*strchr(str, ' ') = 0;
printf("revision %s\n", str);
printf("\nusage: elog\n"); printf("\nusage: elog\n");
printf("elog -h <hostname> [-p port] [-d subdir]\n"); printf("elog -h <hostname> [-p port] [-d subdir]\n");
printf(" Location where elogd is running\n"); printf(" Location where elogd is running\n");

View File

@ -187,10 +187,7 @@
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO; GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
HAVE_SSL,
DEBUG,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
OTHER_LDFLAGS = "-lssl"; OTHER_LDFLAGS = "-lssl";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";