[cvslog] (2003-05-12 23:58:01 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Mon May 12 17:58:01 CST 2003


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2003-05-12 23:58:01 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     misc/addpatch src/patch.h src/tclmisc.c

Log message:

* Updates to addpatch script.
* Added a sanity check to previous patch.

---------------------- diff included ----------------------
Index: eggdrop1.6/misc/addpatch
diff -u eggdrop1.6/misc/addpatch:1.6 eggdrop1.6/misc/addpatch:1.7
--- eggdrop1.6/misc/addpatch:1.6	Thu Apr 17 00:09:32 2003
+++ eggdrop1.6/misc/addpatch	Mon May 12 18:57:51 2003
@@ -2,8 +2,8 @@
 #
 # addpatch - modifies src/patch.h
 #
-# Copyright (C) 2002, 2003  Eggheads Development Team
-# Copyright (C) 2000  Fabian Knittel <fknittel at gmx.de>
+# Copyright (C) 2002, 2003 Eggheads Development Team
+# Copyright (C) 2000 Fabian Knittel <fknittel at gmx.de>
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -24,18 +24,21 @@
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 #
-# $Id: addpatch,v 1.6 2003/04/17 05:09:32 wcc Exp $
+# $Id: addpatch,v 1.7 2003/05/12 23:57:51 wcc Exp $
 
 show_usage()
 {
-	echo "Usage: $0 <patch-name> [unixtime]"
+	echo "Usage: `basename $0` [-hs] <patchname> [unixtime]"
 	echo ""
-	echo " patch-name - Name of last patch added."
-	echo " unixtime   - Some unixtime number or 'now'. Default is 'now'."
+	echo "  patchname  - Name of last patch added."
+	echo "  unixtime   - Some unixtime number or 'now'. Default is 'now'."
+	echo ""
+	echo "  -h, --help - Print this help and exit."
+	echo "  -s, --show - Print current patch name and exit."
 	exit 1
 }
 
-if test "x${1}" = "x"; then
+if test "x${1}" = "x" || test "x${1}" = "x-h" || test "x${1}" = "x--help"; then
 	show_usage;
 else
 	patch_name=$1
@@ -46,28 +49,36 @@
 	exit 1
 fi
 
-if test "x${2}" = "x" || test "$unix_time" = now; then
-	unix_time=`date +%s`
-	echo "Setting unixtime to now."
-else
-	unix_time=$2
-fi
-
 oldpatch_name=`cat src/patch.h | grep -E '^patch.*\);$'| awk '-F"' '{ print $2 }'`
 
 if test "x${oldpatch_name}" = "x"; then
 	oldpatch_name='(could not detect)'
 fi
 
-echo "Modifying src/patch.h:"
-echo "   unixtime: ${unix_time}"
-echo "   old patch name: ${oldpatch_name}"
-echo "   new patch name: ${patch_name}"
+if test "x${1}" = "x-s" || test "x${1}" = "x--show"; then
+	echo "Current patch: ${oldpatch_name}"
+	exit
+fi
+
+if test "x${2}" = "x" || test "$unix_time" = now; then
+	unix_time=`date +%s`
+else
+	unix_time=$2
+fi
+
+echo "Unixtime:      ${unix_time}"
+echo "Current patch: ${oldpatch_name}"
+echo "New patch:     ${patch_name}"
 
 if sed src/patch.h -e "s/^patch.*\")\(.*current unixtime.*\)/patch(\"${unix_time}\")\1/" -e "s/^patch.*);$/patch(\"${patch_name}\");/" > src/patch.h_; then
 	mv src/patch.h_ src/patch.h
-	echo "Modification successful."
+	if test "${oldpatch_name}" = "${patch_name}"; then
+		echo "Successful:    yes (no name change)"
+	else
+		echo "Successful:    yes"
+	fi
+	
 else
-	echo "Failed to adjust src/patch.h"
+	echo "Successful:    no"
 	exit 1
 fi
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.995 eggdrop1.6/src/patch.h:1.996
--- eggdrop1.6/src/patch.h:1.995	Sun May 11 18:53:24 2003
+++ eggdrop1.6/src/patch.h	Mon May 12 18:57:51 2003
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.995 2003/05/11 23:53:24 wcc Exp $
+ * $Id: patch.h,v 1.996 2003/05/12 23:57:51 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1052697174");            /* current unixtime */
+patch("1052783820");            /* current unixtime */
 /*
  *
  *
  */
-patch("durationspaces");
+patch("durationspaces2");
 /*
  *
  *
Index: eggdrop1.6/src/tclmisc.c
diff -u eggdrop1.6/src/tclmisc.c:1.44 eggdrop1.6/src/tclmisc.c:1.45
--- eggdrop1.6/src/tclmisc.c:1.44	Sun May 11 18:53:24 2003
+++ eggdrop1.6/src/tclmisc.c	Mon May 12 18:57:51 2003
@@ -2,7 +2,7 @@
  * tclmisc.c -- handles:
  *   Tcl stubs for everything else
  *
- * $Id: tclmisc.c,v 1.44 2003/05/11 23:53:24 wcc Exp $
+ * $Id: tclmisc.c,v 1.45 2003/05/12 23:57:51 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -379,7 +379,7 @@
     tmp = (sec);
     sprintf(&s[strlen(s)], "%lu second%s", tmp, (tmp == 1) ? "" : "s");
   }
-  if (s[strlen(s) - 1] == ' ')
+  if (strlen(s) > 0 && s[strlen(s) - 1] == ' ')
     s[strlen(s) - 1] = 0;
   Tcl_AppendResult(irp, s, NULL);
   return TCL_OK;
----------------------- End of diff -----------------------


More information about the Changes mailing list