Include git ID in version number, removed patchlevel support
authorRemco Rijnders <remco@webconquest.com>
Wed, 9 Sep 2015 06:41:49 +0000 (08:41 +0200)
committerRemco Rijnders <remco@webconquest.com>
Wed, 9 Sep 2015 09:33:41 +0000 (11:33 +0200)
src/Makefile
src/s_bsd.c
src/s_ping.c
src/version.c.SH

index 78469e6012e7905d40d1aae3124f8353a8bb66c2..b16ab118e45f22bb4b189a50a3e555d26ab9d417 100644 (file)
@@ -174,7 +174,7 @@ s_bsd.o: s_bsd.c ../include/struct.h ../include/config.h \
  ../include/setup.h  ../include/common.h \
  ../include/sys.h ../include/class.h ../include/dbuf.h \
  ../include/whowas.h ../include/res.h ../include/numeric.h \
- ../include/patchlevel.h ../include/sock.h ../include/h.h
+ ../include/sock.h ../include/h.h
 s_conf.o: s_conf.c ../include/struct.h ../include/config.h \
  ../include/setup.h  ../include/common.h \
  ../include/sys.h ../include/class.h ../include/dbuf.h \
@@ -201,8 +201,8 @@ s_numeric.o: s_numeric.c ../include/struct.h ../include/config.h \
 s_ping.o: s_ping.c ../include/struct.h ../include/config.h \
  ../include/setup.h  ../include/common.h \
  ../include/sys.h ../include/class.h ../include/dbuf.h \
- ../include/whowas.h ../include/numeric.h ../include/patchlevel.h \
- ../include/sock.h ../include/h.h
+ ../include/whowas.h ../include/numeric.h  ../include/sock.h \
+ ../include/h.h
 s_serv.o: s_serv.c ../include/struct.h ../include/config.h \
  ../include/setup.h  ../include/common.h \
  ../include/sys.h ../include/class.h ../include/dbuf.h \
index 2e44523a758970452c07e8f23aaefae9af255d1e..ec046495837f3c6dae2046e2320f48b1974f50ae 100644 (file)
@@ -23,7 +23,6 @@
 #include "sys.h"
 #include "res.h"
 #include "numeric.h"
-#include "patchlevel.h"
 #include <sys/socket.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
index f50ac1d08309cb3e5e883fd371d2c501409ceb94..c32adfec733520d70f5b9b931dc0d377caac729c 100644 (file)
@@ -21,7 +21,6 @@
 #include "common.h"
 #include "sys.h"
 #include "numeric.h"
-#include "patchlevel.h"
 #include <sys/socket.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
index 03bec234a41e1329f10255fbab2975bf0b4d2482..ccbef6e40a5d6920324bfa75d51089244be2cf32 100755 (executable)
@@ -1,15 +1,4 @@
-case $CONFIG in
-'')     if test -r ../config.sh
-        then 
-           . ../config.sh ;
-        else 
-           spitshell=cat
-           package=IRC
-        fi
-        ;;
-esac
-
-echo "Extracting $package/ircd/version.c..."
+echo "Extracting version.c..."
 
 if test -r version.c
 then
@@ -19,6 +8,12 @@ else
    generation=0
 fi
 
+# See if we are compiled from a git working directory
+if test -d ../.git
+then
+   git_version=git-`git describe --abbrev=8 --dirty --always --tags`
+fi
+
 generation=`expr $generation + 1`
 
 creation=`date | \
@@ -27,10 +22,11 @@ awk '{if (NF == 6) \
 else \
          { print $1 " "  $2 " " $3 " " $7 " at " $4 " " $5 " " $6 }}'`
 
-$spitshell >version.c <<!SUB!THIS!
+cat >version.c <<!SUB!THIS!
 /*
  *   IRC - Internet Relay Chat, ircd/version.c
  *   Copyright (C) 1990 Chelsea Ashley Dyerman
+ *                 2015 Remco Rijnders
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -50,18 +46,16 @@ $spitshell >version.c <<!SUB!THIS!
 /*
  * This file is generated by version.c.SH. Any changes made will go away.
  */
-
 #include "struct.h"
-#include "patchlevel.h"
 
 char *generation = "$generation";
 char *creation = "$creation";
-char *version = IRCD_VERSION PATCH1 PATCH2 PATCH3 PATCH4\
-               PATCH5 PATCH6 PATCH7 PATCH8 PATCH9;
+#define GIT_VERSION "$git_version"
+char *version = IRCD_VERSION GIT_VERSION;
 
 char *infotext[] =
     {
-       "$package -- Serenity IRCD " IRCD_VERSION,
+       "Serenity IRCD " IRCD_VERSION GIT_VERSION,
        "Based on the original code written by Jarkko Oikarinen",
        "Copyright 1988, 1989, 1990, 1991 University of Oulu, Computing Center",
        "-",
@@ -75,8 +69,7 @@ char *infotext[] =
         "Current coders and designers:",
         "Remmy - remmy@serenity-irc.net",
        "-",
-       IRCD_VERSION PATCH1 PATCH2 PATCH3 PATCH4 PATCH5 PATCH6 PATCH7
-               PATCH8 PATCH9,
+       IRCD_VERSION GIT_VERSION,
        0,
     };
 !SUB!THIS!