Explorar el Código

* Ported [2625] to 1.2.9

svn: 2626
Bryan Drewery hace 20 años
padre
commit
f3566e6259
Se han modificado 8 ficheros con 23 adiciones y 9 borrados
  1. 4 2
      Makefile.in
  2. 1 1
      build
  3. 1 0
      doc/UPDATES
  4. 8 0
      misc/buildts.php
  5. 1 1
      src/Makefile.in
  6. 1 0
      src/cmds.c
  7. 6 4
      src/main.c
  8. 1 1
      src/main.h

+ 4 - 2
Makefile.in

@@ -20,6 +20,8 @@ EXCLUDES = pack/pack.cfg misc/ind doc/DEVEL src/Makefile src/compat/Makefile src
            config.cache config.log config.status config.h stamp.* misc/.cvsignore src/compat/.cvsignore \
            src/mod/.cvsignore src/.cvsignore .cvsignore misc/commit misc/fstrings \
            misc/plainh misc/grep misc/cp.sh
+REVISION 	:= $(shell svnversion .)
+BUILDTS 	:= $(shell misc/buildts.php)
 
 # defaults
 CXX = @CCACHE@ @DISTCC@ @CXX@
@@ -49,12 +51,12 @@ _CFLGS = -fno-strict-aliasing -W -Wformat \
 MAKEFLAGS = -s -j4
 
 MAKE_BIN = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD)' \
-'CCDEPMODE=$(CCDEPMODE)' \
+'CCDEPMODE=$(CCDEPMODE)' 'REVISION=$(REVISION)' 'BUILDTS=$(BUILDTS)' \
 'STRIP=$(STRIP)' 'CFLGS=$(CFLGS)' \
 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
 
 MAKE_DEBUG = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'LD=$(LDDEBUG) -g' \
-'CCDEPMODE=$(CCDEPMODE)' \
+'CCDEPMODE=$(CCDEPMODE)' 'REVISION=$(REVISION)' 'BUILDTS=$(BUILDTS)' \
 'STRIP=touch' 'CFLGS=$(DEBCXXFLAGS) $(CFLGS)' \
 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(debug)' 
 

+ 1 - 1
build

@@ -17,7 +17,7 @@ fi
 
 ver="?.?.?"
 ver=`grep "char" src/main.c | $AWK '/egg_version/ {print $5}' | sed -e 's/\"//g' | sed -e 's/\;//g'`
-BUILDTS=`cat src/build.h | $AWK '{print $3}'`
+BUILDTS=$(misc/buildts.php)
 builddate=`perl -e "use POSIX 'strftime';print strftime(\"%m.%d.%Y\n\",gmtime(${BUILDTS}));"`
 
 clear

+ 1 - 0
doc/UPDATES

@@ -47,6 +47,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed another cmd_whom bug which showed remote users from .botcmd. (#9)
 * Fixed returning from 'su' not returning user to correct channel. (ie, partyline)
 * Fixed cmds showing failed cmdpass. (#188)
+* The respository is now stored in subversion; binaries now hold a revision number.
 
 1.2.8
 * Fixed [bot]* cmds depending on case of botnicks.

+ 8 - 0
misc/buildts.php

@@ -0,0 +1,8 @@
+#! /usr/bin/php
+<?php
+  $info = Array();
+  exec("svn info", $info);
+  $datel = explode(' ', $info[8]);
+  $date = strtotime("{$datel[3]} {$datel[4]} {$datel[5]}");
+  echo $date;
+?>

+ 1 - 1
src/Makefile.in

@@ -8,7 +8,7 @@ depcomp = /bin/sh $(top_srcdir)/autotools/depcomp
 
 @SET_MAKE@
 
-CXXFLAGS = @CXXFLAGS@ -I.. -I$(top_srcdir) -I$(top_srcdir)/pack @DEFS@ $(CFLGS)
+CXXFLAGS = @CXXFLAGS@ -I.. -I$(top_srcdir) -I$(top_srcdir)/pack @DEFS@ $(CFLGS) '-DREVISION="$(REVISION)"' -DBUILDTS=$(BUILDTS)
 CPPFLAGS = @CPPFLAGS@
 
 OBJCOPY = @OBJCOPY@

+ 1 - 0
src/cmds.c

@@ -364,6 +364,7 @@ static void cmd_about(int idx, char *par)
   egg_strftime(c, sizeof c, "%c %Z", gmtime(&buildts));
   dprintf(idx, "Version: %s\n", egg_version);
   dprintf(idx, "Build: %s (%li)\n", c, buildts);
+  dprintf(idx, "Revision: %s\n", revision);
   dprintf(idx, STR("(written from a base of Eggdrop 1.6.12)\n"));
   dprintf(idx, "..with credits and thanks to the following:\n");
   dprintf(idx, " \n");

+ 6 - 4
src/main.c

@@ -34,7 +34,6 @@
 #include "traffic.h"
 #include "bg.h"	
 #include "botnet.h"
-#include "build.h"
 #include "src/mod/irc.mod/irc.h"
 #include "src/mod/server.mod/server.h"
 #include "src/mod/channels.mod/channels.h"
@@ -68,7 +67,8 @@
 
 extern int		optind;
 
-const time_t 	buildts = CVSBUILD;		/* build timestamp (UTC) */
+const time_t 	buildts = BUILDTS;		/* build timestamp (UTC) */
+const char	*revision = REVISION;
 const char	*egg_version = "1.2.9-cvs";
 
 bool	used_B = 0;		/* did we get started with -B? */
@@ -376,7 +376,9 @@ static void dtx_arg(int argc, char *argv[])
         char date[50] = "";
 
         egg_strftime(date, sizeof date, "%c %Z", gmtime(&buildts));
-	printf("%s\nBuild Date: %s (%lu)\n", version, date, buildts);
+	printf("%s\nBuild Date: %s (%s%lu%s)\n", version, date, BOLD(-1), buildts, BOLD_END(-1));
+        printf("Revision: %s\n", revision);
+        printf("BuildOS: %s%s%s BuildArch: %s%s%s\n", BOLD(-1), BUILD_OS, BOLD_END(-1), BOLD(-1), BUILD_ARCH, BOLD_END(-1));
 
 	sdprintf("pack: %d conf: %d settings_t: %d pad: %d\n", SIZE_PACK, SIZE_CONF, sizeof(settings_t), SIZE_PAD);
         if (settings.uname[0]) {
@@ -711,7 +713,7 @@ printf("out: %s\n", out);
 
   /* Version info! */
   simple_snprintf(ver, sizeof ver, "[%s] Wraith %s", settings.packname, egg_version);
-  egg_snprintf(version, sizeof version, "[%s] Wraith %s (%lu)", settings.packname, egg_version, buildts);
+  egg_snprintf(version, sizeof version, "[%s] Wraith %s (%lu:%s)", settings.packname, egg_version, buildts, revision);
 
   egg_memcpy(&nowtm, gmtime(&now), sizeof(struct tm));
   lastmin = nowtm.tm_min;

+ 1 - 1
src/main.h

@@ -21,7 +21,7 @@ extern time_t		online_since, now, restart_time;
 extern uid_t		myuid;
 extern pid_t            mypid;
 extern const time_t	buildts;
-extern const char	*egg_version;
+extern const char	*egg_version, *revision;
 
 void fatal(const char *, int);