[eggheads-patches] PATCH: more-misc.diff

Tothwolf tothwolf at concentric.net
Fri Oct 22 14:26:38 CST 1999


more-misc.diff:
  Use AC_TRY_RUN for filedb struct size info
  Removed extra -lpthread test statement
  Minor spacing changes for eggdrop.conf.dist
  Compat code for $CURRENT in scripts/weed

-Toth
-------------- next part --------------
diff -urNPX ../exclude ../eggdrop1.3.cvs/configure ./configure
--- ../eggdrop1.3.cvs/configure	Thu Oct 21 21:50:18 1999
+++ ./configure	Thu Oct 21 23:21:30 1999
@@ -2781,20 +2781,31 @@
 
 echo $ac_n "checking space left in file database struct""... $ac_c" 1>&6
 echo "configure:2784: checking space left in file database struct" >&5
+if test "$cross_compiling" = yes; then
+    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2789 "configure"
+#include "confdefs.h"
 
-cat > abacab.c << 'EOF'
 #include <stdio.h>
 #include <sys/time.h>
 #include "src/mod/filesys.mod/files.h"
 main() {
-  fprintf(stdout, "%d/%d\n", 512 - sizeof(struct filler), sizeof(filedb));
+  fprintf(stdout, "%d/%d %s\n", 512 - sizeof(struct filler), sizeof(filedb), "bytes");
 }
+
 EOF
