Moved the scripts that create svn_revision.c and modules_init.* into a scripts
authorDave West <davew@uncensored.citadel.org>
Sat, 24 Oct 2009 15:47:01 +0000 (15:47 +0000)
committerDave West <davew@uncensored.citadel.org>
Sat, 24 Oct 2009 15:47:01 +0000 (15:47 +0000)
directory to clean the base dir a bit more.

citadel/bootstrap
citadel/mk_module_init.sh [deleted file]
citadel/mk_svn_revision.sh [deleted file]
citadel/scripts/mk_module_init.sh [new file with mode: 0755]
citadel/scripts/mk_svn_revision.sh [new file with mode: 0755]

index 94f101f2a8549e7ffe857270735ecd4894f56cca..14ceb3d83b7afb48e4ebfead2d4c69cadeefc5ad 100755 (executable)
@@ -23,10 +23,10 @@ echo ... running autoheader ...
 autoheader
 
 echo ... running mk_svn_revision.sh ...
-./mk_svn_revision.sh
+./scripts/mk_svn_revision.sh
 
 echo ... running mk_module_init.sh ...
-./mk_module_init.sh
+./scripts/mk_module_init.sh
 
 echo
 echo This script has been tested with autoconf 2.53 and
diff --git a/citadel/mk_module_init.sh b/citadel/mk_module_init.sh
deleted file mode 100755 (executable)
index 9ea76c8..0000000
+++ /dev/null
@@ -1,311 +0,0 @@
-#!/bin/sh
-#
-# Script to generate $C_FILE
-#
-
-ECHO=/usr/bin/printf
-
-#MINUS_e=X`$ECHO -n -e`
-#if [ $MINUS_e != "X" ] ; then
-#      MINUS_e=""
-#else
-#      MINUS_e="-e"
-#fi
-
-#MINUS_E=X`$ECHO -n -E`
-#if [ $MINUS_E != "X" ] ; then
-#      MINUS_E=""
-#else
-#      MINUS_E="-E"
-#fi
-
-
-CUR_DIR=`pwd`
-C_FILE="$CUR_DIR/modules_init.c"
-H_FILE="$CUR_DIR/modules_init.h"
-MOD_FILE="$CUR_DIR/Make_modules"
-SRC_FILE="$CUR_DIR/Make_sources"
-U_FILE="$CUR_DIR/modules_upgrade.c"
-
-/usr/bin/printf "Scanning extension modules for entry points.\n"
-
-
-#start of the files which inturn removes any existing file
-#
-
-# start the Makefile included file for $SERV_MODULES
-cat <<EOF  >$MOD_FILE
-#
-# Make_modules
-# This file is to be included by Makefile to dynamically add modules to the build process
-# THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
-#
-
-EOF
-
-# start the Makefile included file for $SOURCES
-cat <<EOF  >$SRC_FILE
-#
-# Make_sources
-# This file is to be included by Makefile to dynamically add modules to the build process
-# THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
-#
-
-EOF
-
-# start the upgrade file
-cat <<EOF  >$U_FILE
-/*
- * $U_FILE
- * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
- */
-
-
-
-#include "sysdep.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <time.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <libcitadel.h>
-#include "citadel.h"
-#include "modules_init.h"
-#include "sysdep_decls.h"
-
-
-
-
-void upgrade_modules (void)
-{
-
-    CtdlLogPrintf (CTDL_INFO, "Upgrade modules.\n");
-
-EOF
-
-# start the c file
-cat <<EOF  >$C_FILE
-/*
- * $C_FILE
- * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
- */
-
-
-
-#include "sysdep.h"
-#include <stdlib.h>
-#include <time.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <libcitadel.h>
-#include "citadel.h"
-#include "modules_init.h"
-#include "sysdep_decls.h"
-
-
-void LogPrintMessages(long err);
-extern long DetailErrorFlags;
-
-
-
-void initialise_modules (int threading)
-{
-    long filter;
-    nSizErrmsg = 0;
-
-    if (threading)
-        CtdlLogPrintf (CTDL_INFO, "Initialise modules, CtdlThreads enabled.\n");
-    else
-        CtdlLogPrintf (CTDL_INFO, "Initialise modules, CtdlThreads not yet enabled.\n");
-/* static server initialization: */
-        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(citserver));
-        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(control));
-        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(euidindex));
-        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(file_ops));
-        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(msgbase));
-        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(policy));
-        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(room_ops));
-        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(user_ops));
-/* dynamic modules: */
-
-EOF
-
-
-#start the header file
-cat <<EOF > $H_FILE
-/* 
- * $H_FILE
- * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
- */
-
-
-#ifndef MODULES_INIT_H
-#define MODULES_INIT_H
-#include "ctdl_module.h"
-extern size_t nSizErrmsg;
-void initialise_modules (int threading);
-void upgrade_modules(void);
-
-       CTDL_MODULE_INIT(citserver);
-       CTDL_MODULE_INIT(control);
-       CTDL_MODULE_INIT(euidindex);
-       CTDL_MODULE_INIT(file_ops);
-       CTDL_MODULE_INIT(msgbase);
-       CTDL_MODULE_INIT(policy);
-       CTDL_MODULE_INIT(room_ops);
-       CTDL_MODULE_INIT(user_ops);
-EOF
-
-for i in serv_*.c
-do
-       RES=X`grep CTDL_MODULE_INIT $i | cut -f2 -d\( | cut -f1 -d\)`
-       if [ $RES != "X" ] ; then
-               RES_OUT=`echo $RES | cut -b2-`
-               /usr/bin/printf "Found entry point in file $i\n"
-cat <<EOF  >> $C_FILE
-       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL($RES_OUT));
-
-EOF
-cat <<EOF >>$H_FILE
-CTDL_MODULE_INIT($RES_OUT);
-EOF
-       fi
-       RES=X`grep CTDL_MODULE_UPGRADE $i | cut -f2 -d\( | cut -f1 -d\)`
-       if [ $RES != "X" ] ; then
-               RES_OUT=`echo $RES | cut -b2-`
-               /usr/bin/printf "Found upgrade point in file $i\n"
-cat <<EOF  >> $U_FILE
-       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_UPGRADE_CALL($RES_OUT));
-
-EOF
-cat <<EOF >>$H_FILE
-CTDL_MODULE_UPGRADE($RES_OUT);
-EOF
-       fi
-done
-
-
-if [ -d "modules" ] ; then
-       cd modules
-       for j in *
-       do
-               if [ -d $j ] ; then
-                       cd $j
-                       for k in *.c
-                       do
-                               if [ -f "$k" ] ; then
-# Add this .c file to the Makefile included list of SOURCES
-cat <<EOF >> $SRC_FILE
-SOURCES += modules/$j/$k
-EOF
-
-# Generate a .o file name
-O_FILE=`basename $k .c`
-O_FILE="$O_FILE.o"
-# Add this .o file to the Makefile included list of SERV_MODULES
-cat <<EOF >> $MOD_FILE
-SERV_MODULES += modules/$j/$O_FILE
-EOF
-       
-                                       RES=X`grep CTDL_MODULE_INIT $k | cut -f2 -d\( | cut -f1 -d\)`
-                                       if [ $RES != "X" ] ; then
-                                               RES_OUT=`echo $RES | cut -b2-`
-                                               /usr/bin/printf "Found entry point in file modules/$j/$k\n"
-# Add this entry point to the .c file
-cat <<EOF >> $C_FILE
-       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL($RES_OUT));
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-       CTDL_MODULE_INIT($RES_OUT);
-EOF
-                                       fi
-                                       RES=X`grep CTDL_MODULE_UPGRADE $k | cut -f2 -d\( | cut -f1 -d\)`
-                                       if [ $RES != "X" ] ; then
-                                               RES_OUT=`echo $RES | cut -b2-`
-                                               /usr/bin/printf "Found upgrade point in file modules/$j/$k\n"
-# Add this entry point to the .c file
-cat <<EOF >> $U_FILE
-       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_UPGRADE_CALL($RES_OUT));
-EOF
-# Add this entry point to the .h file
-cat <<EOF >> $H_FILE
-       CTDL_MODULE_UPGRADE($RES_OUT);
-EOF
-                                       fi
-                               fi
-                       done
-                       cd ..
-               fi
-       done
-fi
-
-cd $CUR_DIR
-
-if [ -d "user_modules" ] ; then
-       cd user_modules
-       for j in *
-       do
-               if [ -d $j ] ; then
-                       cd $j
-                       for k in *.c
-                       do
-                               if [ -f "$k" ] ; then
-# Add this .c file to the Makefile included list of SOURCES
-cat <<EOF >> $SRC_FILE
-SOURCES += user_modules/$j/$k
-EOF
-
-# Generate a .o file name
-O_FILE=`basename $k .c`
-O_FILE="$O_FILE.o"
-# Add this .o file to the Makefile included list of SERV_MODULES
-cat <<EOF >> $MOD_FILE
-SERV_MODULES += user_modules/$j/$O_FILE
-EOF
-       
-                                       RES=X`grep CTDL_MODULE_INIT $k | cut -f2 -d\( | cut -f1 -d\)`
-                                       if [ $RES != "X" ] ; then
-                                               RES_OUT=`echo $RES | cut -b2-`
-                                               /usr/bin/printf "Found entry point in file user_modules/$j/$k\n"
-cat <<EOF >> $C_FILE
-       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL($RES_OUT));
-EOF
-cat <<EOF >> $H_FILE
-CTDL_MODULE_INIT($RES_OUT);
-EOF
-                                       fi
-                                       RES=X`grep CTDL_MODULE_UPGRADE $k | cut -f2 -d\( | cut -f1 -d\)`
-                                       if [ $RES != "X" ] ; then
-                                               RES_OUT=`echo $RES | cut -b2-`
-                                               /usr/bin/printf "Found upgrade point in file user_modules/$j/$k\n"
-cat <<EOF >> $U_FILE
-       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_UPGRADE_CALL($RES_OUT));
-EOF
-cat <<EOF >> $H_FILE
-CTDL_MODULE_UPGRADE($RES_OUT);
-EOF
-                                       fi
-                               fi
-                       done
-                       cd ..
-               fi
-       done
-fi
-
-cd $CUR_DIR
-
-/usr/bin/printf "\n\n" >> $C_FILE
-/usr/bin/printf "\tfor (filter = 1; filter != 0; filter = filter << 1)\n" >> $C_FILE
-/usr/bin/printf "\t\tif ((filter & DetailErrorFlags) != 0)\n" >> $C_FILE
-/usr/bin/printf "\t\t\tLogPrintMessages(filter);\n" >> $C_FILE
-/usr/bin/printf "}\n" >> $C_FILE
-
-#close the upgrade file
-/usr/bin/printf "}\n" >> $U_FILE
-
-/usr/bin/printf "\n#endif /* MODULES_INIT_H */\n" >> $H_FILE
diff --git a/citadel/mk_svn_revision.sh b/citadel/mk_svn_revision.sh
deleted file mode 100755 (executable)
index 46de27e..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-#
-# Script to generate svn_revision.c
-#
-
-ECHO=/usr/bin/printf
-
-
-CUR_DIR=`pwd`
-C_FILE="$CUR_DIR/svn_revision.c"
-H_FILE="$CUR_DIR/svn_revision.h"
-
-
-# determine if this code base came from subversion.
-if test -d .svn  ; then
-       echo "have subversion repository"
-       SVNVERSION=`which svnversion`
-       if test -x $SVNVERSION  ; then
-               echo "have svnversion at $SVNVERSION"
-               BUILD=`svnversion -n .`
-               echo "This code base revision $BUILD"
-               CAN_BUILD_SVN_REVISION="yes"
-       fi
-fi
-
-if [ "$CAN_BUILD_SVN_REVISION" = "yes" ] ; then
-
-cat <<EOF > $C_FILE
-/*
- * Subversion revision functions
- *
- * Autogenerated at make/release time
- *
- * Do not modify this file
- *
- */
-const char *svn_revision (void)
-{
-       const char *SVN_Version = "$BUILD";
-       return SVN_Version;
-}
-EOF
-
-elif test ! -f $C_FILE  ; then
-
-cat <<EOF > $C_FILE
-/*
- * Subversion revision functions
- *
- * Autogenerated at make time
- *
- * There should have been one with your source distribution
- *
- * Do not modify this file
- *
- */
-const char *svn_revision (void)
-{
-       const char *SVN_Version = "**UNKNOWN** Built from source without svn and no $C_FILE accompanying";
-       return SVN_Version;
-}
-EOF
-
-fi
diff --git a/citadel/scripts/mk_module_init.sh b/citadel/scripts/mk_module_init.sh
new file mode 100755 (executable)
index 0000000..9ea76c8
--- /dev/null
@@ -0,0 +1,311 @@
+#!/bin/sh
+#
+# Script to generate $C_FILE
+#
+
+ECHO=/usr/bin/printf
+
+#MINUS_e=X`$ECHO -n -e`
+#if [ $MINUS_e != "X" ] ; then
+#      MINUS_e=""
+#else
+#      MINUS_e="-e"
+#fi
+
+#MINUS_E=X`$ECHO -n -E`
+#if [ $MINUS_E != "X" ] ; then
+#      MINUS_E=""
+#else
+#      MINUS_E="-E"
+#fi
+
+
+CUR_DIR=`pwd`
+C_FILE="$CUR_DIR/modules_init.c"
+H_FILE="$CUR_DIR/modules_init.h"
+MOD_FILE="$CUR_DIR/Make_modules"
+SRC_FILE="$CUR_DIR/Make_sources"
+U_FILE="$CUR_DIR/modules_upgrade.c"
+
+/usr/bin/printf "Scanning extension modules for entry points.\n"
+
+
+#start of the files which inturn removes any existing file
+#
+
+# start the Makefile included file for $SERV_MODULES
+cat <<EOF  >$MOD_FILE
+#
+# Make_modules
+# This file is to be included by Makefile to dynamically add modules to the build process
+# THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
+#
+
+EOF
+
+# start the Makefile included file for $SOURCES
+cat <<EOF  >$SRC_FILE
+#
+# Make_sources
+# This file is to be included by Makefile to dynamically add modules to the build process
+# THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
+#
+
+EOF
+
+# start the upgrade file
+cat <<EOF  >$U_FILE
+/*
+ * $U_FILE
+ * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
+ */
+
+
+
+#include "sysdep.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <libcitadel.h>
+#include "citadel.h"
+#include "modules_init.h"
+#include "sysdep_decls.h"
+
+
+
+
+void upgrade_modules (void)
+{
+
+    CtdlLogPrintf (CTDL_INFO, "Upgrade modules.\n");
+
+EOF
+
+# start the c file
+cat <<EOF  >$C_FILE
+/*
+ * $C_FILE
+ * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
+ */
+
+
+
+#include "sysdep.h"
+#include <stdlib.h>
+#include <time.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <libcitadel.h>
+#include "citadel.h"
+#include "modules_init.h"
+#include "sysdep_decls.h"
+
+
+void LogPrintMessages(long err);
+extern long DetailErrorFlags;
+
+
+
+void initialise_modules (int threading)
+{
+    long filter;
+    nSizErrmsg = 0;
+
+    if (threading)
+        CtdlLogPrintf (CTDL_INFO, "Initialise modules, CtdlThreads enabled.\n");
+    else
+        CtdlLogPrintf (CTDL_INFO, "Initialise modules, CtdlThreads not yet enabled.\n");
+/* static server initialization: */
+        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(citserver));
+        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(control));
+        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(euidindex));
+        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(file_ops));
+        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(msgbase));
+        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(policy));
+        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(room_ops));
+        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(user_ops));
+/* dynamic modules: */
+
+EOF
+
+
+#start the header file
+cat <<EOF > $H_FILE
+/* 
+ * $H_FILE
+ * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
+ */
+
+
+#ifndef MODULES_INIT_H
+#define MODULES_INIT_H
+#include "ctdl_module.h"
+extern size_t nSizErrmsg;
+void initialise_modules (int threading);
+void upgrade_modules(void);
+
+       CTDL_MODULE_INIT(citserver);
+       CTDL_MODULE_INIT(control);
+       CTDL_MODULE_INIT(euidindex);
+       CTDL_MODULE_INIT(file_ops);
+       CTDL_MODULE_INIT(msgbase);
+       CTDL_MODULE_INIT(policy);
+       CTDL_MODULE_INIT(room_ops);
+       CTDL_MODULE_INIT(user_ops);
+EOF
+
+for i in serv_*.c
+do
+       RES=X`grep CTDL_MODULE_INIT $i | cut -f2 -d\( | cut -f1 -d\)`
+       if [ $RES != "X" ] ; then
+               RES_OUT=`echo $RES | cut -b2-`
+               /usr/bin/printf "Found entry point in file $i\n"
+cat <<EOF  >> $C_FILE
+       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL($RES_OUT));
+
+EOF
+cat <<EOF >>$H_FILE
+CTDL_MODULE_INIT($RES_OUT);
+EOF
+       fi
+       RES=X`grep CTDL_MODULE_UPGRADE $i | cut -f2 -d\( | cut -f1 -d\)`
+       if [ $RES != "X" ] ; then
+               RES_OUT=`echo $RES | cut -b2-`
+               /usr/bin/printf "Found upgrade point in file $i\n"
+cat <<EOF  >> $U_FILE
+       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_UPGRADE_CALL($RES_OUT));
+
+EOF
+cat <<EOF >>$H_FILE
+CTDL_MODULE_UPGRADE($RES_OUT);
+EOF
+       fi
+done
+
+
+if [ -d "modules" ] ; then
+       cd modules
+       for j in *
+       do
+               if [ -d $j ] ; then
+                       cd $j
+                       for k in *.c
+                       do
+                               if [ -f "$k" ] ; then
+# Add this .c file to the Makefile included list of SOURCES
+cat <<EOF >> $SRC_FILE
+SOURCES += modules/$j/$k
+EOF
+
+# Generate a .o file name
+O_FILE=`basename $k .c`
+O_FILE="$O_FILE.o"
+# Add this .o file to the Makefile included list of SERV_MODULES
+cat <<EOF >> $MOD_FILE
+SERV_MODULES += modules/$j/$O_FILE
+EOF
+       
+                                       RES=X`grep CTDL_MODULE_INIT $k | cut -f2 -d\( | cut -f1 -d\)`
+                                       if [ $RES != "X" ] ; then
+                                               RES_OUT=`echo $RES | cut -b2-`
+                                               /usr/bin/printf "Found entry point in file modules/$j/$k\n"
+# Add this entry point to the .c file
+cat <<EOF >> $C_FILE
+       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL($RES_OUT));
+EOF
+# Add this entry point to the .h file
+cat <<EOF >> $H_FILE
+       CTDL_MODULE_INIT($RES_OUT);
+EOF
+                                       fi
+                                       RES=X`grep CTDL_MODULE_UPGRADE $k | cut -f2 -d\( | cut -f1 -d\)`
+                                       if [ $RES != "X" ] ; then
+                                               RES_OUT=`echo $RES | cut -b2-`
+                                               /usr/bin/printf "Found upgrade point in file modules/$j/$k\n"
+# Add this entry point to the .c file
+cat <<EOF >> $U_FILE
+       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_UPGRADE_CALL($RES_OUT));
+EOF
+# Add this entry point to the .h file
+cat <<EOF >> $H_FILE
+       CTDL_MODULE_UPGRADE($RES_OUT);
+EOF
+                                       fi
+                               fi
+                       done
+                       cd ..
+               fi
+       done
+fi
+
+cd $CUR_DIR
+
+if [ -d "user_modules" ] ; then
+       cd user_modules
+       for j in *
+       do
+               if [ -d $j ] ; then
+                       cd $j
+                       for k in *.c
+                       do
+                               if [ -f "$k" ] ; then
+# Add this .c file to the Makefile included list of SOURCES
+cat <<EOF >> $SRC_FILE
+SOURCES += user_modules/$j/$k
+EOF
+
+# Generate a .o file name
+O_FILE=`basename $k .c`
+O_FILE="$O_FILE.o"
+# Add this .o file to the Makefile included list of SERV_MODULES
+cat <<EOF >> $MOD_FILE
+SERV_MODULES += user_modules/$j/$O_FILE
+EOF
+       
+                                       RES=X`grep CTDL_MODULE_INIT $k | cut -f2 -d\( | cut -f1 -d\)`
+                                       if [ $RES != "X" ] ; then
+                                               RES_OUT=`echo $RES | cut -b2-`
+                                               /usr/bin/printf "Found entry point in file user_modules/$j/$k\n"
+cat <<EOF >> $C_FILE
+       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL($RES_OUT));
+EOF
+cat <<EOF >> $H_FILE
+CTDL_MODULE_INIT($RES_OUT);
+EOF
+                                       fi
+                                       RES=X`grep CTDL_MODULE_UPGRADE $k | cut -f2 -d\( | cut -f1 -d\)`
+                                       if [ $RES != "X" ] ; then
+                                               RES_OUT=`echo $RES | cut -b2-`
+                                               /usr/bin/printf "Found upgrade point in file user_modules/$j/$k\n"
+cat <<EOF >> $U_FILE
+       CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_UPGRADE_CALL($RES_OUT));
+EOF
+cat <<EOF >> $H_FILE
+CTDL_MODULE_UPGRADE($RES_OUT);
+EOF
+                                       fi
+                               fi
+                       done
+                       cd ..
+               fi
+       done
+fi
+
+cd $CUR_DIR
+
+/usr/bin/printf "\n\n" >> $C_FILE
+/usr/bin/printf "\tfor (filter = 1; filter != 0; filter = filter << 1)\n" >> $C_FILE
+/usr/bin/printf "\t\tif ((filter & DetailErrorFlags) != 0)\n" >> $C_FILE
+/usr/bin/printf "\t\t\tLogPrintMessages(filter);\n" >> $C_FILE
+/usr/bin/printf "}\n" >> $C_FILE
+
+#close the upgrade file
+/usr/bin/printf "}\n" >> $U_FILE
+
+/usr/bin/printf "\n#endif /* MODULES_INIT_H */\n" >> $H_FILE
diff --git a/citadel/scripts/mk_svn_revision.sh b/citadel/scripts/mk_svn_revision.sh
new file mode 100755 (executable)
index 0000000..46de27e
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Script to generate svn_revision.c
+#
+
+ECHO=/usr/bin/printf
+
+
+CUR_DIR=`pwd`
+C_FILE="$CUR_DIR/svn_revision.c"
+H_FILE="$CUR_DIR/svn_revision.h"
+
+
+# determine if this code base came from subversion.
+if test -d .svn  ; then
+       echo "have subversion repository"
+       SVNVERSION=`which svnversion`
+       if test -x $SVNVERSION  ; then
+               echo "have svnversion at $SVNVERSION"
+               BUILD=`svnversion -n .`
+               echo "This code base revision $BUILD"
+               CAN_BUILD_SVN_REVISION="yes"
+       fi
+fi
+
+if [ "$CAN_BUILD_SVN_REVISION" = "yes" ] ; then
+
+cat <<EOF > $C_FILE
+/*
+ * Subversion revision functions
+ *
+ * Autogenerated at make/release time
+ *
+ * Do not modify this file
+ *
+ */
+const char *svn_revision (void)
+{
+       const char *SVN_Version = "$BUILD";
+       return SVN_Version;
+}
+EOF
+
+elif test ! -f $C_FILE  ; then
+
+cat <<EOF > $C_FILE
+/*
+ * Subversion revision functions
+ *
+ * Autogenerated at make time
+ *
+ * There should have been one with your source distribution
+ *
+ * Do not modify this file
+ *
+ */
+const char *svn_revision (void)
+{
+       const char *SVN_Version = "**UNKNOWN** Built from source without svn and no $C_FILE accompanying";
+       return SVN_Version;
+}
+EOF
+
+fi