]> jfr.im git - solanum.git/blobdiff - ircd/version.c.SH
Support more human friendly k/d/x-line duration format
[solanum.git] / ircd / version.c.SH
index 3ab433a32060006147e4aa4ad99100cfd223f842..80cda0ffc209d1df97f38d9ac558ce50a8eb53e7 100644 (file)
@@ -1,15 +1,13 @@
 #!/bin/sh
 
-# $Id: version.c.SH 3342 2007-04-01 22:10:05Z jilles $ 
-
 spitshell=cat
-package=IRC
+package=solanum
 
 echo "Extracting $package/src/version.c..."
 
 if test -r version.c.last
 then
-   generation=`sed -n 's/^char \*generation = \"\(.*\)\";/\1/p' < version.c.last`
+   generation=`sed -n 's/^const char \*generation = \"\(.*\)\";/\1/p' < version.c.last`
    if test ! "$generation" ; then generation=0; fi
 else
    generation=0
@@ -17,17 +15,22 @@ fi
 
 generation=`expr $generation + 1`
 
-uname=`uname -a`
-
-creation=`LC_ALL=C date | \
+if test -n "$SOURCE_DATE_EPOCH" -a "$EXTERNAL_BUILD_TIMESTAMP" = '' ; then
+    EXTERNAL_BUILD_TIMESTAMP=$SOURCE_DATE_EPOCH
+fi
+if test "$EXTERNAL_BUILD_TIMESTAMP" = ''; then
+    creation=`LC_ALL=C date | \
 awk '{if (NF == 6) \
          { print $1 " "  $2 " " $3 " "  $6 " at " $4 " " $5 } \
 else \
          { print $1 " "  $2 " " $3 " " $7 " at " $4 " " $5 " " $6 }}'`
+else
+    creation="$EXTERNAL_BUILD_TIMESTAMP"
+fi
 
 $spitshell >version.c <<!SUB!THIS!
 /*
- *   IRC - Internet Relay Chat, src/version.c
+ *   $package - Internet Relay Chat, src/version.c
  *   Copyright (C) 1990 Chelsea Ashley Dyerman
  *
  *   This program is free software; you can redistribute it and/or modify
@@ -51,19 +54,20 @@ $spitshell >version.c <<!SUB!THIS!
 
 #include "patchlevel.h"
 #include "serno.h"
+#include "stdinc.h"
 
 const char *generation = "$generation";
 const char *creation = "$creation";
-const char *platform = "$uname";
 const char *ircd_version = PATCHLEVEL;
 const char *serno = SERNO;
+const unsigned long int datecode = DATECODE;
 
 const char *infotext[] =
 {
   "$package --",
   "Based on the original code written by Jarkko Oikarinen",
-  "Copyright 1988, 1989, 1990, 1991 University of Oulu, Computing Center",
-  "Copyright (c) 1996-2001 Hybrid Development Team", 
+  "Copyright (c) 1988-1991 University of Oulu, Computing Center",
+  "Copyright (c) 1996-2001 Hybrid Development Team",
   "Copyright (c) 2002-2009 ircd-ratbox Development Team",
   "Copyright (c) 2005-2016 charybdis development team",
   " ",
@@ -74,13 +78,9 @@ const char *infotext[] =
   " ",
 !SUB!THIS!
 
-IFS='
-'
-for i in `grep -v '^$Id' ../CREDITS |tr -d '"'` ; do
-echo "  \"$i\"," >> version.c
-done
+sed 's/^$/ /;s/.*/\  "&\",/' ../CREDITS >> version.c
 $spitshell >>version.c <<!SUB!THISTOO!
-  "",
-  0,
+  " ",
+  NULL,
 };
 !SUB!THISTOO!