Show
Ignore:
Timestamp:
04/21/11 21:49:32 (7 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1303422572 -0400
git-parent:

[360c4e69486a75ae673ac8f9c2370b64326280a5]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1303422572 -0400
Message:

support versioning from git

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_defines.h

    r9bdec91 r520106c  
    112112#define HAVE_IPv6 
    113113 
    114 #include <stdio.h> 
    115  
    116 static inline int noit_build_version(char *buff, int len) { 
    117   const char *v = NOIT_HEADURL; 
    118   const char *start, *end, *ns; 
    119   if(NULL != (start = strstr(v, "reconnoiter/"))) { 
    120     start += strlen("reconnoiter/"); 
    121     if(NULL != (end = strstr(start, "/src"))) { 
    122       ns = strchr(start, '/'); /* necessarily non-NULL */ 
    123       ns++; 
    124       if(!strncmp(start, "trunk/", 6)) 
    125         return snprintf(buff, len, "trunk.%s", NOIT_SVNVERSION); 
    126       if(!strncmp(start, "branches/", 9)) 
    127         return snprintf(buff, len, "b_%.*s.%s", (int)(end - ns), ns, NOIT_SVNVERSION); 
    128       if(!strncmp(start, "tags/", 5)) 
    129         return snprintf(buff, len, "%.*s.%s", (int)(end - ns), ns, NOIT_SVNVERSION); 
    130     } 
    131   } 
    132   return snprintf(buff, len, "unknown.%s", NOIT_SVNVERSION); 
    133 } 
    134  
    135114#if defined(__sun) && !defined(HAVE_POSIX_READDIR_R) 
    136115#define portable_readdir_r(a,b,c) (((*c) = readdir_r(a,b)) != NULL)