+if { (eval echo configure:2800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -fr conftest*
+fi
 
-${CC} -o abacab${EXEEXT} abacab.c
-FILEDB_SPACE=`./abacab${EXEEXT}`
-echo "$ac_t""$FILEDB_SPACE bytes" 1>&6
-rm -f abacab${EXEEXT} abacab.o abacab.c
 echo "$ac_t""   (standard is currently 48/512 bytes)" 1>&6
 
 # ---------- begin robey's tcl thingies
@@ -3017,7 +3028,7 @@
 fi
 
 echo $ac_n "checking for Tcl library""... $ac_c" 1>&6
-echo "configure:3021: checking for Tcl library" >&5
+echo "configure:3032: checking for Tcl library" >&5
 
 # attempt autodetect for $TCLLIBFN if it's not set
 if test ! "x${TCLLIBFN}" = "x"
@@ -3051,7 +3062,7 @@
 fi
 
 echo $ac_n "checking for Tcl header""... $ac_c" 1>&6
-echo "configure:3055: checking for Tcl header" >&5
+echo "configure:3066: checking for Tcl header" >&5
 
 # attempt autodetect for $TCLINCFN if it's not set
 if test ! "x${TCLINCFN}" = "x"
@@ -3108,7 +3119,7 @@
 
 # check Tcl version
 echo $ac_n "checking for Tcl version""... $ac_c" 1>&6
-echo "configure:3112: checking for Tcl version" >&5
+echo "configure:3123: checking for Tcl version" >&5
 if test ! "x${TCL_VERSION}" = "x"
 then
   echo "$ac_t""$TCL_VERSION" 1>&6
@@ -3165,7 +3176,7 @@
 
 # check for Tcl threads
 echo $ac_n "checking for Tcl threads""... $ac_c" 1>&6
-echo "configure:3169: checking for Tcl threads" >&5
+echo "configure:3180: checking for Tcl threads" >&5
 TCL_VER_POST81=`echo $TCL_VERSION | $AWK '{split($1, i, "."); if (((i[1] == 8) && (i[2] >= 1)) || (i[1] >= 9)) print "yes"; else print "no"}'`
 if test "x${TCL_VER_POST81}" = "xyes"
 then
@@ -3229,6 +3240,12 @@
 #define HAVE_BUGGY_TCL_THREADS 1
 EOF
 
+
+  # add -lpthread to $LIBS if we have it
+  if test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
+  then
+    LIBS="-lpthread $LIBS"
+  fi
 else
   echo "$ac_t""no" 1>&6
 fi
@@ -3277,12 +3294,6 @@
     TCL_REQS="libtcle.a"
     TCL_LIBS="-L. -ltcle -lm"
   fi
-fi
-
-# add -lpthread to $LIBS if we need it
-if test "x${ac_cv_var_tcl_threads}" = "xyes" && test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
-then
-  LIBS="-lpthread $LIBS"
 fi
 
 
diff -urNPX ../exclude ../eggdrop1.3.cvs/configure.in ./configure.in
--- ../eggdrop1.3.cvs/configure.in	Thu Oct 21 21:50:19 1999
+++ ./configure.in	Thu Oct 21 23:19:57 1999
@@ -343,20 +343,14 @@
 
 dnl check how much space is left in filedb (informational purposes)
 AC_MSG_CHECKING(space left in file database struct)
-
-cat > abacab.c << 'EOF'
+AC_TRY_RUN([
 #include <stdio.h>
 #include <sys/time.h>
 #include "src/mod/filesys.mod/files.h"
 main() {
-  fprintf(stdout, "%d/%d\n", 512 - sizeof(struct filler), sizeof(filedb));
+  fprintf(stdout, "%d/%d %s\n", 512 - sizeof(struct filler), sizeof(filedb), "bytes");
 }
-EOF
-
-${CC} -o abacab${EXEEXT} abacab.c
-FILEDB_SPACE=`./abacab${EXEEXT}`
-AC_MSG_RESULT($FILEDB_SPACE bytes)
-rm -f abacab${EXEEXT} abacab.o abacab.c
+])
 AC_MSG_RESULT([   (standard is currently 48/512 bytes)])
 
 dnl where is tcl?  is it here?
@@ -779,6 +773,12 @@
 
 EOF
   AC_DEFINE(HAVE_BUGGY_TCL_THREADS)
+
+  # add -lpthread to $LIBS if we have it
+  if test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
+  then
+    LIBS="-lpthread $LIBS"
+  fi
 else
   AC_MSG_RESULT(no)
 fi
@@ -829,12 +829,6 @@
     TCL_REQS="libtcle.a"
     TCL_LIBS="-L. -ltcle -lm"
   fi
-fi
-
-# add -lpthread to $LIBS if we need it
-if test "x${ac_cv_var_tcl_threads}" = "xyes" && test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
-then
-  LIBS="-lpthread $LIBS"
 fi
 
 AC_SUBST(TCLLIB)
diff -urNPX ../exclude ../eggdrop1.3.cvs/eggdrop.conf.dist ./eggdrop.conf.dist
--- ../eggdrop1.3.cvs/eggdrop.conf.dist	Tue Oct 12 16:25:14 1999
+++ ./eggdrop.conf.dist	Thu Oct 21 20:17:45 1999
@@ -46,8 +46,7 @@
 #addlang "english"
 
 
-#####  LOG FILES  #####
-
+##### LOG FILES #####
 
 # you can specify how many log files you can have upto.  at midnight every
 # day, the old log files are renamed and a new log file begins.  by default,
@@ -131,8 +130,7 @@
 set console "mkcobxs"
 
 
-
-#####  FILES AND DIRECTORIES  #####
+##### FILES AND DIRECTORIES #####
 
 # the userfile: where user records are stored
 set userfile "LamestBot.user"
@@ -154,7 +152,7 @@
 set telnet-banner "telnet-banner"
 
 
-#####  BOTNET  #####
+##### BOTNET #####
 
 # you probably shouldn't deal with this until reading 'botnet.doc' or
 # something.  you need to know what you're doing.
@@ -225,7 +223,8 @@
 # lookup? (you might want to increase this if you are on a slow network).
 set resolve-timeout 15
 
-#####  MORE ADVANCED STUFF  #####
+
+##### MORE ADVANCED STUFF #####
 
 # are you behind a firewall?  uncomment this and specify your socks host
 #set firewall "proxy:178"
@@ -344,7 +343,7 @@
 
 
 
-############## MODULES #################
+########## MODULES ##########
 
 # below are various settings for the modules available with eggdrop,
 # PLEASE EDIT THEM CAREFULLY, READ THEM, even if you're an old hand
@@ -357,8 +356,7 @@
 set mod-path "modules/"
 
 
-
-#### CHANNELS MODULE #####
+##### CHANNELS MODULE #####
 
 # this next module provides channel related support for the bot, without
 # it, it will just sit on irc, it can respond to msg & ctcp commands, but
@@ -480,7 +478,6 @@
 #   how many joins/nick changes in how many seconds is a join flood?
 #   not specifying or using number = 0 will not check join floods!
 
-
 # note that "need-op", "need-invite", etc, are limited to 120 characters,
 # so if you want to so something more complicated, just write a proc,
 # and make them call your proc.
@@ -600,6 +597,7 @@
 }
 channel set #botcentral +bitch +clearbans +enforcebans -greet +revenge
 
+
 ##### SERVER MODULE #####
 
 # this provides the core server support (removing this is equivalent to
@@ -740,7 +738,6 @@
 #set check-mode-r 1
 
 
-
 ##### CTCP MODULE #####
 
 # this provides the normal ctcp replies that you'd expect *RECOMMENDED*
@@ -756,6 +753,7 @@
 # server module)
 set ctcp-mode 0
 
+
 ##### IRC MODULE #####
 
 # this module provides ALL NORMAL IRC INTERACTION, if you want the normal
@@ -854,7 +852,6 @@
 # chattr +d, kick and ban. Default is 1.
 set revenge-mode 1
 
-
 ##### IRC MODULE - net-type 1 specific features (IRCnet) #####
 
 # Don't modify the following settings if you don't use IRCnet. The defaults following
@@ -946,7 +943,6 @@
 #set rfc-compliant 1
 
 
-
 ##### TRANSFER MODULE #####
 
 # uncomment this line to load the transfer module, this provides
@@ -974,7 +970,6 @@
 set xfer-timeout 30
 
 
-
 ##### SHARE MODULE #####
 
 # this provides the userfile sharing support
@@ -1022,7 +1017,6 @@
 #set private-user 0
 
 
-
 ##### FILESYSTEM MODULE #####
 
 # uncomment this line to load the file system module, this provides
@@ -1057,7 +1051,6 @@
 set max-filesize 1024
 
 
-
 ##### NOTES MODULE #####
 
 # this provides support for storing of notes for users from each other
@@ -1092,7 +1085,6 @@
 die "You didn't edit your config file like you were told, did you?"
 
 
-
 ##### CONSOLE MODULE #####
 
 # this module provides storage of console settings when you exit the bot
@@ -1112,7 +1104,6 @@
 set info-party 0
 
 
-
 ##### WOOBIE MODULE #####
 
 # this serves absolutely no purpose and is for demonstrative
@@ -1120,7 +1111,6 @@
 #loadmodule woobie
 
 
-
 ##### SEEN MODULE #####
 
 # this module provides seen commands via msg, on channel or via
@@ -1144,7 +1134,6 @@
 #checkmodule blowfish
 
 
-
 ##### ASSOC MODULE #####
 
 # uncomment this line to load assoc support, i.e naming channels on
@@ -1152,7 +1141,6 @@
 #loadmodule assoc
 
 
-
 ##### WIRE MODULE #####
 
 # this module provides all the standard .wire commands via dcc.
@@ -1161,17 +1149,15 @@
 #loadmodule wire
 
 
-
-#####  SCRIPTS  #####
+##### SCRIPTS #####
 
 # these are some commonly loaded (and needed) scripts.
 source scripts/alltools.tcl
 source scripts/action.fix.tcl
 
-#this script provides many usefull minor informational commands
-# (like setting users url's, email address, etc) you can modify
+# This script provides many usefull minor informational commands
+# (like setting users url's, email address, etc). You can modify
 # it to add extra entries, you might also want to modify help/userinfo.help
-# and help/msg/userinfo.help to change the help files
+# and help/msg/userinfo.help to change the help files.
 source scripts/userinfo1.0.tcl
 loadhelp userinfo.help
-
diff -urNPX ../exclude ../eggdrop1.3.cvs/scripts/weed ./scripts/weed
--- ../eggdrop1.3.cvs/scripts/weed	Sat Oct  9 12:26:19 1999
+++ ./scripts/weed	Thu Oct 21 23:11:56 1999
@@ -22,28 +22,30 @@
 # field exactly matched 40 characters it would save it with no spaces after
 # it and eggdrop would reject the user record.  I know I could have easily
 # changed one character, but I couldn't help myself.  <grin>
-#                                         5 march 96
+#                                         5 march 1996
 #
-# <robey, 23jul96>:
+# <robey, 23jul1996>:
 #     upgrade for v2 userfiles
-# <bruce s, 4sep96>:
+# <bruce s, 04sep1996>:
 #     fixed xtra field from getting truncated
-# <robey, 20sep96>:
+# <robey, 20sep1996>:
 #     stopped it from mangling channel ban lists
-# <Ec|ipse & dtM, 10jun97>:
+# <Ec|ipse & dtM, 10jun1997>:
 #     upgrade for v3 userfiles
-# <Ec|ipse 18jun97>:
+# <Ec|ipse 18jun1997>:
 #     added an option to remove users from unwanted channels
-# <Ec|ipse 28oct97>:
+# <Ec|ipse 28oct1997>:
 #     upgrade for v4 userfiles, with v3 converter
-# <Ernst 8mar98>:
+# <Ernst 8mar1998>:
 #     fixed bug "list element in braces followed by X instead of space"
 #       (the use of "lrange" where you aren't sure if it's a list is bad)
 #     fixed --CONSOLE item not being included, creating "user" --CONSOLE
-# <Ernst 1apr98>:
+# <Ernst 1apr1998>:
 #     two more improper ocurrences of "lrange" removed
 # <rtc 20sep1999>:
 #     removed ancient way of determining the current time.
+# <Tothwolf 21oct1999
+#     [clock] isn't in all versions of Tcl...
 #
 
 set exempt {*ban *ignore}
@@ -57,7 +59,14 @@
 set chanrem {}
 set convert 0
 
-set CURRENT [clock seconds]
+if {![string compare "" [info commands clock]]} then {
+  set fd [open "/tmp/egg.timer." w]
+  close $fd
+  set CURRENT [file atime "/tmp/egg.timer."]
+  exec rm -f /tmp/egg.timer.
+} else {
+  set CURRENT [clock seconds]
+}
 
 if {$argc < 1} {
   puts stdout "\nUsage: weed <userfile> \[options\]"


More information about the Patches mailing list