Force ascii in grep; thanks to user 'nnnn20430' for pointing this out.
[citadel.git] / webcit / scripts / mk_module_init.sh
index ae1cd375133a4c594c57fc073610fed36459eab6..5ff26e785d8aed6d531a52a4328dda9b8aa3b911 100755 (executable)
@@ -32,24 +32,24 @@ U_FILE="$CUR_DIR/modules_upgrade.c"
 rm -f $C_FILE $H_FILE
 
 # server lifetime:
-START_FUNCS=`grep ServerStartModule_ *.c |sed "s;.*:;;" |sort -u`
-INIT_FUNCS=`grep InitModule_ *.c |sed "s;.*:;;" |sort -u`
-INIT2_FUNCS=`grep InitModule2_ *.c |sed "s;.*:;;" |sort -u`
-FINALIZE_FUNCS=`grep FinalizeModule_ *.c |sed "s;.*:;;" |sort -u`
-SHUTDOWN_FUNCS=`grep ServerShutdownModule_ *.c |sed "s;.*:;;" |sort -u`
+START_FUNCS=`grep -a ServerStartModule_ *.c |sed "s;.*:;;" |sort -u`
+INIT_FUNCS=`grep -a InitModule_ *.c |sed "s;.*:;;" |sort -u`
+INIT2_FUNCS=`grep -a InitModule2_ *.c |sed "s;.*:;;" |sort -u`
+FINALIZE_FUNCS=`grep -a FinalizeModule_ *.c |sed "s;.*:;;" |sort -u`
+SHUTDOWN_FUNCS=`grep -a ServerShutdownModule_ *.c |sed "s;.*:;;" |sort -u`
 
 # session hooks:
-SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
-SESS_ATTACH_FUNCS=`grep SessionAttachModule_ *.c |sed "s;.*:;;" |sort -u`
-SESS_DETACH_FUNCS=`grep SessionDetachModule_ *.c |sed "s;.*:;;" |sort -u`
-SESS_DESTROY_FUNCS=`grep SessionDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
+SESS_NEW_FUNCS=`grep -a SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
+SESS_ATTACH_FUNCS=`grep -a SessionAttachModule_ *.c |sed "s;.*:;;" |sort -u`
+SESS_DETACH_FUNCS=`grep -a SessionDetachModule_ *.c |sed "s;.*:;;" |sort -u`
+SESS_DESTROY_FUNCS=`grep -a SessionDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
 
-HTTP_NEW_FUNCS=`grep HttpNewModule_ *.c |sed "s;.*:;;" |sort -u`
-HTTP_DETACH_FUNCS=`grep HttpDetachModule_ *.c |sed "s;.*:;;" |sort -u`
-HTTP_DESTROY_FUNCS=`grep HttpDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
+HTTP_NEW_FUNCS=`grep -a HttpNewModule_ *.c |sed "s;.*:;;" |sort -u`
+HTTP_DETACH_FUNCS=`grep -a HttpDetachModule_ *.c |sed "s;.*:;;" |sort -u`
+HTTP_DESTROY_FUNCS=`grep -a HttpDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
 
 
-#SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
+#SESS_NEW_FUNCS=`grep -a SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
 
 
 #start the header file
@@ -157,7 +157,7 @@ HOOKNAME=`echo $HOOK |sed "s;ServerStartModule_;;"`
 # Add this entry point to the .c file
 cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Starting $HOOKNAME\n");
+       syslog(LOG_DEBUG, "Starting $HOOKNAME\n");
 #endif
        $HOOK();
 EOF
@@ -189,7 +189,7 @@ for HOOK in $INIT_FUNCS; do
 # Add this entry point to the .c file
     cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
+       syslog(LOG_DEBUG, "Initializing $HOOKNAME\n");
 #endif
        $HOOK();
 EOF
@@ -220,7 +220,7 @@ for HOOK in $INIT2_FUNCS; do
 # Add this entry point to the .c file
     cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
+       syslog(LOG_DEBUG, "Initializing $HOOKNAME\n");
 #endif
        $HOOK();
 EOF
@@ -252,7 +252,7 @@ HOOKNAME=`echo $HOOK |sed "s;ServerShutdownModule_;;"`
 # Add this entry point to the .c file
 cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Shutting down $HOOKNAME\n");
+       syslog(LOG_DEBUG, "Shutting down $HOOKNAME\n");
 #endif
        $HOOK();
 EOF
@@ -285,7 +285,7 @@ HOOKNAME=`echo $HOOK |sed "s;SessionNewModule_;;"`
 # Add this entry point to the .c file
 cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
+       syslog(LOG_DEBUG, "Initializing $HOOKNAME\n");
 #endif
        $HOOK(sess);
 EOF
@@ -317,7 +317,7 @@ HOOKNAME=`echo $HOOK |sed "s;SessionAttachModule_;;"`
 # Add this entry point to the .c file
 cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Attaching Session; $HOOKNAME\n");
+       syslog(LOG_DEBUG, "Attaching Session; $HOOKNAME\n");
 #endif
        $HOOK(sess);
 EOF
@@ -349,7 +349,7 @@ HOOKNAME=`echo $HOOK |sed "s;SessionDetachModule_;;"`
 # Add this entry point to the .c file
 cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
+       syslog(LOG_DEBUG, "Initializing $HOOKNAME\n");
 #endif
        $HOOK(sess);
 EOF
@@ -382,7 +382,7 @@ HOOKNAME=`echo $HOOK |sed "s;SessionDestroyModule_;;"`
 # Add this entry point to the .c file
 cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
+       syslog(LOG_DEBUG, "Initializing $HOOKNAME\n");
 #endif
        $HOOK(*sess);
 EOF
@@ -419,7 +419,7 @@ HOOKNAME=`echo $HOOK |sed "s;HttpNewModule_;;"`
 # Add this entry point to the .c file
 cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "NEW $HOOKNAME\n");
+       syslog(LOG_DEBUG, "NEW $HOOKNAME\n");
 #endif
        $HOOK(httpreq);
 EOF
@@ -447,7 +447,7 @@ HOOKNAME=`echo $HOOK |sed "s;HttpDetachModule_;;"`
 # Add this entry point to the .c file
 cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Detaching $HOOKNAME\n");
+       syslog(LOG_DEBUG, "Detaching $HOOKNAME\n");
 #endif
        $HOOK(httpreq);
 EOF
@@ -476,7 +476,7 @@ HOOKNAME=`echo $HOOK |sed "s;HttpDestroyModule_;;"`
 # Add this entry point to the .c file
 cat <<EOF >> $C_FILE
 #ifdef DBG_PRINNT_HOOKS_AT_START
-       syslog(CTDL_INFO, "Destructing $HOOKNAME\n");
+       syslog(LOG_DEBUG, "Destructing $HOOKNAME\n");
 #endif
        $HOOK(httpreq);
 EOF