changed version numbering a little bit (3th path is now the commit count)
authorpk910 <philipp@zoelle1.de>
Wed, 19 Oct 2011 23:54:36 +0000 (01:54 +0200)
committerpk910 <philipp@zoelle1.de>
Thu, 20 Oct 2011 00:12:09 +0000 (02:12 +0200)
VERSION [new file with mode: 0644]
src/bots.c
src/cmd_neonserv_netinfo.c
src/cmd_neonserv_version.c
src/main.h
src/version.h
src/version.sh

diff --git a/VERSION b/VERSION
new file mode 100644 (file)
index 0000000..79e2c5c
--- /dev/null
+++ b/VERSION
@@ -0,0 +1,7 @@
+VERSION LOG
+
+2011-10-05   5.1
+    first production version...
+
+2011-08-09   5.0 (dev)
+    developing period...
index bd7f4a68e96588b7e38397d5406882f530f6d7c7..1d95e182a05799ffdb7198e90dcefceb3b50ab31 100644 (file)
@@ -111,11 +111,11 @@ void general_event_privctcp(struct UserNode *user, struct UserNode *target, char
 
 static int general_ctcp(char *buffer, char *command, char *text) {
     if(!stricmp(command, "VERSION")) {
-        sprintf(buffer, "VERSION NeonServ v" NEONSERV_VERSION " by pk910 (%s)", (strcmp(revision, "") ? revision : "-"));
+        sprintf(buffer, "VERSION NeonServ v%s.%d by pk910 (%s)", NEONSERV_VERSION, patchlevel, (strcmp(revision, "") ? revision : "-"));
         return 1;
     }
     if(!stricmp(command, "FINGER")) {
-        sprintf(buffer, "FINGER NeonServ v" NEONSERV_VERSION " (%s) build %s lines C code using " COMPILER " (see +netinfo)", (strcmp(revision, "") ? revision : "-"), codelines);
+        sprintf(buffer, "FINGER NeonServ v%s.%d (%s) build %s lines C code using " COMPILER " (see +netinfo)", NEONSERV_VERSION, patchlevel, (strcmp(revision, "") ? revision : "-"), codelines);
         return 1;
     }
     if(!stricmp(command, "PING")) {
index bdcc9b067c36d51ea0c75afe2f2d417f82062fe5..25113adc2c210c732480ea0ef746fae11953af65 100644 (file)
@@ -145,9 +145,9 @@ CMD_BIND(neonserv_cmd_netinfo) {
     table_add(table, content);
     
     if(strcmp(revision, ""))
-        sprintf(tmp, "%s  (%s)", NEONSERV_VERSION, revision);
+        sprintf(tmp, "%s.%d  (%s)", NEONSERV_VERSION, patchlevel, revision);
     else 
-        strcpy(tmp, NEONSERV_VERSION);
+        sprintf(tmp, "%s.%d", NEONSERV_VERSION, patchlevel);
     content[0] = get_language_string(user, "NS_NETINFO_VERSION");
     content[1] = tmp;
     table_add(table, content);
index 5cd814187c1fa30ce2d4069ef6d1f98d05be2e35..f68ecd69c33d6a752e2f6e612059d0e5d28a6285 100644 (file)
@@ -22,7 +22,7 @@
 */
 
 CMD_BIND(neonserv_cmd_version) {
-    reply(getTextBot(), user, "\002NeonServ " NEONSERV_VERSION "\002 (%s), written by pk910", (strcmp(revision, "") ? revision : "-"));
+    reply(getTextBot(), user, "\002NeonServ %s.%d\002 (%s), written by pk910", NEONSERV_VERSION, patchlevel, (strcmp(revision, "") ? revision : "-"));
     reply(getTextBot(), user, "Build (#%s) %s (%s lines, " COMPILER ")", compilation, creation, codelines);
     reply(getTextBot(), user, "NeonServ source can be found on: http://git.pk910.de/?p=NeonServV5.git");
     //helpers :D
index 7372cd162d024b76324182b4bff915fec11a4aa7..6b7591ad7074420af4aeb4ef37ac45123561d47c 100644 (file)
@@ -17,7 +17,8 @@
 #ifndef _main_h
 #define _main_h
 
-#define NEONSERV_VERSION "5.1.0"
+#define NEONSERV_VERSION "5.1"
+#define VERSION_PATCHLEVEL 352
 
 #ifndef BOTWAR_ALERT_CHAN
 #define BOTWAR_ALERT_CHAN NULL
index afb74335ca54366c27efc137d6b2d37732fc1b4c..4241303a8a76a3232141bd2048e8bbb1d1bc5db3 100644 (file)
@@ -23,5 +23,6 @@ extern const char *compilation;
 extern const char *creation;
 extern const char *revision;
 extern const char *codelines;
+extern const int patchlevel;
 
 #endif
\ No newline at end of file
index e89f996b4063348f1230d8557b2035c1c1f04f4f..b7f04e258bde4b2142686ba81c0adab5bc32e214 100644 (file)
@@ -20,12 +20,13 @@ else \
 codelines=`find . -type f -regex '\./.*\.h' -or -regex '\./.*\.c' |xargs cat|wc -l`
 
 svn_revision=`svn info | grep Revision | grep -o -E '[0-9]+'`
+git_commitcount=0
 if test "x$svn_revision" = "x" ; then
   svn_revision=`git log -n 1 --pretty="format:%h"`
   if test "x$svn_revision" = "x" ; then
     svn_revision="0"
   else
-    git_commitcount=`git rev-list --all --no-merges | wc -l | sed "s/[ \t]//g"`
+    git_commitcount=`git log --pretty=oneline --no-merges --first-parent | wc -l | sed "s/[ \t]//g"`
     svn_revision="git-$git_commitcount-$svn_revision"
   fi
 else
@@ -59,5 +60,7 @@ const char *creation = "$creation";
 const char *revision = "$svn_revision";
 const char *codelines = "$codelines";
 
+const int patchlevel = ($git_commitcount ? ($git_commitcount - VERSION_PATCHLEVEL) : 0);
+
 !SUB!THIS!