From a1479a87757fb5e9b48f3c8bb5dd9cc247406f1a Mon Sep 17 00:00:00 2001 From: "rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Mon, 19 Jul 2004 14:08:30 +0000 Subject: BUILD : 1.7.4 (264) BUGS : N/A NOTES : Switched to autoconf - try to commit part 1 git-svn-id: svn://svn.anope.org/anope/trunk@264 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@169 5417fbe8-f217-4b02-8779-1006273d7864 --- Changes | 1 + Config | 374 ++ Makefile | 178 - Makefile.in | 53 + aclocal.m4 | 229 + actions.c | 95 - bin/am | 420 -- bin/anoperc | 136 - bin/cp-recursive | 21 - bin/langtool | 239 - bin/mydbgen | 207 - bin/register | 101 - botserv.c | 2593 ---------- channels.c | 1633 ------ chanserv.c | 6257 ----------------------- commands.c | 178 - commands.h | 34 - compat.c | 212 - config.c | 1333 ----- config.guess | 1360 +++++ config.h | 81 - config.sub | 1375 ++++++ configure | 11543 ++++++++++++++++++++++++++++++++++++------- configure.in | 210 + converter.c | 398 -- datafiles.c | 510 -- datafiles.h | 67 - defs.h | 40 - encrypt.c | 434 -- encrypt.h | 16 - extern.h | 925 ---- helpserv.c | 83 - hostserv.c | 1107 ----- include/commands.h | 34 + include/config.h | 81 + include/datafiles.h | 67 + include/defs.h | 40 + include/encrypt.h | 16 + include/extern.h | 925 ++++ include/messages.h | 23 + include/modules.h | 233 + include/pseudo.h | 20 + include/services.h | 1521 ++++++ include/slist.h | 63 + include/sysconf.h.in | 209 + include/timeout.h | 50 + include/version.sh | 146 + init.c | 849 ---- install.sh | 0 lang/Makefile | 7 +- language.c | 265 - list.c | 178 - log.c | 298 -- mail.c | 246 - main.c | 537 -- memory.c | 96 - memoserv.c | 1382 ------ messages.c | 1284 ----- messages.h | 23 - misc.c | 711 --- modules.c | 2029 -------- modules.h | 233 - modules/Makefile | 26 - modules/README | 1 - modules/compile.sh | 37 - modules/configure | 21 - modules/hs_moo.c | 104 - modules/ircd_catserv.c | 128 - modules/module.h | 9 - mysql.c | 1638 ------ news.c | 541 -- nickserv.c | 4169 ---------------- operserv.c | 5064 ------------------- process.c | 268 - protocol.c | 168 - proxy.c | 793 --- pseudo.h | 20 - rdb.c | 466 -- send.c | 240 - servers.c | 259 - services.h | 1516 ------ sessions.c | 834 ---- slist.c | 325 -- slist.h | 63 - sockutil.c | 549 -- src/Makefile | 107 + src/actions.c | 95 + src/bin/am | 420 ++ src/bin/anoperc | 136 + src/bin/cp-recursive | 21 + src/bin/langtool | 239 + src/bin/mydbgen | 207 + src/bin/register | 101 + src/botserv.c | 2593 ++++++++++ src/channels.c | 1633 ++++++ src/chanserv.c | 6257 +++++++++++++++++++++++ src/commands.c | 178 + src/compat.c | 212 + src/config.c | 1333 +++++ src/converter.c | 398 ++ src/datafiles.c | 510 ++ src/encrypt.c | 434 ++ src/helpserv.c | 83 + src/hostserv.c | 1107 +++++ src/init.c | 849 ++++ src/language.c | 265 + src/list.c | 178 + src/log.c | 298 ++ src/mail.c | 246 + src/main.c | 537 ++ src/memory.c | 96 + src/memoserv.c | 1382 ++++++ src/messages.c | 1284 +++++ src/misc.c | 711 +++ src/modules.c | 2023 ++++++++ src/modules/Makefile | 32 + src/modules/README | 1 + src/modules/compile.sh | 37 + src/modules/configure | 21 + src/modules/hs_moo.c | 104 + src/modules/ircd_catserv.c | 128 + src/modules/module.h | 9 + src/mysql.c | 1638 ++++++ src/news.c | 541 ++ src/nickserv.c | 4169 ++++++++++++++++ src/operserv.c | 5064 +++++++++++++++++++ src/process.c | 268 + src/protocol.c | 168 + src/proxy.c | 797 +++ src/rdb.c | 466 ++ src/send.c | 240 + src/servers.c | 259 + src/sessions.c | 834 ++++ src/slist.c | 325 ++ src/sockutil.c | 549 ++ src/timeout.c | 130 + src/users.c | 1161 +++++ src/vsnprintf.c | 518 ++ timeout.c | 130 - timeout.h | 50 - users.c | 1161 ----- version.log | 6 +- version.sh | 146 - vsnprintf.c | 518 -- 144 files changed, 58146 insertions(+), 46505 deletions(-) create mode 100755 Config delete mode 100644 Makefile create mode 100644 Makefile.in create mode 100644 aclocal.m4 delete mode 100644 actions.c delete mode 100755 bin/am delete mode 100755 bin/anoperc delete mode 100755 bin/cp-recursive delete mode 100755 bin/langtool delete mode 100755 bin/mydbgen delete mode 100755 bin/register delete mode 100644 botserv.c delete mode 100644 channels.c delete mode 100644 chanserv.c delete mode 100644 commands.c delete mode 100644 commands.h delete mode 100644 compat.c delete mode 100644 config.c create mode 100644 config.guess delete mode 100644 config.h create mode 100644 config.sub create mode 100644 configure.in delete mode 100644 converter.c delete mode 100644 datafiles.c delete mode 100644 datafiles.h delete mode 100644 defs.h delete mode 100644 encrypt.c delete mode 100644 encrypt.h delete mode 100644 extern.h delete mode 100644 helpserv.c delete mode 100644 hostserv.c create mode 100644 include/commands.h create mode 100644 include/config.h create mode 100644 include/datafiles.h create mode 100644 include/defs.h create mode 100644 include/encrypt.h create mode 100644 include/extern.h create mode 100644 include/messages.h create mode 100644 include/modules.h create mode 100644 include/pseudo.h create mode 100644 include/services.h create mode 100644 include/slist.h create mode 100644 include/sysconf.h.in create mode 100644 include/timeout.h create mode 100644 include/version.sh delete mode 100644 init.c create mode 100644 install.sh delete mode 100644 language.c delete mode 100644 list.c delete mode 100644 log.c delete mode 100644 mail.c delete mode 100644 main.c delete mode 100644 memory.c delete mode 100644 memoserv.c delete mode 100644 messages.c delete mode 100644 messages.h delete mode 100644 misc.c delete mode 100644 modules.c delete mode 100644 modules.h delete mode 100644 modules/Makefile delete mode 100644 modules/README delete mode 100755 modules/compile.sh delete mode 100755 modules/configure delete mode 100644 modules/hs_moo.c delete mode 100644 modules/ircd_catserv.c delete mode 100644 modules/module.h delete mode 100644 mysql.c delete mode 100644 news.c delete mode 100644 nickserv.c delete mode 100644 operserv.c delete mode 100644 process.c delete mode 100644 protocol.c delete mode 100644 proxy.c delete mode 100644 pseudo.h delete mode 100644 rdb.c delete mode 100644 send.c delete mode 100644 servers.c delete mode 100644 services.h delete mode 100644 sessions.c delete mode 100644 slist.c delete mode 100644 slist.h delete mode 100644 sockutil.c create mode 100644 src/Makefile create mode 100644 src/actions.c create mode 100755 src/bin/am create mode 100755 src/bin/anoperc create mode 100755 src/bin/cp-recursive create mode 100755 src/bin/langtool create mode 100755 src/bin/mydbgen create mode 100755 src/bin/register create mode 100644 src/botserv.c create mode 100644 src/channels.c create mode 100644 src/chanserv.c create mode 100644 src/commands.c create mode 100644 src/compat.c create mode 100644 src/config.c create mode 100644 src/converter.c create mode 100644 src/datafiles.c create mode 100644 src/encrypt.c create mode 100644 src/helpserv.c create mode 100644 src/hostserv.c create mode 100644 src/init.c create mode 100644 src/language.c create mode 100644 src/list.c create mode 100644 src/log.c create mode 100644 src/mail.c create mode 100644 src/main.c create mode 100644 src/memory.c create mode 100644 src/memoserv.c create mode 100644 src/messages.c create mode 100644 src/misc.c create mode 100644 src/modules.c create mode 100644 src/modules/Makefile create mode 100644 src/modules/README create mode 100755 src/modules/compile.sh create mode 100755 src/modules/configure create mode 100644 src/modules/hs_moo.c create mode 100644 src/modules/ircd_catserv.c create mode 100644 src/modules/module.h create mode 100644 src/mysql.c create mode 100644 src/news.c create mode 100644 src/nickserv.c create mode 100644 src/operserv.c create mode 100644 src/process.c create mode 100644 src/protocol.c create mode 100644 src/proxy.c create mode 100644 src/rdb.c create mode 100644 src/send.c create mode 100644 src/servers.c create mode 100644 src/sessions.c create mode 100644 src/slist.c create mode 100644 src/sockutil.c create mode 100644 src/timeout.c create mode 100644 src/users.c create mode 100644 src/vsnprintf.c delete mode 100644 timeout.c delete mode 100644 timeout.h delete mode 100644 users.c delete mode 100644 version.sh delete mode 100644 vsnprintf.c diff --git a/Changes b/Changes index 377d22216..e6ca4fb8e 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Anope Version S V N ------------------- Provided by Anope Dev. - 2004 +07/17 A Switched to autoconf for configure script. [ #00] 07/05 A Warning when LocalAddress conflicts with RemoteServer. [#118] 06/18 A Added proper Bahamut1.8 support. [ #55] 07/15 F Fixed the bug where /ns release didn't work with UseSVSHOLD. [#125] diff --git a/Config b/Config new file mode 100755 index 000000000..90d73b3d1 --- /dev/null +++ b/Config @@ -0,0 +1,374 @@ +#!/bin/sh +# +# Configuration script for Services. +# +# Anope (c) 2003 Anope team +# Contact us at dev@anope.org +# +# This program is free but copyrighted software; see the file COPYING for +# details. +# +# Based on the original code of Epona by PegSoft. +# Based on the original code of Services by Andy Church. +# +########################################################################### + +echo2 () { + $ECHO2 "$*$ECHO2SUF" # these are defined later +} + +ECHO2SUF='' +if [ "`echo -n a ; echo -n b`" = "ab" ] ; then + ECHO2='echo -n' +elif [ "`echo 'a\c' ; echo 'b\c'`" = "ab" ] ; then + ECHO2='echo' ; ECHO2SUF='\c' +elif [ "`printf 'a' 2>&1 ; printf 'b' 2>&1`" = "ab" ] ; then + ECHO2='printf "%s"' +else + # oh well... + ECHO2='echo' +fi +export ECHO2 ECHO2SUF + +exists () { # because some shells don't have test -e + if [ -f $1 -o -d $1 -o -p $1 -o -c $1 -o -b $1 ] ; then + return 0 + else + return 1 + fi +} + +########################################################################### +# Init values +########################################################################### + +BINDEST=$HOME/services +DATDEST=$HOME/services +RUNGROUP= +UMASK= +IRCTYPE="no default" +ENCRYPTION= + +########################################################################### +# Load the cache +########################################################################### +if [ -f config.cache -a -r config.cache -a ! "$IGNORE_CACHE" ] ; then +cat <config.cache +BINDEST="$BINDEST" +DATDEST="$DATDEST" +RUNGROUP="$RUNGROUP" +UMASK=$UMASK +IRCTYPE=$IRCTYPE +IRCTYPE_DEF="$IRCTYPE_DEF" +ENCRYPTION="$ENCRYPTION" +EOT +echo "done." + + +################################################################################ +# Build the configure string +################################################################################ + +WITH_BIN="" +WITH_DATA="" +WITH_ENC="" +WITH_IRCD="" +WITH_RUN="" +WITH_PERM="" + +if [ "$BINDEST" != "" ] ; then + WITH_BIN=" --with-bindir=$BINDEST" + WITH_DATA=" --with-datadir=$DATDEST" +fi + +if [ "$DATDEST" != "" ] ; then + WITH_DATA=" --with-datadir=$DATDEST" +fi + +if [ "$ENCRYPTION" != "" ] ; then + WITH_ENC=" --with-encryption" +fi + +if [ "$IRCTYPE_DEF" != "" ] ; then + WITH_IRCD=" --with-ircd=$IRCTYPE_DEF" +fi + +if [ "$RUNGROUP" != "" ] ; then + WITH_RUN=" --with-rungroup=$RUNGROUP" +fi + +if [ "$UMASK" != "" ] ; then + WITH_PERM=" --with-permissions=$UMASK" +fi + +./configure $WITH_BIN $WITH_DATA $WITH_ENC $WITH_IRCD $WITH_RUN $WITH_PERM + diff --git a/Makefile b/Makefile deleted file mode 100644 index a431d673d..000000000 --- a/Makefile +++ /dev/null @@ -1,178 +0,0 @@ -# Makefile for Epona. -# -# Epona (c) 2000-2002 PegSoft -# Contact us at epona@pegsoft.net -# -# This program is free but copyrighted software; see the file COPYING for -# details. -# -# Based on the original code of Services by Andy Church. - -include Makefile.inc - -########################################################################### -########################## Configuration section ########################## - -# Note that changing any of these options (or, in fact, anything in this -# file) will automatically cause a full rebuild of Services. - -# Compilation options: -# -DCLEAN_COMPILE Attempt to compile without any warnings (note that -# this may reduce performance) -# -DSTREAMLINED Leave out "fancy" options to enhance performance - -CDEFS = - -# Add any extra flags you want here. The default line enables warnings and -# debugging symbols on GCC. If you have a non-GCC compiler, you may want -# to comment it out or change it. - -MORE_CFLAGS = -Wall -g - - -######################## End configuration section ######################## -########################################################################### - - -CFLAGS = $(CDEFS) $(BASE_CFLAGS) $(MORE_CFLAGS) - - -OBJS = actions.o botserv.o channels.o chanserv.o commands.o compat.o converter.o \ - config.o datafiles.o encrypt.o helpserv.o hostserv.o init.o language.o list.o log.o mail.o main.o \ - memory.o memoserv.o messages.o misc.o modules.o news.o nickserv.o operserv.o \ - process.o protocol.o proxy.o send.o servers.o sessions.o slist.o sockutil.o \ - timeout.o users.o \ - $(VSNPRINTF_O) $(RDB_O) $(MYSQL_O) -SRCS = actions.c botserv.c channels.c chanserv.c commands.c compat.c converter.c \ - config.c datafiles.c encrypt.c helpserv.c hostserv.c init.c language.c list.c log.c mail.c main.c \ - memory.c memoserv.c messages.c misc.c modules.c news.c nickserv.c operserv.c \ - process.c protocol.c proxy.c send.c servers.c sessions.c slist.c sockutil.c \ - timeout.c users.c \ - $(VSNPRINTF_C) $(RDB_C) $(MYSQL_C) - -.c.o: - $(CC) $(CFLAGS) -c $< - - -all: $(PROGRAM) languages modules - @echo Now run \"$(MAKE) install\" to install Services. - -myclean: - rm -f *.o $(PROGRAM) a.out - - -clean: myclean - (cd lang ; $(MAKE) spotless) - rm -f language.h - (cd modules ; $(MAKE) clean) - -spotless: myclean - (cd lang ; $(MAKE) spotless) - (cd modules ; rm -f *.so Makefile.inc) - rm -f config.cache configure.log sysconf.h Makefile.inc language.h version.h *~ - -distclean: spotless - -install: $(PROGRAM) languages - $(INSTALL) services $(BINDEST)/services - $(INSTALL) bin/anoperc $(BINDEST)/anoperc - rm -f $(BINDEST)/listnicks $(BINDEST)/listchans - ln $(BINDEST)/services $(BINDEST)/listnicks - ln $(BINDEST)/services $(BINDEST)/listchans - (cd lang ; $(MAKE) install) - $(CP_ALL) data/* $(DATDEST) - test -d $(DATDEST)/backups || mkdir $(DATDEST)/backups - test -d $(DATDEST)/logs || mkdir $(DATDEST)/logs - @if [ "$(MODULE_PATH)" ] ; then \ - (cd modules ; $(MAKE) install) ; \ - fi - @if [ "$(RUNGROUP)" ] ; then \ - echo chgrp -R $(RUNGROUP) $(DATDEST) ; \ - chgrp -R $(RUNGROUP) $(DATDEST) ; \ - echo chmod -R g+rw $(DATDEST) ; \ - chmod -R g+rw $(DATDEST) ; \ - echo find $(DATDEST) -type d -exec chmod g+xs \'\{\}\' \\\; ; \ - find $(DATDEST) -type d -exec chmod g+xs '{}' \; ; \ - fi - @echo "" - @echo "Don't forget to create/update your services.conf file! See" - @echo "the README for details." - @echo "" - -########################################################################### - -$(PROGRAM): version.h $(OBJS) - $(CC) $(LFLAGS) $(OBJS) $(LIBS) $(MLIBS) -o $@ $(ELIBS) - -languages: FRC - (cd lang ; $(MAKE) CFLAGS="$(CFLAGS)") - -modules: FRC - @if [ "$(MODULE_PATH)" ] ; then \ - (cd modules ; ./configure ; $(MAKE) CFLAGS="$(CFLAGS)") \ - fi - -# Catch any changes in compilation options at the top of this file -$(OBJS): Makefile - -actions.o: actions.c services.h -botserv.o: botserv.c services.h pseudo.h -channels.o: channels.c services.h -chanserv.o: chanserv.c services.h pseudo.h -commands.o: commands.c services.h commands.h language.h -compat.o: compat.c services.h -config.o: config.c services.h -converter.o: converter.c services.h datafiles.h -datafiles.o: datafiles.c services.h datafiles.h -encrypt.o: encrypt.c encrypt.h sysconf.h -init.o: init.c services.h -hostserv.o: hostserv.c services.h pseudo.h -language.o: language.c services.h language.h -list.o: list.c services.h -log.o: log.c services.h pseudo.h -mail.o: mail.c services.h language.h -main.o: main.c services.h timeout.h version.h -memory.o: memory.c services.h -memoserv.o: memoserv.c services.h pseudo.h -messages.o: messages.c services.h messages.h language.h -misc.o: misc.c services.h language.h -news.o: news.c services.h pseudo.h -nickserv.o: nickserv.c services.h pseudo.h -operserv.o: operserv.c services.h pseudo.h -process.o: process.c services.h messages.h -protocol.o: protocol.c services.h -proxy.o: proxy.c services.h pseudo.h -send.o: send.c services.h -servers.o: servers.c services.h -sessions.o: sessions.c services.h pseudo.h -slist.o: slist.c services.h slist.h -sockutil.o: sockutil.c services.h -timeout.o: timeout.c services.h timeout.h -users.o: users.c services.h -vsnprintf.o: vsnprintf.c - - -services.h: sysconf.h config.h extern.h - touch $@ - -extern.h: slist.h - touch $@ - -pseudo.h: commands.h language.h timeout.h encrypt.h datafiles.h slist.h - touch $@ - -version.h: Makefile version.sh version.log services.h pseudo.h messages.h $(SRCS) - sh version.sh - -language.h: lang/language.h - cp -p lang/language.h . - -lang/language.h: lang/Makefile lang/index - (cd lang ; $(MAKE) language.h) - -lang/index: - (cd lang ; $(MAKE) index) - -########################################################################### - -FRC: diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 000000000..f5c56c7a9 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,53 @@ +CC=@CC@ +INCLUDEDIR=../include +ANOPELIBS=@ANOPELIBS@ +CFLAGS=@CFLAGS@ +SHELL=/bin/sh +SUBDIRS=src +BINDEST=@BINDEST@ +DATDEST=@DATDEST@ +INSTALL=@INSTALL@ +RM=@RM@ +CP=@CP@ +TOUCH=@TOUCH@ +MODULE_PATH=@MODULE_PATH@ +MYSQL=@MYSQL@ +RDB=@RDB@ + +all: language headers build modules + +MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ + 'LDFLAGS=${LDFLAGS}' 'BINDEST=${BINDEST}' 'INSTALL=${INSTALL}' \ + 'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \ + 'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \ + 'RUNGROUP=${RUNGROUP}' 'MODULE_PATH=${MODULE_PATH}' 'RDB=${RDB}'\ + 'MYSQL=${MYSQL}' + +build: + @for i in $(SUBDIRS); do \ + echo "Building $$i";\ + ( cd $$i; ${MAKE} ${MAKEARGS} all; ) \ + done + +modules: build + (cd src/modules ; ./configure ; ${MAKE} ${MAKEARGS} all ) + +language: + (cd lang ; $(MAKE) ${MAKEARGS} all language.h ; cp language.h ../include/) + +headers: + (cd include ; ${MAKE} ${MAKEARGS} ) + +clean: + (cd lang ; ${MAKE} ${MAKEARGS} clean ) + (cd include ; ${MAKE} ${MAKEARGS} clean ) + (cd src ; ${MAKE} ${MAKEARGS} clean ) + +distclean: clean + (cd include ; ${MAKE} ${MAKEARGS} distclean) + rm -f config.log config.status config.cache Makefile + +install: DUMMY + (cd src ; ${MAKE} ${MAKEARGS} install) + +DUMMY: diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 000000000..f94135dad --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,229 @@ +dnl Macro: unet_CHECK_TYPE_SIZES +dnl +dnl Check the size of several types and define a valid int16_t and int32_t. +dnl +AC_DEFUN(unreal_CHECK_TYPE_SIZES, +[dnl Check type sizes +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +if test "$ac_cv_sizeof_int" = 2 ; then + AC_CHECK_TYPE(int16_t, int) + AC_CHECK_TYPE(u_int16_t, unsigned int) +elif test "$ac_cv_sizeof_short" = 2 ; then + AC_CHECK_TYPE(int16_t, short) + AC_CHECK_TYPE(u_int16_t, unsigned short) +else + AC_MSG_ERROR([Cannot find a type with size of 16 bits]) +fi +if test "$ac_cv_sizeof_int" = 4 ; then + AC_CHECK_TYPE(int32_t, int) + AC_CHECK_TYPE(u_int32_t, unsigned int) +elif test "$ac_cv_sizeof_short" = 4 ; then + AC_CHECK_TYPE(int32_t, short) + AC_CHECK_TYPE(u_int32_t, unsigned short) +elif test "$ac_cv_sizeof_long" = 4 ; then + AC_CHECK_TYPE(int32_t, long) + AC_CHECK_TYPE(u_int32_t, unsigned long) +else + AC_MSG_ERROR([Cannot find a type with size of 32 bits]) +fi +]) + +AC_DEFUN([ACX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_SAVE +AC_LANG_C +acx_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) + AC_MSG_RESULT($acx_pthread_ok) + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthread or + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" + ;; +esac + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) + if test x"$acx_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_TRY_LINK([#include ], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], + [acx_pthread_ok=yes]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($acx_pthread_ok) + if test "x$acx_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: threads are created detached by default + # and the JOINABLE attribute has a nonstandard name (UNDETACHED). + AC_MSG_CHECKING([for joinable pthread attribute]) + AC_TRY_LINK([#include ], + [int attr=PTHREAD_CREATE_JOINABLE;], + ok=PTHREAD_CREATE_JOINABLE, ok=unknown) + if test x"$ok" = xunknown; then + AC_TRY_LINK([#include ], + [int attr=PTHREAD_CREATE_UNDETACHED;], + ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) + fi + if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then + AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, + [Define to the necessary symbol if this constant + uses a non-standard name on your system.]) + fi + AC_MSG_RESULT(${ok}) + if test x"$ok" = xunknown; then + AC_MSG_WARN([we do not know how to create joinable pthreads]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with cc_r + AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + acx_pthread_ok=no + $2 +fi +AC_LANG_RESTORE +])dnl ACX_PTHREAD + diff --git a/actions.c b/actions.c deleted file mode 100644 index cb7fd0851..000000000 --- a/actions.c +++ /dev/null @@ -1,95 +0,0 @@ -/* Various routines to perform simple actions. - * - * (C) 2003 Anope Team - * Contact us at info@anope.org - * - * Please read COPYING and README for furhter details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * - * $Id$ - * - */ - -#include "services.h" - -/*************************************************************************/ - -/* Note a bad password attempt for the given user. If they've used up - * their limit, toss them off. - */ - -void bad_password(User * u) -{ - time_t now = time(NULL); - - if (!BadPassLimit) - return; - - if (BadPassTimeout > 0 && u->invalid_pw_time > 0 - && u->invalid_pw_time < now - BadPassTimeout) - u->invalid_pw_count = 0; - u->invalid_pw_count++; - u->invalid_pw_time = now; - if (u->invalid_pw_count >= BadPassLimit) - kill_user(NULL, u->nick, "Too many invalid passwords"); -} - -/*************************************************************************/ - -void change_user_mode(User * u, char *modes, char *arg) -{ -#ifndef IRC_HYBRID - int ac = 1; - char *av[2]; - - av[0] = modes; - if (arg) { - av[1] = arg; - ac++; - } -#ifdef IRC_BAHAMUT - send_cmd(ServerName, "SVSMODE %s %ld %s%s%s", u->nick, u->timestamp, - av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); -#else - send_cmd(ServerName, "SVSMODE %s %s%s%s", u->nick, av[0], - (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); -#endif - set_umode(u, ac, av); -#endif -} - -/*************************************************************************/ - -/* Remove a user from the IRC network. `source' is the nick which should - * generate the kill, or NULL for a server-generated kill. - */ - -void kill_user(const char *source, const char *user, const char *reason) -{ -#ifdef IRC_BAHAMUT - /* Bahamut uses SVSKILL as a better way to kill users. It sends back - * a QUIT message that Anope uses to clean up after the kill is done. - */ - send_cmd(NULL, "SVSKILL %s :%s", user, reason); -#else - char *av[2]; - char buf[BUFSIZE]; - - if (!user || !*user) - return; - if (!source || !*source) - source = ServerName; - if (!reason) - reason = ""; - snprintf(buf, sizeof(buf), "%s (%s)", source, reason); - av[0] = sstrdup(user); - av[1] = buf; - send_cmd(source, "KILL %s :%s", user, av[1]); - do_kill(source, 2, av); - free(av[0]); -#endif -} - -/*************************************************************************/ diff --git a/bin/am b/bin/am deleted file mode 100755 index 14b6d8638..000000000 --- a/bin/am +++ /dev/null @@ -1,420 +0,0 @@ -#!/usr/bin/env perl - -# ==================================================================== -# anomgr: Anope Manager. Used to manage anope revision on SubVersion. -# -# For usage, see the usage subroutine or run the script with no -# command line arguments. -# -# $Id$ -# -# ==================================================================== -require 5.6.0; -use strict; -use Getopt::Std; -use Net::FTP; -use Cwd; - -###################################################################### -# Configuration section. -my $myver="1.0"; -my $svnrev="http://www.zero.org/anosvn.php"; -my $fhint="version.log"; - -# Default values, change or use environment variables instead. -my $copy="anope"; -my $svnuser=""; -my $svnpath="/usr/bin"; -my $svnroot="svn://zero.org/repos/$copy"; -my $editor="/usr/bin/vi"; - -# Environment variables SVNBINDIR and SVNROOT override the above -# hardcoded values. -$svnuser="$ENV{SVNUSER}" if ($ENV{SVNUSER}); -$svnpath="$ENV{SVNBINDIR}" if ($ENV{SVNBINDIR}); -$svnroot="$ENV{SVNROOT}" if ($ENV{SVNROOT}); -$editor="$ENV{EDITOR}" if ($ENV{EDITOR}); - -# Svnlook path. -my $svnlook = "$svnpath/svnlook"; - -# Svn path. -my $svn = "$svnpath/svn"; - -# wget path. Need to change to a perl module instead... -my $wget = "$svnpath/wget"; - -my ( - $rev, - $branch, - $tag, - $ftp, - $dst, - $ver_major, - $ver_minor, - $ver_patch, - $ver_build, - $ver_revision, - $ver_comment, - $svn_comment, - $cver, - $nver, - $ctrlfile, - $tmpfile, - @source, - %opt -); - -{ - my $ok = 1; - foreach my $program ($svnlook, $svn, $editor) - { - if (-e $program) - { - unless (-x $program) - { - warn "$0: required program `$program' is not executable, ", - "edit $0.\n"; - $ok = 0; - } - } - else - { - warn "$0: required program `$program' does not exist, edit $0.\n"; - $ok = 0; - } - } - exit 1 unless $ok; -} - -sub usage() -{ - # More features to add: - # --diff N:M to produce a diff between revisions - # --bugs CLI method to add bug number to the commit message - # --mesg CLI methos to add the commit message - # --create-branch to create a branch - # --create-tag to create a tag - # --switch to switch between branches/tags - print "Usage: $0 <-g | -p | -f> [-r revision | -b branch | -t tag] \n"; - print " Operations:\n"; - print " -g Get Operation\n"; - print " -p Put Operation\n"; - print " -f[tar|diff] FTP Operation, retrieve latest tar or diff\n"; - print " Selector:\n"; - print " -r revision Retrieve by revision number\n"; - print " -b branch Retrieve by branch name\n"; - print " -t tag Retrieve by tag name\n"; - print " Destination:\n"; - print " The working copy to perform the operation in or to. The script will \n"; - print " try to guess where that is, unless you provide a specific path.\n"; - exit; -} - -sub banner() { - - print "Anope Source Managemnt Utility - Version $myver\n\n"; - -} - -sub getans { - my $ans; - while (! (($ans =~ /y/) || ($ans =~ /n/))) { - print "*** Ready to continue? (y/n): "; - $ans = ; - chomp($ans); - $ans = lc($ans); - # $ans = &getans(); - } - - # return $ans; - return ($ans eq "y") ? 1 : 0 -} - -sub find_conflict() { - - my $filename=shift; - my $retval=0; - open (IN2, "$filename") || die "Can't open $filename\n"; - while () { - if (/^<<<<<<new("ftp.zero.org"); - $ftpc->login("ftp","-anonymou@"); - $ftpc->cwd("/incoming"); - - if ( lc($ftp) eq "tar" ) { - print "Retrieving latest tar ball...\n"; - $ftpc->get("anope.tgz"); - } elsif ( lc($ftp) eq "diff" ) { - print "Retrieving latest patch file...\n"; - $ftpc->get("anope.diff"); - } else { - print "Unknown type $ftp, aborting...\n"; - } - $ftpc->quit(); -} - -sub do_get() { - - my $options = "" ; # Options to be passed to the svn command - my $selector = "" ; # Selector to be passed to the svn command - - if ($rev) { - $options .= "-r $rev"; - $selector = "trunk"; - $copy = $copy . "-$rev"; - } elsif ($tag) { - $selector = "tags/$tag"; - $copy = $copy . "-$tag"; - } elsif ($branch) { - $selector = "branches/$branch"; - $copy = $copy . "-$branch"; - } else { - $selector = "trunk"; - } - - if ($dst eq undef) { - my $cwd = &Cwd::cwd(); - if (-f "$cwd/$fhint") { - system("$svn update $options $cwd"); - } elsif (-f "$cwd/$copy/$fhint") { - system("$svn update $options $cwd/$copy"); - } else { - system("$svn checkout $svnroot/$selector $options $cwd/$copy"); - } - } else { - $dst = &Cwd::cwd() if ($dst eq "\.") ; - if (-f "$dst/$fhint") { - system("$svn update $options $dst"); - } else { - system("$svn checkout $svnroot/$selector $options $dst"); - } - } -} - -sub do_put() { - - if ($dst eq undef) { - my $cwd = &Cwd::cwd(); - if (-f "$cwd/$fhint") { - $dst = "$cwd"; - } elsif (-f "$cwd/$copy/$fhint") { - $dst .= "$cwd/$copy"; - } else { - print "Error: Unable to determine your working copy location.\n"; - exit; - } - } else { - $dst = &Cwd::cwd() if ($dst eq "\.") ; - if (! -f "$dst/$fhint") { - print "Error: Unable to determine your working copy location.\n"; - exit; - } - } - - # Check to see if we need to update our working copy first. - my $nupdate; - open (IN, "$svn status --show-updates --verbose $dst|"); - while () { - if (/\*/) { - $nupdate .= "$_"; - } - } - close(IN); - - if ($nupdate ne undef) { - print "*** Warning: There are files modified in the repository that need\n"; - print "*** to be merged back to your working copy before the commit can\n"; - print "*** take place. These files are:\n"; - print $nupdate; - print "Please use: $0 -g $dst\n"; - exit; - } - - # Get a prelim diff of the changes... - my $dcount=0; - my $conflict; - # open (IN, "$svn diff $dst|"); - open (IN, "$svn status $dst|"); - while () { - if (!/^\?/) { - $dcount++; - } - - if (/^C/) { - $_ =~ s/^C\s+//; - chomp($_); - # I don't want to use grep. But my find_conflict sub - # does not seem to work :( Too bad - if (`grep "^<<<<<<<" $_`) { - $conflict .= "$_\n" ; - } else { - system("$svn resolved $_"); - } - } - } - close(IN); - - if ($dcount == 0) { - print "*** Warning: There are no modified files to be commited. Are you\n"; - print "*** sure you are in the right working copy? Verify changes with:\n"; - print "*** $svn diff $dst\n"; - exit; - } - - if ($conflict ne undef) { - print "*** Warning: There are merge conflicts to be resolved! Please take\n"; - print "*** a look at the following files and resolve them manually:\n\n"; - print "$conflict\n"; - exit; - } - - $ctrlfile = "$dst/$fhint"; - # Grab the current revision number. Clunky way, I know! - $ver_revision=`$wget -qO - $svnrev`; - chomp($ver_revision); - - unless ($ver_revision =~ /^\d+/ and $ver_revision > 0) - { - print "*** Error: Got bogus result $ver_revision from $svnrev.\n"; - exit; - } - - $ver_revision++; - open (REV, "$ctrlfile") || die "Can't open $ctrlfile\n"; - while () { - push (@source, $_); - $ver_major = $_ if (/VERSION_MAJOR/); - $ver_minor = $_ if (/VERSION_MINOR/); - $ver_patch = $_ if (/VERSION_PATCH/); - $ver_build = $_ if (/VERSION_BUILD/); - } - close(REV); - - my $junk; - ($junk, $ver_major) = split('"', $ver_major); - ($junk, $ver_minor) = split('"', $ver_minor); - ($junk, $ver_patch) = split('"', $ver_patch); - ($junk, $ver_build) = split('"', $ver_build); - - $cver = "$ver_major.$ver_minor.$ver_patch ($ver_build)"; - $nver = "$ver_major.$ver_minor.$ver_patch ($ver_revision)"; - - # Greet the developer - banner(); - print "*** Repository : $svnroot \n"; - print "*** Working copy : $dst \n" ; - print "*** Current ver. : $cver \n"; - print "*** Updated ver. : $nver \n"; - print "*** Files Changed: $dcount (before indent and version change)\n"; - die ("Aborting...\n") unless &getans(); - - # Need to add a clause for -c "comment" and -b "buglist" - - # Get developers input for commit - $tmpfile=".commit"; - open (OUT, ">$tmpfile") or die ("*** Error! Unable to open $tmpfile file\n"); - print OUT "# Anope commit utility. Please use this template for your commits. -# Add Bugzilla bugs separated by spaces. The note part is free form. -BUILD : $nver -BUGS : -NOTES : "; - close(OUT); - - system("$editor $tmpfile"); - - my $tmp_comment=""; - $ver_comment="#\n"; - $svn_comment=""; - open (IN, "$tmpfile") or die ("*** Error! Unable to open $tmpfile file\n"); - while () { - if ( !/^#/) { - $tmp_comment.="$_"; - chomp($_); - $_ =~ s/\t/ /g; - $ver_comment.="# $_\n"; - $svn_comment.="$_ "; - } - } - close(IN); - - $svn_comment =~ s/\s\s+/ /g; - # Confirm the commit one last time... - print "*** Ready to commit, please verify:\n"; - print "\n$tmp_comment\n"; - - die ("Aborting...\n") unless &getans(); - - print "*** Running Indent...\n"; - system("indent -kr -nut *.c"); - system("rm -f *~"); - - print "*** Bumping the revision number...\n"; - # Re-write the control file - open(OUT, ">$ctrlfile") or die ("*** Error! Unable to open $ctrlfile ... aborting"); - foreach (@source) { - if (/^VERSION_BUILD/) { - $_ =~ s/\"\d+\"/\"$ver_revision\"/; - } elsif (/# \$Log\$/) { - $_ .= "$ver_comment"; - } - print OUT $_; - } - close(OUT); - - print "*** Starting the upload...\n\n"; - my $rval=system("$svn commit $dst --username='$svnuser' --message '$svn_comment'"); - if ( $rval ) { - print "*** Error: Unable to complete commit. Rolling back....\n\n"; - system("$svn revert $ctrlfile"); - } - -} - -{ - usage() if (! @ARGV); - - my $opt = 'hgpf:r:b:t:'; - getopts ("$opt", \%opt) or usage(); - usage() if $opt{h}; - - usage() if ($opt{g} && $opt{p}); - usage() if ($opt{g} && $opt{f}); - usage() if ($opt{p} && $opt{f}); - usage() if ($opt{r} && $opt{b}); - usage() if ($opt{r} && $opt{t}); - usage() if ($opt{b} && $opt{t}); - - $rev = $opt{r} ; - $branch = $opt{b} ; - $tag = $opt{t} ; - $ftp = $opt{f} ; - $dst = shift; - - if ($rev ne undef) { - unless ($rev =~ /^\d+/ and $rev > 0) - { - print "*** Error: Revision number '$rev' must be an integer > 0.\n"; - exit; - } - } - - do_ftp() if $opt{f}; - do_get() if $opt{g}; - do_put() if $opt{p}; - print "*** Done!\n"; - -} - - diff --git a/bin/anoperc b/bin/anoperc deleted file mode 100755 index bc0704f12..000000000 --- a/bin/anoperc +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/sh - -############################################### -# Set Variables -############################################### - -# PID FILE NAME (e.g. services.pid) -PIDFILE="services.pid" - -# FULL PATH TO ANOPE DIRECTORY e.g. /home/ribosome/services/ -# YOU MUST INCLUDE TRAILING SLASH -ANOPEBIN="" - -# SERVICES EXECUTABLE NAME (e.g. services) -ANOPROG="services" - -# SCRIPT VERSION NUMBER (DO NOT ALTER) -ARCVERSION="1.1" - - -################################################ -# END OF CONFIGURATION -# YOU ARE NOT REQUIRED TO CHANGE ANYTHING BELOW -################################################ - -isAnopeRunning () { -if [ ! -f $ANOPEBIN$PIDFILE ] ; then - echo "Warning: Anope is not currently running" - exit 1 -fi - -PID=`cat $ANOPEBIN$PIDFILE` - -if [ ! `ps auxw | grep $ANOPROG | grep $PID | grep -v -c grep` ] ; then - echo "Warning: Anope is not currently running" - exit 1 -fi -} - -if [ "$ANOPEBIN" = "" ] ; then - echo "Error: Please open this file set the variables correctly"; - exit 1 -fi - -if [ ! -f $ANOPEBIN$ANOPROG ] ; then - echo "Error: $ANOPEBIN$ANOPROG cannot be accessed" - exit 1 -fi - -if [ "$1" = "start" ] ; then - -if [ -f $ANOPEBIN$PIDFILE ] ; then - PID=`cat $ANOPEBIN$PIDFILE` - if [ `ps auxw | grep $ANOPROG | grep $PID | grep -v -c grep` = 1 ] ; then - echo "Warning! Anope is already running" - exit 1 - fi -fi - echo "Starting Anope" - shift - $ANOPEBIN$ANOPROG $* - sleep 1 - if [ ! -f $ANOPEBIN$PIDFILE ] ; then - echo "Unfortunately it seems Anope did not start successfully" - echo "This error has been logged in your Anope Log file" - echo "Located in "$ANOPEBIN"logs/" - echo "This may help you diagnose the problem" - echo "Further help may be available from http://www.anope.org" - exit 1 - fi - PID=`cat $ANOPEBIN$PIDFILE` - if [ ! `ps auxw | grep $ANOPROG | grep $PID | grep -v -c grep` ] ; then - echo "Unfortunately it seems Anope did not start successfully" - echo "This error has been logged in your Anope Log file" - echo "Located in "$ANOPEBIN"logs/" - echo "This may help you diagnose the problem" - echo "Further help may be available from http://www.anope.org" - exit 1 - fi -elif [ "$1" = "stop" ] ; then - isAnopeRunning - echo "Terminating Anope" - PID=`cat $ANOPEBIN$PIDFILE` - kill -SIGTERM $PID - -elif [ "$1" = "status" ] ; then - if [ -f $ANOPEBIN$PIDFILE ] ; then - PID=`cat $ANOPEBIN$PIDFILE` - if [ `ps auxw | grep $ANOPROG | grep $PID | grep -v -c grep` = 1 ] ; then - echo "Anope is currently running" - exit 1 - fi - fi - - echo "Anope is not currently running" - -elif [ "$1" = "restart" ] ; then - isAnopeRunning - echo "Restarting Anope" - PID=`cat $ANOPEBIN$PIDFILE` - kill -SIGHUP $PID - -elif [ "$1" = "rehash" ] ; then - isAnopeRunning - echo "Saving Databases and Rehashing Configuration" - PID=`cat $ANOPEBIN$PIDFILE` - kill -SIGUSR2 $PID - -elif [ "$1" = "version" ] ; then - $ANOPEBIN$ANOPROG -version - -elif [ "$1" = "help" ] ; then - if [ "$2" = "paramlist" ] ; then - $ANOPEBIN$ANOPROG -help - else - echo "AnopeRC is a remote control script for easy" - echo "controlling of Anope from the command console" - echo "$0 start Start Anope" - echo " Additional parameters may be passed" - echo " (e.g. $0 start -nofork)" - echo " For a list of type $0 $1 paramlist" - echo "$0 stop Shutdown Anope" - echo "$0 status Show Anope's Status" - echo "$0 restart Restart Anope (Databases will be saved)" - echo "$0 rehash Rehash Configuration and Save Databases" - echo "$0 version Return Anope Version and Build Information" - echo "$0 help Show this help menu" - echo "If you need further help please check the /docs/" - echo "folder or make use of our extensive online support at" - echo "http://www.anope.org" - fi - -else - echo "Anope Remote Control ($ARCVERSION)" - echo "Usage: $0 [start|stop|status|restart|rehash|version|help]" -fi diff --git a/bin/cp-recursive b/bin/cp-recursive deleted file mode 100755 index e51230db7..000000000 --- a/bin/cp-recursive +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -if [ $1 = "-t" ] ; then - shift -fi -if [ ! "$2" ] ; then - echo >&2 Usage: $0 ' ' - exit 1 -fi -if [ -d "$1" ] ; then - dir="$1" -else - dir="`echo $1 | sed 's#\(.*\)/.*#\1#'`" -fi -while [ "$2" ] ; do - shift -done -if [ ! -d $1 ] ; then - mkdir -p $1 || exit 1 -fi -/bin/tar -Ccf $dir - . | /bin/tar -Cxf $1 - diff --git a/bin/langtool b/bin/langtool deleted file mode 100755 index c1072760c..000000000 --- a/bin/langtool +++ /dev/null @@ -1,239 +0,0 @@ -#!/usr/bin/perl -# -# Ribosome's all in one language tool -# 1) Compares to check for missing lines -# 2) Compares to check for equal lines -# 3) Fixes (on request) missing lines -# 4) Checks for errors in lines -# 5) Checks for long lines (>60 characters) -# - -# Check to see if we have received arguments -if (!$ARGV[0]) { -print "Usage: $0 [language file]\n"; -exit; -} - -# If yes, set $sourcefile to the language filename -$testagainst = $ARGV[0]; - -# Set $sourcefile to en_us language file -$sourcefile = "en_us.l"; - -# Number of Keys in File, Number of Equal Lines, Number of Missing Lines -# Fixed Lines (optional) and Number of Format Error Lines, Number of Long Lines -my $numberlines = 0; -my $equallines = 0; -my $missinglines = 0; -my $fixedlines = 0; -my $errorline = 0; -my $longlines = 0; - -# Array to hold the lines from the source file and explosion array for long line check - -my @sourcearray; -my @explosion; - -# Create associative arrays which will contain keys and definitions -# One for the control source and one for what is being tested against - -my %sourcehash= (); -my %testhash= (); - -# Check if Files Exist - -if (! -f $sourcefile) { -print "Critical Error: The source file does not exist or is unreadable.\nNote: This tool must be run from the language directory.\n"; -exit; -} - -if (! -f $testagainst) { -print "Critical Error: The language file does not exist or is unreadable\n"; -exit; -} -########################################### -# Function to load sourcefile into memory # -########################################### - -sub load_sourcefile { - - my $_key; # This variable will hold the key - my $_def; # This variable will hold the definition - my $line; # This variable will hold the current line - - open (SOURCEFILE, "< $sourcefile"); # Open the source file - while () { # For each line the source file - $line = $_; # $line is set to the line in the source file - - # Skip comments - if (/^#/) { # This checks for # which indicates comment - next; # If detected, the next line is skipped to - } - - # Start of a key - if (/^[A-Z]/) { # Checks to see if the line is a key - chomp($line); # Removes things that shouldn't be at the end - push (@sourcearray, $line); # Puts the line into the source array - # If a key is defined, load definition into the hash - if ($_key ne undef) { # If the key is defined - $sourcehash{$_key} = $_def; # Add the definition to the associative array - } - $_key=$line; # Set the key to the line - $_def=""; # Reset the definition - next; # Move onto the next line - } - - if ($_key ne undef) { # If the key is set already - $_def.=$line; # The definition is the current line - } - - $sourcehash{$_key} = $_def; # Load the definition into the associative array - } # End of while which reads lines - - close (SOURCEFILE); # Close the source file - -} # End of load_sourcefile function - -################################################# -# Function to load testagainst file into memory # -################################################# - -sub load_testagainst { - - my $_key; # This variable will hold the key - my $_def; # This variable will hold the definition - my $line; # This variable will hold the current line - - open (TESTAGAINSTFILE, "< $testagainst"); # Open the file containing the control lines - while () { # For each line in the file - $line = $_; # $line is set to the lines value - - - # Skip comments - if (/^#/) { # This checks for # which indicates comment - next; # If detected, the next line is skipped to - } - - # Start of a key - if (/^[A-Z]/) { # Checks to see if the line is a key - chomp($line); # Removes things that shouldn't be at the end - - - if ($_key ne undef) { # If the key is defined - $testhash{$_key} = $_def; # Add the definition to the associative array - } - $_key=$line; # Set the key to the line - $_def=""; # Reset the definition - next; # Move onto the next line - } - - if ($_key ne undef) { # If the key is set already - $_def.=$line; # The definition is the current line - } - - $testhash{$_key} = $_def; # Load the definition into the associative array - } # End of while which reads lines - close (TESTAGAINSTFILE); # Close the source file - -} - - -sub get_format { # Function to get the formatting from a string - my $fmt=""; - my $str=shift; # Get the input - - while ($str =~ m/%\w/g) { - $fmt .= $&; - } - - return $fmt; # Return the formatting -} - - -load_sourcefile; # Call function to load the source file -load_testagainst; # Call function to load the test file - -if (!grep(/^LANG_NAME/,%testhash)) { -print "Critical Error: $ARGV[0] is not a valid language file!\n"; -exit; -} - -open (LOG,"> langcheck.log"); # Open logfile for writing - -foreach $sourcearray (@sourcearray) { # For each key stored in the source array - my $_key=$_; # Store key from source array in $_key - - if ((get_format($sourcehash{$sourcearray})) ne (get_format($testhash{$sourcearray}))) { - if ($sourcearray !~ STRFTIME ) { - $errorline++; - print LOG "FORMAT: $sourcearray - (expecting '".get_format($sourcehash{$sourcearray})."' and got '".get_format($testhash{$sourcearray})."')\n"; - } } - - if ($testhash{$sourcearray} eq $sourcehash{$sourcearray} ) { - # If the definitions between the source and the test are equal - $equallines++; # Number of equal lines increases - print LOG "EQUAL: $sourcearray\n"; # Line is written to logfile - } - - if (!grep(/^$sourcearray/,%testhash)) { # If the key is found in the testhash associative array - $missinglines++; # Increase missing lines - print LOG "MISSING: $sourcearray\n"; # Line is written to logfile - } - - @explosion = split(/\n/, $testhash{$sourcearray}); - foreach $explosion (@explosion) { - $explosion =~ s/\002//g; - $explosion =~ s/\037//g; - if (length($explosion) > 61) { - print LOG "LONGLINE: $sourcearray (".substr($explosion,1,30)."...)\n"; - $longlines++; - } - } - -$numberlines++; # Increase the number of lines tested by 1 -} -close (LOG); # Close the logfile - - -######################### -# Show the test results # -######################### - -print "Calculation Results:\n"; -print "----------------------------------\n"; -print "[$numberlines] line(s) were compared\n"; -print "[$equallines] line(s) were found to equal their $sourcefile counterpart(s)\n"; -print "[$missinglines] line(s) were found to be missing\n"; -print "[$longlines] line(s) were found to be long (>60 chars)\n"; -print "[$errorline] line(s) were found to have formatting errors\n"; -print "The specific details of the test have been saved in langcheck.log\n"; - -if ($missinglines) { # If missing lines exist -print "----------------------------------\n"; -print "Missing line(s) have been detected in this test, would you like to fix the file?\n"; -print "This automatically inserts values from the control file ($sourcefile) for the missing values\n"; -print "y/N? (Default: No) "; - -my $input = ; # Ask if the file should be fixed -if ((substr($input,0,1) eq "y") || (substr($input,0,1) eq "Y")) { # If Yes... - -open (FIX, ">> $testagainst"); # Open the file and append changes - -foreach $sourcearray (@sourcearray) { # For eac