From: Kern Sibbald Date: Thu, 1 Aug 2002 12:22:28 +0000 (+0000) Subject: First cut of restore X-Git-Tag: Release-1.24~27 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7c8fa01635f8fa71b330b7075c1af94888d15887;p=bacula%2Fbacula First cut of restore git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@73 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/autoconf/acconfig.h b/bacula/autoconf/acconfig.h index 1db4e9353b..43a8446c90 100644 --- a/bacula/autoconf/acconfig.h +++ b/bacula/autoconf/acconfig.h @@ -23,6 +23,10 @@ /* Define if you want to use MySQL */ #undef HAVE_MYSQL +/* Define if you want to use embedded MySQL */ +#undef HAVE_EMBEDDED_MYSQL + + /* Define if you want to use SQLite */ #undef HAVE_SQLITE diff --git a/bacula/autoconf/aclocal.m4 b/bacula/autoconf/aclocal.m4 index 46e59b1701..d2f5d5bd74 100644 --- a/bacula/autoconf/aclocal.m4 +++ b/bacula/autoconf/aclocal.m4 @@ -295,6 +295,74 @@ Which one DBMS do you want to use (please select only one): ],[ AC_MSG_RESULT(no) ]) + +AC_ARG_WITH(embedded-mysql, +[ +Which one DBMS do you want to use (please select only one): + --with-embedde-mysql[=DIR] Include MySQL support. DIR is the MySQL base + install directory, default is to search through + a number of common places for the MySQL files.], +[ + if test "$withval" != "no"; then + if test "$withval" = "yes"; then + if test -f /usr/local/mysql/include/mysql/mysql.h; then + MYSQL_INCDIR=/usr/local/mysql/include/mysql + MYSQL_LIBDIR=/usr/local/mysql/lib/mysql + MYSQL_BINDIR=/usr/local/mysql/bin + elif test -f /usr/include/mysql/mysql.h; then + MYSQL_INCDIR=/usr/include/mysql + MYSQL_LIBDIR=/usr/lib/mysql + MYSQL_BINDIR=/usr/bin + elif test -f /usr/include/mysql.h; then + MYSQL_INCDIR=/usr/include + MYSQL_LIBDIR=/usr/lib + MYSQL_BINDIR=/usr/bin + elif test -f /usr/local/include/mysql/mysql.h; then + MYSQL_INCDIR=/usr/local/include/mysql + MYSQL_LIBDIR=/usr/local/lib/mysql + MYSQL_BINDIR=/usr/local/bin + elif test -f /usr/local/include/mysql.h; then + MYSQL_INCDIR=/usr/local/include + MYSQL_LIBDIR=/usr/local/lib + MYSQL_BINDIR=/usr/local/bin + else + AC_MSG_RESULT(no) + AC_MSG_ERROR(Unable to find mysql.h in standard locations) + fi + else + if test -f $withval/include/mysql/mysql.h; then + MYSQL_INCDIR=$withval/include/mysql + MYSQL_LIBDIR=$withval/lib/mysql + MYSQL_BINDIR=$withval/bin + elif test -f $withval/include/mysql.h; then + MYSQL_INCDIR=$withval/include + MYSQL_LIBDIR=$withval/lib + MYSQL_BINDIR=$withval/bin + else + AC_MSG_RESULT(no) + AC_MSG_ERROR(Invalid MySQL directory $withval - unable to find mysql.h under $withval) + fi + fi + SQL_INCLUDE=-I$MYSQL_INCDIR + SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqld -lz -lm -lcrypt" + SQL_BINDIR=$MYSQL_BINDIR + + AC_DEFINE(HAVE_MYSQL) + AC_DEFINE(HAVE_EMBEDDED_MYSQL) + AC_MSG_RESULT(yes) + have_db=yes + support_mysql=yes + db_name=MySQL + DB_NAME=mysql + + else + AC_MSG_RESULT(no) + fi +],[ + AC_MSG_RESULT(no) +]) + + AC_SUBST(SQL_LFLAGS) AC_SUBST(SQL_INCLUDE) AC_SUBST(SQL_BINDIR) diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 2ce72cd3e2..4bc04c3bc6 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -24,6 +24,10 @@ /* Define if you want to use MySQL */ #undef HAVE_MYSQL +/* Define if you want to use embedded MySQL */ +#undef HAVE_EMBEDDED_MYSQL + + /* Define if you want to use SQLite */ #undef HAVE_SQLITE diff --git a/bacula/configure b/bacula/configure index e61fe8a977..e6cfae4aaa 100755 --- a/bacula/configure +++ b/bacula/configure @@ -61,6 +61,12 @@ Which one DBMS do you want to use (please select only one): a number of common places for the MySQL files." ac_help="$ac_help +Which one DBMS do you want to use (please select only one): + --with-embedde-mysql[=DIR] Include MySQL support. DIR is the MySQL base + install directory, default is to search through + a number of common places for the MySQL files." +ac_help="$ac_help + Which one DBMS do you want to use (please select only one): --with-sqlite[=DIR] Include SQLite support. DIR is the SQLite base install directory, default is to search through @@ -611,7 +617,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:615: checking for $ac_word" >&5 +echo "configure:621: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TRUEPRG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -652,7 +658,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:656: checking for $ac_word" >&5 +echo "configure:662: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FALSEPRG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -696,7 +702,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:700: checking host system type" >&5 +echo "configure:706: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -727,7 +733,7 @@ echo "configuring for bacula $VERSION ($DATE)" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:731: checking for $ac_word" >&5 +echo "configure:737: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -757,7 +763,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:761: checking for $ac_word" >&5 +echo "configure:767: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -808,7 +814,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:812: checking for $ac_word" >&5 +echo "configure:818: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -840,7 +846,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:844: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:850: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -851,12 +857,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 855 "configure" +#line 861 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -882,12 +888,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:886: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:892: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:891: checking whether we are using GNU C" >&5 +echo "configure:897: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -896,7 +902,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -915,7 +921,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:919: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:925: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -951,7 +957,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:955: checking for $ac_word" >&5 +echo "configure:961: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -983,7 +989,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:987: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:993: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -994,12 +1000,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 998 "configure" +#line 1004 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1025,12 +1031,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1029: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1035: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1034: checking whether we are using GNU C++" >&5 +echo "configure:1040: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1039,7 +1045,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1058,7 +1064,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1062: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1068: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1099,7 +1105,7 @@ for ac_declaration in \ 'void exit (int);' do cat > conftest.$ac_ext < $ac_declaration @@ -1107,7 +1113,7 @@ int main() { exit (42); ; return 0; } EOF -if { (eval echo configure:1111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -1117,14 +1123,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* break else @@ -1142,10 +1148,10 @@ fi if test "x$CC" != xcc; then echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 -echo "configure:1146: checking whether $CC and cc understand -c and -o together" >&5 +echo "configure:1152: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 -echo "configure:1149: checking whether cc understands -c and -o together" >&5 +echo "configure:1155: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" @@ -1157,16 +1163,16 @@ else # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' -if { (eval echo configure:1161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; +if { (eval echo configure:1167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' - if { (eval echo configure:1169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + if { (eval echo configure:1175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : @@ -1192,7 +1198,7 @@ EOF fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1196: checking how to run the C preprocessor" >&5 +echo "configure:1202: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1207,13 +1213,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1224,13 +1230,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1241,13 +1247,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1273,13 +1279,13 @@ echo "$ac_t""$CPP" 1>&6 if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:1277: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:1283: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -1297,7 +1303,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -1338,7 +1344,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1342: checking for a BSD compatible install" >&5 +echo "configure:1348: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1393,7 +1399,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1397: checking for $ac_word" >&5 +echo "configure:1403: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1423,7 +1429,7 @@ fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1427: checking for $ac_word" >&5 +echo "configure:1433: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1459,7 +1465,7 @@ fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1463: checking for $ac_word" >&5 +echo "configure:1469: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1495,7 +1501,7 @@ fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1499: checking for $ac_word" >&5 +echo "configure:1505: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1531,7 +1537,7 @@ fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1535: checking for $ac_word" >&5 +echo "configure:1541: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1567,7 +1573,7 @@ fi # Extract the first word of "awk", so it can be a program name with args. set dummy awk; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1571: checking for $ac_word" >&5 +echo "configure:1577: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1603,7 +1609,7 @@ fi # Extract the first word of "echo", so it can be a program name with args. set dummy echo; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1607: checking for $ac_word" >&5 +echo "configure:1613: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ECHO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1639,7 +1645,7 @@ fi # Extract the first word of "cmp", so it can be a program name with args. set dummy cmp; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1643: checking for $ac_word" >&5 +echo "configure:1649: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1675,7 +1681,7 @@ fi # Extract the first word of "tbl", so it can be a program name with args. set dummy tbl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1679: checking for $ac_word" >&5 +echo "configure:1685: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TBL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1711,7 +1717,7 @@ fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1715: checking for $ac_word" >&5 +echo "configure:1721: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1747,7 +1753,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1751: checking for $ac_word" >&5 +echo "configure:1757: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1783,7 +1789,7 @@ fi # Extract the first word of "openssl", so it can be a program name with args. set dummy openssl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1787: checking for $ac_word" >&5 +echo "configure:1793: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_OPENSSL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1831,14 +1837,14 @@ MAKE_SHELL=/bin/sh echo $ac_n "checking for Operating System""... $ac_c" 1>&6 -echo "configure:1835: checking for Operating System" >&5 +echo "configure:1841: checking for Operating System" >&5 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1837: checking for Cygwin environment" >&5 +echo "configure:1843: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -2140,7 +2146,7 @@ echo "$ac_t""" "" 1>&6 # ----------------------------------------------------------- # ---------------------------------------------------------- echo $ac_n "checking for Operating System Distribution""... $ac_c" 1>&6 -echo "configure:2144: checking for Operating System Distribution" >&5 +echo "configure:2150: checking for Operating System Distribution" >&5 if test "x$DISTNAME" != "x" then echo "distname set to $DISTNAME" @@ -2254,7 +2260,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2258: checking for $ac_word" >&5 +echo "configure:2264: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2386,7 +2392,7 @@ fi # Extract the first word of "gnome-config", so it can be a program name with args. set dummy gnome-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2390: checking for $ac_word" >&5 +echo "configure:2396: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2423,7 +2429,7 @@ fi no_gnome_config="yes" else echo $ac_n "checking if $GNOME_CONFIG works""... $ac_c" 1>&6 -echo "configure:2427: checking if $GNOME_CONFIG works" >&5 +echo "configure:2433: checking if $GNOME_CONFIG works" >&5 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then echo "$ac_t""yes" 1>&6 @@ -2431,7 +2437,7 @@ echo "configure:2427: checking if $GNOME_CONFIG works" >&5 # Extract the first word of "orbit-config", so it can be a program name with args. set dummy orbit-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2435: checking for $ac_word" >&5 +echo "configure:2441: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ORBIT_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2467,7 +2473,7 @@ fi # Extract the first word of "orbit-idl", so it can be a program name with args. set dummy orbit-idl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2471: checking for $ac_word" >&5 +echo "configure:2477: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ORBIT_IDL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2501,7 +2507,7 @@ else fi echo $ac_n "checking for working ORBit environment""... $ac_c" 1>&6 -echo "configure:2505: checking for working ORBit environment" >&5 +echo "configure:2511: checking for working ORBit environment" >&5 if eval "test \"`echo '$''{'gnome_cv_orbit_found'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2537,7 +2543,7 @@ fi fi echo $ac_n "checking for gnorba libraries""... $ac_c" 1>&6 -echo "configure:2541: checking for gnorba libraries" >&5 +echo "configure:2547: checking for gnorba libraries" >&5 if eval "test \"`echo '$''{'gnome_cv_gnorba_found'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2601,7 +2607,7 @@ fi if test "$no_gnome_config" = "yes"; then echo $ac_n "checking for gnomeConf.sh file in $gnome_prefix""... $ac_c" 1>&6 -echo "configure:2605: checking for gnomeConf.sh file in $gnome_prefix" >&5 +echo "configure:2611: checking for gnomeConf.sh file in $gnome_prefix" >&5 if test -f $gnome_prefix/gnomeConf.sh; then echo "$ac_t""found" 1>&6 echo "loading gnome configuration from" \ @@ -2621,7 +2627,7 @@ echo "configure:2605: checking for gnomeConf.sh file in $gnome_prefix" >&5 n="" for i in $n; do echo $ac_n "checking extra library \"$i\"""... $ac_c" 1>&6 -echo "configure:2625: checking extra library \"$i\"" >&5 +echo "configure:2631: checking extra library \"$i\"" >&5 case $i in applets) @@ -2702,17 +2708,17 @@ if test "${with_readline+set}" = set; then fi ac_safe=`echo "$with_readline/readline.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $with_readline/readline.h""... $ac_c" 1>&6 -echo "configure:2706: checking for $with_readline/readline.h" >&5 +echo "configure:2712: checking for $with_readline/readline.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2751,17 +2757,17 @@ else # check for standard readline library ac_safe=`echo "/usr/include/readline/readline.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for /usr/include/readline/readline.h""... $ac_c" 1>&6 -echo "configure:2755: checking for /usr/include/readline/readline.h" >&5 +echo "configure:2761: checking for /usr/include/readline/readline.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2818,12 +2824,12 @@ MAKE_SHELL=/bin/sh echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:2822: checking whether stat file-mode macros are broken" >&5 +echo "configure:2828: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2878,12 +2884,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:2882: checking for $ac_hdr that defines DIR" >&5 +echo "configure:2888: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -2891,7 +2897,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:2895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -2916,7 +2922,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:2920: checking for opendir in -ldir" >&5 +echo "configure:2926: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2924,7 +2930,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2957,7 +2963,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:2961: checking for opendir in -lx" >&5 +echo "configure:2967: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2965,7 +2971,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3002,12 +3008,12 @@ fi for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat lchown do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3006: checking for $ac_func" >&5 +echo "configure:3012: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3060,12 +3066,12 @@ done # EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"]) echo $ac_n "checking for getopt_long""... $ac_c" 1>&6 -echo "configure:3064: checking for getopt_long" >&5 +echo "configure:3070: checking for getopt_long" >&5 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getopt_long=yes" else @@ -3113,7 +3119,7 @@ fi echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:3117: checking for working strcoll" >&5 +echo "configure:3123: checking for working strcoll" >&5 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3121,7 +3127,7 @@ else ac_cv_func_strcoll_works=no else cat > conftest.$ac_ext < main () @@ -3131,7 +3137,7 @@ main () strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:3135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strcoll_works=yes else @@ -3159,17 +3165,17 @@ for ac_hdr in varargs.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3163: checking for $ac_hdr" >&5 +echo "configure:3169: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3221,17 +3227,17 @@ if test "${with_gmp+set}" = set; then fi ac_safe=`echo "$with_gmp/gmp.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $with_gmp/gmp.h""... $ac_c" 1>&6 -echo "configure:3225: checking for $with_gmp/gmp.h" >&5 +echo "configure:3231: checking for $with_gmp/gmp.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3270,17 +3276,17 @@ else # check for standard gmp library ac_safe=`echo "/usr/include/gmp.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for /usr/include/gmp.h""... $ac_c" 1>&6 -echo "configure:3274: checking for /usr/include/gmp.h" >&5 +echo "configure:3280: checking for /usr/include/gmp.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3358,17 +3364,17 @@ if test "${with_cweb+set}" = set; then fi ac_safe=`echo "$with_cweb/cweb.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $with_cweb/cweb.h""... $ac_c" 1>&6 -echo "configure:3362: checking for $with_cweb/cweb.h" >&5 +echo "configure:3368: checking for $with_cweb/cweb.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3407,17 +3413,17 @@ else # check for standard cweb library ac_safe=`echo "/usr/include/cweb.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for /usr/include/cweb.h""... $ac_c" 1>&6 -echo "configure:3411: checking for /usr/include/cweb.h" >&5 +echo "configure:3417: checking for /usr/include/cweb.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3488,9 +3494,9 @@ if test "${with_tcp_wrappers+set}" = set; then saved_LIBS="$LIBS" LIBS="$LIBS -lwrap -lnsl" echo $ac_n "checking for libwrap""... $ac_c" 1>&6 -echo "configure:3492: checking for libwrap" >&5 +echo "configure:3498: checking for libwrap" >&5 cat > conftest.$ac_ext < int deny_severity = 0; @@ -3500,7 +3506,7 @@ int main() { hosts_access(req); ; return 0; } EOF -if { (eval echo configure:3504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -3765,7 +3771,7 @@ fi have_db=no echo $ac_n "checking for MySQL support""... $ac_c" 1>&6 -echo "configure:3769: checking for MySQL support" >&5 +echo "configure:3775: checking for MySQL support" >&5 # Check whether --with-mysql or --without-mysql was given. if test "${with_mysql+set}" = set; then withval="$with_mysql" @@ -3835,6 +3841,81 @@ else fi +# Check whether --with-embedded-mysql or --without-embedded-mysql was given. +if test "${with_embedded_mysql+set}" = set; then + withval="$with_embedded_mysql" + + if test "$withval" != "no"; then + if test "$withval" = "yes"; then + if test -f /usr/local/mysql/include/mysql/mysql.h; then + MYSQL_INCDIR=/usr/local/mysql/include/mysql + MYSQL_LIBDIR=/usr/local/mysql/lib/mysql + MYSQL_BINDIR=/usr/local/mysql/bin + elif test -f /usr/include/mysql/mysql.h; then + MYSQL_INCDIR=/usr/include/mysql + MYSQL_LIBDIR=/usr/lib/mysql + MYSQL_BINDIR=/usr/bin + elif test -f /usr/include/mysql.h; then + MYSQL_INCDIR=/usr/include + MYSQL_LIBDIR=/usr/lib + MYSQL_BINDIR=/usr/bin + elif test -f /usr/local/include/mysql/mysql.h; then + MYSQL_INCDIR=/usr/local/include/mysql + MYSQL_LIBDIR=/usr/local/lib/mysql + MYSQL_BINDIR=/usr/local/bin + elif test -f /usr/local/include/mysql.h; then + MYSQL_INCDIR=/usr/local/include + MYSQL_LIBDIR=/usr/local/lib + MYSQL_BINDIR=/usr/local/bin + else + echo "$ac_t""no" 1>&6 + { echo "configure: error: Unable to find mysql.h in standard locations" 1>&2; exit 1; } + fi + else + if test -f $withval/include/mysql/mysql.h; then + MYSQL_INCDIR=$withval/include/mysql + MYSQL_LIBDIR=$withval/lib/mysql + MYSQL_BINDIR=$withval/bin + elif test -f $withval/include/mysql.h; then + MYSQL_INCDIR=$withval/include + MYSQL_LIBDIR=$withval/lib + MYSQL_BINDIR=$withval/bin + else + echo "$ac_t""no" 1>&6 + { echo "configure: error: Invalid MySQL directory $withval - unable to find mysql.h under $withval" 1>&2; exit 1; } + fi + fi + SQL_INCLUDE=-I$MYSQL_INCDIR + SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqld -lz -lm -lcrypt" + SQL_BINDIR=$MYSQL_BINDIR + + cat >> confdefs.h <<\EOF +#define HAVE_MYSQL 1 +EOF + + cat >> confdefs.h <<\EOF +#define HAVE_EMBEDDED_MYSQL 1 +EOF + + echo "$ac_t""yes" 1>&6 + have_db=yes + support_mysql=yes + db_name=MySQL + DB_NAME=mysql + + else + echo "$ac_t""no" 1>&6 + fi + +else + + echo "$ac_t""no" 1>&6 + +fi + + + + @@ -3847,7 +3928,7 @@ fi have_db=no echo $ac_n "checking for SQLite support""... $ac_c" 1>&6 -echo "configure:3851: checking for SQLite support" >&5 +echo "configure:3932: checking for SQLite support" >&5 # Check whether --with-sqlite or --without-sqlite was given. if test "${with_sqlite+set}" = set; then withval="$with_sqlite" @@ -3923,19 +4004,19 @@ fi echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:3927: checking for mingw32 environment" >&5 +echo "configure:4008: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -3954,7 +4035,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3958: checking for executable suffix" >&5 +echo "configure:4039: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3964,7 +4045,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:3968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -3992,7 +4073,7 @@ ac_exeext=$EXEEXT # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:3996: checking for X" >&5 +echo "configure:4077: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4054,12 +4135,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4128,14 +4209,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -4241,17 +4322,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:4245: checking whether -R must be followed by a space" >&5 +echo "configure:4326: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -4267,14 +4348,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -4306,7 +4387,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:4310: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:4391: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4314,7 +4395,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4347,7 +4428,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:4351: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:4432: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4355,7 +4436,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4395,12 +4476,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:4399: checking for gethostbyname" >&5 +echo "configure:4480: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -4444,7 +4525,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4448: checking for gethostbyname in -lnsl" >&5 +echo "configure:4529: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4452,7 +4533,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4493,12 +4574,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:4497: checking for connect" >&5 +echo "configure:4578: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -4542,7 +4623,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:4546: checking for connect in -lsocket" >&5 +echo "configure:4627: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4550,7 +4631,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4585,12 +4666,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:4589: checking for remove" >&5 +echo "configure:4670: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -4634,7 +4715,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:4638: checking for remove in -lposix" >&5 +echo "configure:4719: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4642,7 +4723,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4677,12 +4758,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:4681: checking for shmat" >&5 +echo "configure:4762: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -4726,7 +4807,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:4730: checking for shmat in -lipc" >&5 +echo "configure:4811: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4734,7 +4815,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4778,7 +4859,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:4782: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:4863: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4786,7 +4867,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4842,17 +4923,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4846: checking for $ac_hdr" >&5 +echo "configure:4927: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4879,12 +4960,12 @@ fi done echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4883: checking for ANSI C header files" >&5 +echo "configure:4964: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4892,7 +4973,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4909,7 +4990,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4927,7 +5008,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4948,7 +5029,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4959,7 +5040,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4983,19 +5064,19 @@ EOF fi echo $ac_n "checking whether sys/types.h defines makedev""... $ac_c" 1>&6 -echo "configure:4987: checking whether sys/types.h defines makedev" >&5 +echo "configure:5068: checking whether sys/types.h defines makedev" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_types_h_makedev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return makedev(0, 0); ; return 0; } EOF -if { (eval echo configure:4999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_sys_types_h_makedev=yes else @@ -5013,17 +5094,17 @@ echo "$ac_t""$ac_cv_header_sys_types_h_makedev" 1>&6 if test $ac_cv_header_sys_types_h_makedev = no; then ac_safe=`echo "sys/mkdev.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/mkdev.h""... $ac_c" 1>&6 -echo "configure:5017: checking for sys/mkdev.h" >&5 +echo "configure:5098: checking for sys/mkdev.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5051,17 +5132,17 @@ fi if test $ac_cv_header_sys_mkdev_h = no; then ac_safe=`echo "sys/sysmacros.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/sysmacros.h""... $ac_c" 1>&6 -echo "configure:5055: checking for sys/sysmacros.h" >&5 +echo "configure:5136: checking for sys/sysmacros.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5093,12 +5174,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:5097: checking for $ac_hdr that defines DIR" >&5 +echo "configure:5178: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -5106,7 +5187,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:5110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -5131,7 +5212,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:5135: checking for opendir in -ldir" >&5 +echo "configure:5216: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5139,7 +5220,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5172,7 +5253,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:5176: checking for opendir in -lx" >&5 +echo "configure:5257: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5180,7 +5261,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5214,12 +5295,12 @@ fi fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:5218: checking whether stat file-mode macros are broken" >&5 +echo "configure:5299: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5270,12 +5351,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:5274: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:5355: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5291,7 +5372,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:5295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -5312,12 +5393,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:5316: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:5397: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5326,7 +5407,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:5330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -5347,12 +5428,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:5351: checking for st_blksize in struct stat" >&5 +echo "configure:5432: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5360,7 +5441,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:5364: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -5381,12 +5462,12 @@ EOF fi echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:5385: checking for st_blocks in struct stat" >&5 +echo "configure:5466: checking for st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5394,7 +5475,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:5398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -5417,12 +5498,12 @@ else fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:5421: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:5502: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5430,7 +5511,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:5434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -5451,12 +5532,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:5455: checking for tm_zone in struct tm" >&5 +echo "configure:5536: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -5464,7 +5545,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:5468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -5484,12 +5565,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:5488: checking for tzname" >&5 +echo "configure:5569: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -5499,7 +5580,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:5503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -5526,12 +5607,12 @@ fi # be POSIX, POSIX_C, ALL, HPUX or whatever, depending on the machine. echo $ac_n "checking for utime.h""... $ac_c" 1>&6 -echo "configure:5530: checking for utime.h" >&5 +echo "configure:5611: checking for utime.h" >&5 if eval "test \"`echo '$''{'tar_cv_header_utime_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5540,7 +5621,7 @@ int main() { struct utimbuf foo ; return 0; } EOF -if { (eval echo configure:5544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tar_cv_header_utime_h=yes else @@ -5559,12 +5640,12 @@ EOF echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:5563: checking for working const" >&5 +echo "configure:5644: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -5636,17 +5717,17 @@ fi echo $ac_n "checking how to get filesystem type""... $ac_c" 1>&6 -echo "configure:5640: checking how to get filesystem type" >&5 +echo "configure:5721: checking how to get filesystem type" >&5 fstype=no # The order of these tests is important. cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5662,13 +5743,13 @@ fi rm -f conftest* if test $fstype = no; then cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5685,13 +5766,13 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5708,12 +5789,12 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5730,7 +5811,7 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < EOF @@ -5747,13 +5828,13 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5771,12 +5852,12 @@ fi echo "$ac_t""$fstype" 1>&6 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:5775: checking return type of signal handlers" >&5 +echo "configure:5856: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5793,7 +5874,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:5797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -5813,13 +5894,13 @@ EOF echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 -echo "configure:5817: checking for type of signal functions" >&5 +echo "configure:5898: checking for type of signal functions" >&5 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -5832,7 +5913,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=posix else @@ -5841,7 +5922,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { @@ -5851,7 +5932,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=4.2bsd else @@ -5860,7 +5941,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -5873,7 +5954,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=svr3 else @@ -5912,12 +5993,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:5916: checking for mode_t" >&5 +echo "configure:5997: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5945,12 +6026,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:5949: checking for uid_t in sys/types.h" >&5 +echo "configure:6030: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -5979,12 +6060,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:5983: checking for size_t" >&5 +echo "configure:6064: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6012,12 +6093,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:6016: checking for pid_t" >&5 +echo "configure:6097: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6045,12 +6126,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:6049: checking for off_t" >&5 +echo "configure:6130: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6078,12 +6159,12 @@ EOF fi echo $ac_n "checking for ino_t""... $ac_c" 1>&6 -echo "configure:6082: checking for ino_t" >&5 +echo "configure:6163: checking for ino_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6111,12 +6192,12 @@ EOF fi echo $ac_n "checking for dev_t""... $ac_c" 1>&6 -echo "configure:6115: checking for dev_t" >&5 +echo "configure:6196: checking for dev_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_dev_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6144,12 +6225,12 @@ EOF fi echo $ac_n "checking for daddr_t""... $ac_c" 1>&6 -echo "configure:6148: checking for daddr_t" >&5 +echo "configure:6229: checking for daddr_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_daddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6177,12 +6258,12 @@ EOF fi echo $ac_n "checking for major_t""... $ac_c" 1>&6 -echo "configure:6181: checking for major_t" >&5 +echo "configure:6262: checking for major_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_major_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6210,12 +6291,12 @@ EOF fi echo $ac_n "checking for minor_t""... $ac_c" 1>&6 -echo "configure:6214: checking for minor_t" >&5 +echo "configure:6295: checking for minor_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_minor_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6243,12 +6324,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:6247: checking for ssize_t" >&5 +echo "configure:6328: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6276,12 +6357,12 @@ EOF fi echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:6280: checking for st_blocks in struct stat" >&5 +echo "configure:6361: checking for st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6289,7 +6370,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:6293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -6312,12 +6393,12 @@ else fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:6316: checking for st_rdev in struct stat" >&5 +echo "configure:6397: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6325,7 +6406,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:6329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -6346,12 +6427,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:6350: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:6431: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6359,7 +6440,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:6363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -6380,12 +6461,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:6384: checking for working const" >&5 +echo "configure:6465: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -6457,7 +6538,7 @@ fi echo $ac_n "checking size of char""... $ac_c" 1>&6 -echo "configure:6461: checking size of char" >&5 +echo "configure:6542: checking size of char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6465,7 +6546,7 @@ else ac_cv_sizeof_char=1 else cat > conftest.$ac_ext < int main() @@ -6476,7 +6557,7 @@ int main() return(0); } EOF -if { (eval echo configure:6480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char=`cat conftestval` else @@ -6496,7 +6577,7 @@ EOF echo $ac_n "checking size of short int""... $ac_c" 1>&6 -echo "configure:6500: checking size of short int" >&5 +echo "configure:6581: checking size of short int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6504,7 +6585,7 @@ else ac_cv_sizeof_short_int=2 else cat > conftest.$ac_ext < int main() @@ -6515,7 +6596,7 @@ int main() return(0); } EOF -if { (eval echo configure:6519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short_int=`cat conftestval` else @@ -6535,7 +6616,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:6539: checking size of int" >&5 +echo "configure:6620: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6543,7 +6624,7 @@ else ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < int main() @@ -6554,7 +6635,7 @@ int main() return(0); } EOF -if { (eval echo configure:6558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -6574,7 +6655,7 @@ EOF echo $ac_n "checking size of long int""... $ac_c" 1>&6 -echo "configure:6578: checking size of long int" >&5 +echo "configure:6659: checking size of long int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6582,7 +6663,7 @@ else ac_cv_sizeof_long_int=4 else cat > conftest.$ac_ext < int main() @@ -6593,7 +6674,7 @@ int main() return(0); } EOF -if { (eval echo configure:6597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_int=`cat conftestval` else @@ -6613,7 +6694,7 @@ EOF echo $ac_n "checking size of long long int""... $ac_c" 1>&6 -echo "configure:6617: checking size of long long int" >&5 +echo "configure:6698: checking size of long long int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6621,7 +6702,7 @@ else ac_cv_sizeof_long_long_int=8 else cat > conftest.$ac_ext < int main() @@ -6632,7 +6713,7 @@ int main() return(0); } EOF -if { (eval echo configure:6636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long_int=`cat conftestval` else @@ -6652,7 +6733,7 @@ EOF echo $ac_n "checking size of int *""... $ac_c" 1>&6 -echo "configure:6656: checking size of int *" >&5 +echo "configure:6737: checking size of int *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6660,7 +6741,7 @@ else ac_cv_sizeof_int_p=4 else cat > conftest.$ac_ext < int main() @@ -6671,7 +6752,7 @@ int main() return(0); } EOF -if { (eval echo configure:6675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int_p=`cat conftestval` else @@ -6693,20 +6774,20 @@ EOF # Check for sys/types.h types echo $ac_n "checking for u_int type""... $ac_c" 1>&6 -echo "configure:6697: checking for u_int type" >&5 +echo "configure:6778: checking for u_int type" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_int a; a = 1; ; return 0; } EOF -if { (eval echo configure:6710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_int="yes" else @@ -6730,20 +6811,20 @@ EOF fi echo $ac_n "checking for intmax_t type""... $ac_c" 1>&6 -echo "configure:6734: checking for intmax_t type" >&5 +echo "configure:6815: checking for intmax_t type" >&5 if eval "test \"`echo '$''{'ac_cv_have_intmax_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:6747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intmax_t="yes" else @@ -6752,14 +6833,14 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:6763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intmax_t="yes" else @@ -6789,20 +6870,20 @@ fi echo $ac_n "checking for u_intmax_t type""... $ac_c" 1>&6 -echo "configure:6793: checking for u_intmax_t type" >&5 +echo "configure:6874: checking for u_intmax_t type" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_intmax_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:6806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intmax_t="yes" else @@ -6811,14 +6892,14 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { u_intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:6822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intmax_t="yes" else @@ -6847,20 +6928,20 @@ fi echo $ac_n "checking for intXX_t types""... $ac_c" 1>&6 -echo "configure:6851: checking for intXX_t types" >&5 +echo "configure:6932: checking for intXX_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_intxx_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int8_t a; int16_t b; int32_t c; a = b = c = 1; ; return 0; } EOF -if { (eval echo configure:6864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intxx_t="yes" else @@ -6884,20 +6965,20 @@ EOF fi echo $ac_n "checking for int64_t type""... $ac_c" 1>&6 -echo "configure:6888: checking for int64_t type" >&5 +echo "configure:6969: checking for int64_t type" >&5 if eval "test \"`echo '$''{'ac_cv_have_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int64_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:6901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_int64_t="yes" else @@ -6921,20 +7002,20 @@ EOF fi echo $ac_n "checking for u_intXX_t types""... $ac_c" 1>&6 -echo "configure:6925: checking for u_intXX_t types" >&5 +echo "configure:7006: checking for u_intXX_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_intxx_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1; ; return 0; } EOF -if { (eval echo configure:6938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intxx_t="yes" else @@ -6958,20 +7039,20 @@ EOF fi echo $ac_n "checking for u_int64_t types""... $ac_c" 1>&6 -echo "configure:6962: checking for u_int64_t types" >&5 +echo "configure:7043: checking for u_int64_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_int64_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:6975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_int64_t="yes" else @@ -6998,9 +7079,9 @@ if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ test "x$ac_cv_header_sys_bitypes_h" = "xyes") then echo $ac_n "checking for intXX_t and u_intXX_t types in sys/bitypes.h""... $ac_c" 1>&6 -echo "configure:7002: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5 +echo "configure:7083: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5 cat > conftest.$ac_ext < int main() { @@ -7009,7 +7090,7 @@ int main() { a = b = c = e = f = g = 1; ; return 0; } EOF -if { (eval echo configure:7013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_U_INTXX_T 1 @@ -7036,13 +7117,13 @@ fi if test -z "$have_u_intxx_t" ; then echo $ac_n "checking for uintXX_t types""... $ac_c" 1>&6 -echo "configure:7040: checking for uintXX_t types" >&5 +echo "configure:7121: checking for uintXX_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_uintxx_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -7050,7 +7131,7 @@ int main() { uint32_t c; a = b = c = 1; ; return 0; } EOF -if { (eval echo configure:7054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_uintxx_t="yes" else @@ -7090,12 +7171,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7094: checking for $ac_func" >&5 +echo "configure:7175: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7148,12 +7229,12 @@ done for ac_func in fchdir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7152: checking for $ac_func" >&5 +echo "configure:7233: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7207,12 +7288,12 @@ done for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7211: checking for $ac_func" >&5 +echo "configure:7292: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7263,12 +7344,12 @@ done for ac_func in localtime_r readdir_r strerror_r gethostbyname_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7267: checking for $ac_func" >&5 +echo "configure:7348: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7318,12 +7399,12 @@ done # If resolver functions are not in libc check for -lnsl or -lresolv. echo $ac_n "checking for gethostbyname_r""... $ac_c" 1>&6 -echo "configure:7322: checking for gethostbyname_r" >&5 +echo "configure:7403: checking for gethostbyname_r" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname_r'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname_r=yes" else @@ -7364,7 +7445,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname_r`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname_r in -lnsl""... $ac_c" 1>&6 -echo "configure:7368: checking for gethostbyname_r in -lnsl" >&5 +echo "configure:7449: checking for gethostbyname_r in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname_r | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7372,7 +7453,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7411,7 +7492,7 @@ else fi echo $ac_n "checking for gethostbyname_r in -lresolv""... $ac_c" 1>&6 -echo "configure:7415: checking for gethostbyname_r in -lresolv" >&5 +echo "configure:7496: checking for gethostbyname_r in -lresolv" >&5 ac_lib_var=`echo resolv'_'gethostbyname_r | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7419,7 +7500,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7463,12 +7544,12 @@ fi # Find where sockets are (especially for Solaris) echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:7467: checking for socket" >&5 +echo "configure:7548: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -7509,7 +7590,7 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lxnet""... $ac_c" 1>&6 -echo "configure:7513: checking for socket in -lxnet" >&5 +echo "configure:7594: checking for socket in -lxnet" >&5 ac_lib_var=`echo xnet'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7517,7 +7598,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7556,7 +7637,7 @@ else fi echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:7560: checking for socket in -lsocket" >&5 +echo "configure:7641: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7564,7 +7645,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7603,7 +7684,7 @@ else fi echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6 -echo "configure:7607: checking for socket in -linet" >&5 +echo "configure:7688: checking for socket in -linet" >&5 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7611,7 +7692,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7654,12 +7735,12 @@ fi echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:7658: checking for strftime" >&5 +echo "configure:7739: checking for strftime" >&5 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -7704,7 +7785,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:7708: checking for strftime in -lintl" >&5 +echo "configure:7789: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7712,7 +7793,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7750,12 +7831,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:7754: checking for vprintf" >&5 +echo "configure:7835: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -7802,12 +7883,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:7806: checking for _doprnt" >&5 +echo "configure:7887: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -7857,19 +7938,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:7861: checking for working alloca.h" >&5 +echo "configure:7942: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:7873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -7890,12 +7971,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:7894: checking for alloca" >&5 +echo "configure:7975: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -7955,12 +8036,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:7959: checking whether alloca needs Cray hooks" >&5 +echo "configure:8040: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7989: checking for $ac_func" >&5 +echo "configure:8070: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8040,7 +8121,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8044: checking stack direction for C alloca" >&5 +echo "configure:8125: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8048,7 +8129,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -8090,7 +8171,7 @@ fi # getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware. echo $ac_n "checking for getmntent in -lsun""... $ac_c" 1>&6 -echo "configure:8094: checking for getmntent in -lsun" >&5 +echo "configure:8175: checking for getmntent in -lsun" >&5 ac_lib_var=`echo sun'_'getmntent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8098,7 +8179,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8128,7 +8209,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for getmntent in -lseq""... $ac_c" 1>&6 -echo "configure:8132: checking for getmntent in -lseq" >&5 +echo "configure:8213: checking for getmntent in -lseq" >&5 ac_lib_var=`echo seq'_'getmntent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8136,7 +8217,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lseq $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8166,7 +8247,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for getmntent in -lgen""... $ac_c" 1>&6 -echo "configure:8170: checking for getmntent in -lgen" >&5 +echo "configure:8251: checking for getmntent in -lgen" >&5 ac_lib_var=`echo gen'_'getmntent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8174,7 +8255,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8210,12 +8291,12 @@ fi fi echo $ac_n "checking for getmntent""... $ac_c" 1>&6 -echo "configure:8214: checking for getmntent" >&5 +echo "configure:8295: checking for getmntent" >&5 if eval "test \"`echo '$''{'ac_cv_func_getmntent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getmntent=yes" else @@ -8261,7 +8342,7 @@ else fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 -echo "configure:8265: checking whether closedir returns void" >&5 +echo "configure:8346: checking whether closedir returns void" >&5 if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8269,13 +8350,13 @@ else ac_cv_func_closedir_void=yes else cat > conftest.$ac_ext < #include <$ac_header_dirent> int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF -if { (eval echo configure:8279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_closedir_void=no else @@ -8298,7 +8379,7 @@ EOF fi echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:8302: checking whether setpgrp takes no argument" >&5 +echo "configure:8383: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8306,7 +8387,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -8349,7 +8430,7 @@ EOF fi echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 -echo "configure:8353: checking for working fnmatch" >&5 +echo "configure:8434: checking for working fnmatch" >&5 if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8360,11 +8441,11 @@ if test "$cross_compiling" = yes; then ac_cv_func_fnmatch_works=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_fnmatch_works=yes else @@ -8389,7 +8470,7 @@ fi echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 -echo "configure:8393: checking for setlocale in -lxpg4" >&5 +echo "configure:8474: checking for setlocale in -lxpg4" >&5 ac_lib_var=`echo xpg4'_'setlocale | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8397,7 +8478,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxpg4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8431,7 +8512,7 @@ fi echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6 -echo "configure:8435: checking for getpwnam in -lsun" >&5 +echo "configure:8516: checking for getpwnam in -lsun" >&5 ac_lib_var=`echo sun'_'getpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8439,7 +8520,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8478,7 +8559,7 @@ else fi echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:8482: checking for deflate in -lz" >&5 +echo "configure:8563: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8486,7 +8567,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8528,7 +8609,7 @@ fi PTHREAD_LIB="" echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:8532: checking for pthread_create in -lpthread" >&5 +echo "configure:8613: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8536,7 +8617,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8566,7 +8647,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:8570: checking for pthread_create in -lpthreads" >&5 +echo "configure:8651: checking for pthread_create in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8574,7 +8655,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8604,7 +8685,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:8608: checking for pthread_create in -lc_r" >&5 +echo "configure:8689: checking for pthread_create in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8612,7 +8693,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8642,12 +8723,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6 -echo "configure:8646: checking for pthread_create" >&5 +echo "configure:8727: checking for pthread_create" >&5 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_create=yes" else diff --git a/bacula/kernstodo b/bacula/kernstodo index 3b283e8f2e..65ada9928f 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -1,5 +1,5 @@ Kern's ToDo List - 18 July 2002 + 25 July 2002 To do: - Document passwords. @@ -11,6 +11,9 @@ To do: - Document specifically how to add new File daemon to config files. - Document forcing a new tape to be used. +- Fix db_get_job_volume_names() to return array of strings. +- Report compression % and other compression statistics if turned on. +- Add JobLevel in FD status (but make sure it is defined). - Eliminate MySQL shared libraries from smtp and daemons not using MySQL. - Pass "Catalog Files = no" to storage daemon to eliminate diff --git a/bacula/src/cats/drop_mysql_tables.in b/bacula/src/cats/drop_mysql_tables.in index 14f2ea0d9d..86be989676 100644 --- a/bacula/src/cats/drop_mysql_tables.in +++ b/bacula/src/cats/drop_mysql_tables.in @@ -19,6 +19,7 @@ DROP TABLE IF EXISTS MultiVolume; DROP TABLE IF EXISTS FileSave; DROP TABLE IF EXISTS FileSet; DROP TABLE IF EXISTS Version; +DROP TABLE IF EXISTS Counters; END-OF-DATA then echo "Deletion of Bacula MySQL tables succeeded." diff --git a/bacula/src/cats/make_sqlite_tables.in b/bacula/src/cats/make_sqlite_tables.in index 49d4720e35..e50288c488 100644 --- a/bacula/src/cats/make_sqlite_tables.in +++ b/bacula/src/cats/make_sqlite_tables.in @@ -12,12 +12,16 @@ CREATE TABLE Filename ( PRIMARY KEY(FilenameId) ); +CREATE INDEX inx1 ON Filename (Name); + CREATE TABLE Path ( PathId INTEGER UNSIGNED AUTOINCREMENT, Path TEXT DEFAULT "", PRIMARY KEY(PathId) ); +CREATE INDEX inx2 ON Path (Path); + CREATE TABLE File ( FileId INTEGER UNSIGNED AUTOINCREMENT, @@ -31,6 +35,10 @@ CREATE TABLE File ( PRIMARY KEY(FileId) ); +CREATE INDEX inx3 ON File (JobId); +CREATE INDEX inx4 ON File (PathId); +CREATE INDEX inx5 ON File (FileNameId); + CREATE TABLE Job ( JobId INTEGER UNSIGNED NOT NULL, Job VARCHAR(128) NOT NULL, @@ -55,6 +63,8 @@ CREATE TABLE Job ( PRIMARY KEY(JobId) ); +CREATE INDEX inx6 ON Job (Name); + CREATE TABLE FileSet ( FileSetId INTEGER UNSIGNED AUTOINCREMENT, FileSet VARCHAR(128) NOT NULL, @@ -75,6 +85,8 @@ CREATE TABLE JobMedia ( PRIMARY KEY(JobMediaId) ); +CREATE INDEX inx7 ON JobMedia (JobId, MediaId); + CREATE TABLE Media ( MediaId INTEGER UNSIGNED AUTOINCREMENT, @@ -100,6 +112,8 @@ CREATE TABLE Media ( PRIMARY KEY(MediaId) ); +CREATE INDEX inx8 ON Media (PoolId); + CREATE TABLE Pool ( PoolId INTEGER UNSIGNED AUTOINCREMENT, Name VARCHAR(128) NOT NULL, diff --git a/bacula/src/cats/mysql.c b/bacula/src/cats/mysql.c index f2e94b81ee..ff10b158d7 100644 --- a/bacula/src/cats/mysql.c +++ b/bacula/src/cats/mysql.c @@ -116,6 +116,9 @@ db_open_database(B_DB *mdb) } /* connect to the database */ +#ifdef HAVE_EMBEDDED_MYSQL + mysql_server_init(0, NULL, NULL); +#endif mysql_init(&(mdb->mysql)); Dmsg0(50, "mysql_init done\n"); mdb->db = mysql_real_connect( @@ -173,6 +176,9 @@ db_close_database(B_DB *mdb) qdchain(&mdb->bq); if (mdb->connected && mdb->db) { sql_close(mdb); +#ifdef HAVE_EMBEDDED_MYSQL + mysql_server_end(); +#endif } /* pthread_mutex_destroy(&mdb->mutex); */ rwl_destroy(&mdb->lock); diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index df81e5ab00..e5502af608 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -88,7 +88,7 @@ db_create_job_record(B_DB *mdb, JOB_DBR *jr) /* Must create it */ Mmsg(&mdb->cmd, "INSERT INTO Job (JobId,Job,Name,Type,Level,JobStatus,SchedTime,JobTDate) VALUES \ -(%s,\"%s\",\"%s\",\"%c\",\"%c\",\"%c\",\"%s\",%s)", +(%s,'%s','%s','%c','%c','%c','%s',%s)", JobId, jr->Job, jr->Name, (char)(jr->Type), (char)(jr->Level), (char)(jr->JobStatus), dt, edit_uint64(JobTDate, ed1)); @@ -165,7 +165,7 @@ db_create_pool_record(B_DB *mdb, POOL_DBR *pr) char ed1[30]; db_lock(mdb); - Mmsg(&mdb->cmd, "SELECT PoolId,Name FROM Pool WHERE Name=\"%s\"", pr->Name); + Mmsg(&mdb->cmd, "SELECT PoolId,Name FROM Pool WHERE Name='%s'", pr->Name); Dmsg1(20, "selectpool: %s\n", mdb->cmd); if (QUERY_DB(mdb, mdb->cmd)) { @@ -185,7 +185,7 @@ db_create_pool_record(B_DB *mdb, POOL_DBR *pr) Mmsg(&mdb->cmd, "INSERT INTO Pool (Name, NumVols, MaxVols, UseOnce, UseCatalog, \ AcceptAnyVolume, AutoPrune, Recycle, VolRetention, PoolType, LabelFormat) \ -VALUES (\"%s\", %d, %d, %d, %d, %d, %d, %d, %s, \"%s\", \"%s\")", +VALUES ('%s', %d, %d, %d, %d, %d, %d, %d, %s, '%s', '%s')", pr->Name, pr->NumVols, pr->MaxVols, pr->UseOnce, pr->UseCatalog, @@ -221,7 +221,7 @@ db_create_media_record(B_DB *mdb, MEDIA_DBR *mr) char ed1[30], ed2[30], ed3[30]; db_lock(mdb); - Mmsg(&mdb->cmd, "SELECT MediaId FROM Media WHERE VolumeName=\"%s\"", + Mmsg(&mdb->cmd, "SELECT MediaId FROM Media WHERE VolumeName='%s'", mr->VolumeName); Dmsg1(110, "selectpool: %s\n", mdb->cmd); @@ -239,7 +239,7 @@ db_create_media_record(B_DB *mdb, MEDIA_DBR *mr) /* Must create it */ Mmsg(&mdb->cmd, "INSERT INTO Media (VolumeName, MediaType, PoolId, VolMaxBytes, VolCapacityBytes, \ -Recycle, VolRetention, VolStatus) VALUES (\"%s\", \"%s\", %d, %s, %s, %d, %s, \"%s\")", +Recycle, VolRetention, VolStatus) VALUES ('%s', '%s', %d, %s, %s, %d, %s, '%s')", mr->VolumeName, mr->MediaType, mr->PoolId, edit_uint64(mr->VolMaxBytes,ed1), @@ -275,7 +275,7 @@ int db_create_client_record(B_DB *mdb, CLIENT_DBR *cr) char ed1[30], ed2[30]; db_lock(mdb); - Mmsg(&mdb->cmd, "SELECT ClientId FROM Client WHERE Name=\"%s\"", cr->Name); + Mmsg(&mdb->cmd, "SELECT ClientId FROM Client WHERE Name='%s'", cr->Name); cr->ClientId = 0; if (QUERY_DB(mdb, mdb->cmd)) { @@ -305,7 +305,7 @@ int db_create_client_record(B_DB *mdb, CLIENT_DBR *cr) /* Must create it */ Mmsg(&mdb->cmd, "INSERT INTO Client (Name, Uname, AutoPrune, \ FileRetention, JobRetention) VALUES \ -(\"%s\", \"%s\", %d, %s, %s)", cr->Name, cr->Uname, cr->AutoPrune, +('%s', '%s', %d, %s, %s)", cr->Name, cr->Uname, cr->AutoPrune, edit_uint64(cr->FileRetention, ed1), edit_uint64(cr->JobRetention, ed2)); @@ -336,7 +336,7 @@ int db_create_fileset_record(B_DB *mdb, FILESET_DBR *fsr) db_lock(mdb); Mmsg(&mdb->cmd, "SELECT FileSetId FROM FileSet WHERE \ -FileSet=\"%s\" and MD5=\"%s\"", fsr->FileSet, fsr->MD5); +FileSet='%s' and MD5='%s'", fsr->FileSet, fsr->MD5); fsr->FileSetId = 0; if (QUERY_DB(mdb, mdb->cmd)) { @@ -364,7 +364,7 @@ FileSet=\"%s\" and MD5=\"%s\"", fsr->FileSet, fsr->MD5); /* Must create it */ Mmsg(&mdb->cmd, "INSERT INTO FileSet (FileSet, MD5) VALUES \ -(\"%s\", \"%s\")", fsr->FileSet, fsr->MD5); +('%s', '%s')", fsr->FileSet, fsr->MD5); if (!INSERT_DB(mdb, mdb->cmd)) { Mmsg2(&mdb->errmsg, _("Create DB FileSet record %s failed. ERR=%s\n"), @@ -527,7 +527,7 @@ static int db_create_file_record(B_DB *mdb, ATTR_DBR *ar) /* Must create it */ Mmsg(&mdb->cmd, "INSERT INTO File (FileIndex, JobId, PathId, FilenameId, \ -LStat, MD5) VALUES (%d, %d, %d, %d, \"%s\", \"0\")", +LStat, MD5) VALUES (%d, %d, %d, %d, '%s', '0')", (int)ar->FileIndex, ar->JobId, ar->PathId, ar->FilenameId, ar->attr); @@ -566,7 +566,7 @@ static int db_create_path_record(B_DB *mdb, ATTR_DBR *ar, char *path) return 1; } - Mmsg(&mdb->cmd, "SELECT PathId FROM Path WHERE Path=\"%s\"", path); + Mmsg(&mdb->cmd, "SELECT PathId FROM Path WHERE Path='%s'", path); if (QUERY_DB(mdb, mdb->cmd)) { @@ -605,7 +605,7 @@ static int db_create_path_record(B_DB *mdb, ATTR_DBR *ar, char *path) sql_free_result(mdb); } - Mmsg(&mdb->cmd, "INSERT INTO Path (Path) VALUES (\"%s\")", path); + Mmsg(&mdb->cmd, "INSERT INTO Path (Path) VALUES ('%s')", path); if (!INSERT_DB(mdb, mdb->cmd)) { Mmsg2(&mdb->errmsg, _("Create db Path record %s failed. ERR=%s\n"), @@ -635,7 +635,7 @@ static int db_create_filename_record(B_DB *mdb, ATTR_DBR *ar, char *fname) SQL_ROW row; db_lock(mdb); - Mmsg(&mdb->cmd, "SELECT FilenameId FROM Filename WHERE Name=\"%s\"", fname); + Mmsg(&mdb->cmd, "SELECT FilenameId FROM Filename WHERE Name='%s'", fname); if (QUERY_DB(mdb, mdb->cmd)) { mdb->num_rows = sql_num_rows(mdb); @@ -661,7 +661,7 @@ static int db_create_filename_record(B_DB *mdb, ATTR_DBR *ar, char *fname) } Mmsg(&mdb->cmd, "INSERT INTO Filename (Name) \ -VALUES (\"%s\")", fname); +VALUES ('%s')", fname); if (!INSERT_DB(mdb, mdb->cmd)) { Mmsg2(&mdb->errmsg, _("Create db Filename record %s failed. ERR=%s\n"), diff --git a/bacula/src/cats/sql_delete.c b/bacula/src/cats/sql_delete.c index c3c51c7bc6..74076eb651 100644 --- a/bacula/src/cats/sql_delete.c +++ b/bacula/src/cats/sql_delete.c @@ -66,7 +66,7 @@ db_delete_pool_record(B_DB *mdb, POOL_DBR *pr) SQL_ROW row; db_lock(mdb); - Mmsg(&mdb->cmd, "SELECT PoolId FROM Pool WHERE Name=\"%s\"", pr->Name); + Mmsg(&mdb->cmd, "SELECT PoolId FROM Pool WHERE Name='%s'", pr->Name); Dmsg1(10, "selectpool: %s\n", mdb->cmd); pr->PoolId = pr->NumVols = 0; diff --git a/bacula/src/cats/sql_find.c b/bacula/src/cats/sql_find.c index 45d75e14a3..47782f5cf0 100644 --- a/bacula/src/cats/sql_find.c +++ b/bacula/src/cats/sql_find.c @@ -74,14 +74,14 @@ db_find_job_start_time(B_DB *mdb, JOB_DBR *jr, char *stime) if (jr->Level == L_DIFFERENTIAL) { Mmsg(&mdb->cmd, "SELECT JobId from Job WHERE JobStatus='T' and Type='%c' and \ -Level='%c' and Name=\"%s\" and ClientId=%d and FileSetId=%d \ +Level='%c' and Name='%s' and ClientId=%d and FileSetId=%d \ ORDER by StartTime DESC LIMIT 1", jr->Type, L_FULL, jr->Name, jr->ClientId, jr->FileSetId); /* Incremental is since last Full, Incremental, or Differential */ } else if (jr->Level == L_INCREMENTAL) { Mmsg(&mdb->cmd, "SELECT JobId from Job WHERE JobStatus='T' and Type='%c' and \ -(Level='%c' or Level='%c' or Level='%c') and Name=\"%s\" and ClientId=%d \ +(Level='%c' or Level='%c' or Level='%c') and Name='%s' and ClientId=%d \ ORDER by StartTime DESC LIMIT 1", jr->Type, L_INCREMENTAL, L_DIFFERENTIAL, L_FULL, jr->Name, jr->ClientId); @@ -149,7 +149,7 @@ db_find_last_jobid(B_DB *mdb, JOB_DBR *jr) db_lock(mdb); if (jr->Level == L_VERIFY_CATALOG) { Mmsg(&mdb->cmd, -"SELECT JobId FROM Job WHERE Type='%c' AND Level='%c' AND Name=\"%s\" AND \ +"SELECT JobId FROM Job WHERE Type='%c' AND Level='%c' AND Name='%s' AND \ ClientId=%d ORDER BY StartTime DESC LIMIT 1", JT_VERIFY, L_VERIFY_INIT, jr->Name, jr->ClientId); } else if (jr->Level == L_VERIFY_VOLUME_TO_CATALOG) { @@ -205,7 +205,7 @@ db_find_next_volume(B_DB *mdb, int item, MEDIA_DBR *mr) db_lock(mdb); Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,\ VolBytes,VolMounts,VolErrors,VolWrites,VolMaxBytes,VolCapacityBytes,Slot \ -FROM Media WHERE PoolId=%d AND MediaType=\"%s\" AND VolStatus=\"%s\" \ +FROM Media WHERE PoolId=%d AND MediaType='%s' AND VolStatus='%s' \ ORDER BY MediaId", mr->PoolId, mr->MediaType, mr->VolStatus); if (!QUERY_DB(mdb, mdb->cmd)) { diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 2a7e46225b..938e0a8d0e 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -213,7 +213,7 @@ static int db_get_filename_record(B_DB *mdb, char *fname) } db_lock(mdb); - Mmsg(&mdb->cmd, "SELECT FilenameId FROM Filename WHERE Name=\"%s\"", fname); + Mmsg(&mdb->cmd, "SELECT FilenameId FROM Filename WHERE Name='%s'", fname); if (QUERY_DB(mdb, mdb->cmd)) { mdb->num_rows = sql_num_rows(mdb); @@ -263,7 +263,7 @@ static int db_get_path_record(B_DB *mdb, char *path) return mdb->cached_path_id; } - Mmsg(&mdb->cmd, "SELECT PathId FROM Path WHERE Path=\"%s\"", path); + Mmsg(&mdb->cmd, "SELECT PathId FROM Path WHERE Path='%s'", path); if (QUERY_DB(mdb, mdb->cmd)) { char ed1[30]; @@ -312,7 +312,7 @@ int db_get_job_record(B_DB *mdb, JOB_DBR *jr) if (jr->JobId == 0) { Mmsg(&mdb->cmd, "SELECT VolSessionId, VolSessionTime, \ PoolId, StartTime, EndTime, JobFiles, JobBytes, JobTDate, Job, JobStatus \ -FROM Job WHERE Job=\"%s\"", jr->Job); +FROM Job WHERE Job='%s'", jr->Job); } else { Mmsg(&mdb->cmd, "SELECT VolSessionId, VolSessionTime, \ PoolId, StartTime, EndTime, JobFiles, JobBytes, JobTDate, Job, JobStatus \ @@ -470,7 +470,7 @@ PoolType, LabelFormat FROM Pool WHERE Pool.PoolId=%d", pdbr->PoolId); Mmsg(&mdb->cmd, "SELECT PoolId, Name, NumVols, MaxVols, UseOnce, UseCatalog, AcceptAnyVolume, \ AutoPrune, Recycle, VolRetention, \ -PoolType, LabelFormat FROM Pool WHERE Pool.Name=\"%s\"", pdbr->Name); +PoolType, LabelFormat FROM Pool WHERE Pool.Name='%s'", pdbr->Name); } if (QUERY_DB(mdb, mdb->cmd)) { @@ -590,7 +590,7 @@ FROM Media WHERE MediaId=%d", mr->MediaId); Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,\ VolBytes,VolMounts,VolErrors,VolWrites,VolMaxBytes,VolCapacityBytes,\ MediaType,VolStatus,PoolId,VolRetention,Recycle,Slot \ -FROM Media WHERE VolumeName=\"%s\"", mr->VolumeName); +FROM Media WHERE VolumeName='%s'", mr->VolumeName); } if (QUERY_DB(mdb, mdb->cmd)) { diff --git a/bacula/src/cats/sql_list.c b/bacula/src/cats/sql_list.c index 8d88817695..1336f08d09 100644 --- a/bacula/src/cats/sql_list.c +++ b/bacula/src/cats/sql_list.c @@ -96,7 +96,7 @@ void db_list_media_records(B_DB *mdb, MEDIA_DBR *mdbr, DB_LIST_HANDLER *sendit, void *ctx) { - Mmsg(&mdb->cmd, "SELECT VolumeName,MediaType,VolStatus,\ + Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,MediaType,VolStatus,\ VolBytes,LastWritten,VolRetention,Recycle \ FROM Media WHERE Media.PoolId=%d ORDER BY MediaId", mdbr->PoolId); diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index 73b163ff95..1d778acbc3 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -60,7 +60,7 @@ db_add_MD5_to_file_record(B_DB *mdb, FileId_t FileId, char *MD5) int stat; db_lock(mdb); - Mmsg(&mdb->cmd, "UPDATE File SET MD5=\"%s\" WHERE FileId=%d", MD5, FileId); + Mmsg(&mdb->cmd, "UPDATE File SET MD5='%s' WHERE FileId=%d", MD5, FileId); stat = UPDATE_DB(mdb, mdb->cmd); db_unlock(mdb); return stat; @@ -102,7 +102,7 @@ db_update_job_start_record(B_DB *mdb, JOB_DBR *jr) JobTDate = (btime_t)stime; db_lock(mdb); - Mmsg(&mdb->cmd, "UPDATE Job SET Level='%c', StartTime=\"%s\", \ + Mmsg(&mdb->cmd, "UPDATE Job SET Level='%c', StartTime='%s', \ ClientId=%d, JobTDate=%s WHERE JobId=%d", (char)(jr->Level), dt, jr->ClientId, edit_uint64(JobTDate, ed1), jr->JobId); stat = UPDATE_DB(mdb, mdb->cmd); @@ -166,7 +166,7 @@ db_update_pool_record(B_DB *mdb, POOL_DBR *pr) db_lock(mdb); Mmsg(&mdb->cmd, "UPDATE Pool SET NumVols=%d, MaxVols=%d, UseOnce=%d, UseCatalog=%d, \ -AcceptAnyVolume=%d, LabelFormat=\"%s\" WHERE PoolId=%d", +AcceptAnyVolume=%d, LabelFormat='%s' WHERE PoolId=%d", pr->NumVols, pr->MaxVols, pr->UseOnce, pr->UseCatalog, pr->AcceptAnyVolume, pr->LabelFormat, pr->PoolId); @@ -197,15 +197,15 @@ db_update_media_record(B_DB *mdb, MEDIA_DBR *mr) Dmsg1(100, "update_media: FirstWritten=%d\n", mr->FirstWritten); db_lock(mdb); if (mr->VolMounts == 1) { - Mmsg(&mdb->cmd, "UPDATE Media SET FirstWritten=\"%s\"\ - WHERE VolumeName=\"%s\"", dt, mr->VolumeName); + Mmsg(&mdb->cmd, "UPDATE Media SET FirstWritten='%s'\ + WHERE VolumeName='%s'", dt, mr->VolumeName); UPDATE_DB(mdb, mdb->cmd); } Mmsg(&mdb->cmd, "UPDATE Media SET VolJobs=%d,\ VolFiles=%d, VolBlocks=%d, VolBytes=%s, VolMounts=%d, VolErrors=%d,\ - VolWrites=%d, VolMaxBytes=%s, LastWritten=\"%s\", VolStatus=\"%s\",\ - Slot=%d WHERE VolumeName=\"%s\"", + VolWrites=%d, VolMaxBytes=%s, LastWritten='%s', VolStatus='%s',\ + Slot=%d WHERE VolumeName='%s'", mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1), mr->VolMounts, mr->VolErrors, mr->VolWrites, edit_uint64(mr->VolMaxBytes, ed2), dt, diff --git a/bacula/src/cats/sqlite.c b/bacula/src/cats/sqlite.c index 4dc485aed3..ee9022d809 100644 --- a/bacula/src/cats/sqlite.c +++ b/bacula/src/cats/sqlite.c @@ -225,13 +225,8 @@ db_escape_string(char *snew, char *old, int len) while (len--) { switch (*o) { case '\'': - *n++ = '\\'; *n++ = '\''; - o++; - break; - case '"': - *n++ = '\\'; - *n++ = '"'; + *n++ = '\''; o++; break; case 0: diff --git a/bacula/src/dird/Makefile.in b/bacula/src/dird/Makefile.in index cf86fe2561..26d8308eb9 100644 --- a/bacula/src/dird/Makefile.in +++ b/bacula/src/dird/Makefile.in @@ -28,11 +28,11 @@ SVRSRCS = dird.c authenticate.c autoprune.c \ fd_cmds.c getmsg.c job.c \ mountreq.c msgchan.c newvol.c \ recycle.c restore.c run_conf.c \ - scheduler.c ua_cmds.c \ - ua_dotcmds.c \ + scheduler.c sql_cmds.c \ + ua_cmds.c ua_dotcmds.c \ ua_db_query.c ua_retention.c \ ua_input.c ua_output.c ua_prune.c \ - ua_purge.c ua_run.c \ + ua_purge.c ua_restore.c ua_run.c \ ua_select.c ua_server.c \ ua_status.c verify.c SVROBJS = dird.o authenticate.o autoprune.o \ @@ -41,11 +41,11 @@ SVROBJS = dird.o authenticate.o autoprune.o \ fd_cmds.o getmsg.o job.o \ mountreq.o msgchan.o newvol.o \ recycle.o restore.o run_conf.o \ - scheduler.o ua_cmds.o \ - ua_dotcmds.o \ + scheduler.o sql_cmds.o \ + ua_cmds.o ua_dotcmds.o \ ua_db_query.o ua_retention.o \ ua_input.o ua_output.o ua_prune.o \ - ua_purge.o ua_run.o \ + ua_purge.o ua_restore.o ua_run.o \ ua_select.o ua_server.o \ ua_status.o verify.o diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index 640b7be170..83541d8202 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -166,7 +166,7 @@ int main (int argc, char *argv[]) parse_config(configfile); if (!check_resources()) { - Emsg1(M_ABORT, 0, "Please correct configuration file: %s\n", configfile); + Emsg1(M_ERROR_TERM, 0, "Please correct configuration file: %s\n", configfile); } if (test_config) { @@ -268,7 +268,7 @@ static void reload_config(int sig) Dmsg0(200, "check_resources()\n"); if (!check_resources()) { - Emsg1(M_ABORT, 0, _("Please correct configuration file: %s\n"), configfile); + Emsg1(M_ERROR_TERM, 0, _("Please correct configuration file: %s\n"), configfile); } /* Reset globals */ diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index a16f3aa335..f7c947fcdb 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -760,13 +760,13 @@ void save_resource(int type, struct res_items *items, int pass) for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) { - Emsg2(M_ABORT, 0, "%s item is required in %s resource, but not found.\n", + Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n", items[i].name, resources[rindex]); } } /* If this triggers, take a look at lib/parse_conf.h */ if (i >= MAX_RES_ITEMS) { - Emsg1(M_ABORT, 0, "Too many items in %s resource\n", resources[rindex]); + Emsg1(M_ERROR_TERM, 0, "Too many items in %s resource\n", resources[rindex]); } } @@ -789,13 +789,13 @@ void save_resource(int type, struct res_items *items, int pass) /* Resources containing another resource */ case R_DIRECTOR: if ((res = (URES *)GetResWithName(R_DIRECTOR, res_all.res_dir.hdr.name)) == NULL) { - Emsg1(M_ABORT, 0, "Cannot find Director resource %s\n", res_all.res_dir.hdr.name); + Emsg1(M_ERROR_TERM, 0, "Cannot find Director resource %s\n", res_all.res_dir.hdr.name); } res->res_dir.messages = res_all.res_dir.messages; break; case R_JOB: if ((res = (URES *)GetResWithName(R_JOB, res_all.res_dir.hdr.name)) == NULL) { - Emsg1(M_ABORT, 0, "Cannot find Job resource %s\n", res_all.res_dir.hdr.name); + Emsg1(M_ERROR_TERM, 0, "Cannot find Job resource %s\n", res_all.res_dir.hdr.name); } res->res_job.messages = res_all.res_job.messages; res->res_job.schedule = res_all.res_job.schedule; @@ -804,7 +804,7 @@ void save_resource(int type, struct res_items *items, int pass) res->res_job.storage = res_all.res_job.storage; res->res_job.pool = res_all.res_job.pool; if (res->res_job.JobType == 0) { - Emsg1(M_ABORT, 0, "Job Type not defined for Job resource %s\n", res_all.res_dir.hdr.name); + Emsg1(M_ERROR_TERM, 0, "Job Type not defined for Job resource %s\n", res_all.res_dir.hdr.name); } if (res->res_job.level != 0) { int i; @@ -816,14 +816,14 @@ void save_resource(int type, struct res_items *items, int pass) } } if (i != 0) { - Emsg1(M_ABORT, 0, "Inappropriate level specified in Job resource %s\n", + Emsg1(M_ERROR_TERM, 0, "Inappropriate level specified in Job resource %s\n", res_all.res_dir.hdr.name); } } break; case R_CLIENT: if ((res = (URES *)GetResWithName(R_CLIENT, res_all.res_client.hdr.name)) == NULL) { - Emsg1(M_ABORT, 0, "Cannot find Client resource %s\n", res_all.res_client.hdr.name); + Emsg1(M_ERROR_TERM, 0, "Cannot find Client resource %s\n", res_all.res_client.hdr.name); } res->res_client.catalog = res_all.res_client.catalog; break; @@ -834,7 +834,7 @@ void save_resource(int type, struct res_items *items, int pass) * into the Schedule resource. */ if ((res = (URES *)GetResWithName(R_SCHEDULE, res_all.res_client.hdr.name)) == NULL) { - Emsg1(M_ABORT, 0, "Cannot find Schedule resource %s\n", res_all.res_client.hdr.name); + Emsg1(M_ERROR_TERM, 0, "Cannot find Schedule resource %s\n", res_all.res_client.hdr.name); } res->res_sch.run = res_all.res_sch.run; break; diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 841f56405f..5c45db6997 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -53,6 +53,7 @@ extern int runcmd(UAContext *ua, char *cmd); extern int retentioncmd(UAContext *ua, char *cmd); extern int prunecmd(UAContext *ua, char *cmd); extern int purgecmd(UAContext *ua, char *cmd); +extern int restorecmd(UAContext *ua, char *cmd); /* Forward referenced functions */ static int addcmd(UAContext *ua, char *cmd), createcmd(UAContext *ua, char *cmd), cancelcmd(UAContext *ua, char *cmd); @@ -83,6 +84,7 @@ static struct cmdstruct commands[] = { { N_("list"), listcmd, _("list [pools | jobs | jobtotals | media | files job=]; from catalog")}, { N_("messages"), messagescmd, _("messages")}, { N_("mount"), mountcmd, _("mount ")}, + { N_("restore"), restorecmd, _("restore files")}, { N_("prune"), prunecmd, _("prune expired records from catalog")}, { N_("purge"), purgecmd, _("purge records from catalog")}, { N_("run"), runcmd, _("run ")}, @@ -545,14 +547,14 @@ static int updatecmd(UAContext *ua, char *cmd) } start_prompt(ua, _("Update choice:\n")); - add_prompt(ua, _("Pool from resource")); add_prompt(ua, _("Volume parameters")); + add_prompt(ua, _("Pool from resource")); switch (do_prompt(ua, _("Choose catalog item to update"), NULL)) { case 0: - update_pool(ua); + update_volume(ua); break; case 1: - update_volume(ua); + update_pool(ua); break; default: break; @@ -570,46 +572,30 @@ static int update_volume(UAContext *ua) { POOL_DBR pr; MEDIA_DBR mr; - int i; - static char *kw[] = { - "volume", - NULL}; POOLMEM *query; char ed1[30]; - memset(&pr, 0, sizeof(pr)); - memset(&mr, 0, sizeof(mr)); - if (!get_pool_dbr(ua, &pr)) { + if (!select_pool_and_media_dbr(ua, &pr, &mr)) { return 0; } - mr.PoolId = pr.PoolId; - mr.VolumeName[0] = 0; - - i = find_arg_keyword(ua, kw); - if (i == 0 && ua->argv[i]) { - strcpy(mr.VolumeName, ua->argv[i]); - } - if (mr.VolumeName[0] == 0) { - db_list_media_records(ua->db, &mr, prtit, ua); - if (!get_cmd(ua, _("Enter Volume name to update: "))) { - return 0; - } - strcpy(mr.VolumeName, ua->cmd); - } for (int done=0; !done; ) { - mr.MediaId = 0; if (!db_get_media_record(ua->db, &mr)) { - bsendmsg(ua, _("Volume record for %s not found.\n"), mr.VolumeName); + if (mr.MediaId != 0) { + bsendmsg(ua, _("Volume record for MediaId %d not found.\n"), mr.MediaId); + } else { + bsendmsg(ua, _("Volume record for %s not found.\n"), mr.VolumeName); + } return 0; } + bsendmsg(ua, _("Updating Volume %s\n"), mr.VolumeName); start_prompt(ua, _("Parameters to modify:\n")); add_prompt(ua, _("Volume Status")); add_prompt(ua, _("Volume Retention Period")); add_prompt(ua, _("Recycle Flag")); add_prompt(ua, _("Slot")); add_prompt(ua, _("Done")); - switch (do_prompt(ua, _("Select paramter to modify"), NULL)) { + switch (do_prompt(ua, _("Select parameter to modify"), NULL)) { case 0: /* Volume Status */ /* Modify Volume Status */ bsendmsg(ua, _("Current value is: %s\n"), mr.VolStatus); @@ -627,7 +613,7 @@ static int update_volume(UAContext *ua) } strcpy(mr.VolStatus, ua->cmd); query = get_pool_memory(PM_MESSAGE); - Mmsg(&query, "UPDATE Media SET VolStatus=\"%s\" WHERE MediaId=%d", + Mmsg(&query, "UPDATE Media SET VolStatus='%s' WHERE MediaId=%d", mr.VolStatus, mr.MediaId); if (!db_sql_query(ua->db, query, NULL, NULL)) { bsendmsg(ua, "%s", db_strerror(ua->db)); @@ -1306,11 +1292,11 @@ static int helpcmd(UAContext *ua, char *cmd) unsigned int i; /* usage(); */ - bnet_fsend(ua->UA_sock, _(" Command Description\n ======= ===========\n")); + bsendmsg(ua, _(" Command Description\n ======= ===========\n")); for (i=0; iUA_sock, _(" %-10s %s\n"), _(commands[i].key), _(commands[i].help)); + bsendmsg(ua, _(" %-10s %s\n"), _(commands[i].key), _(commands[i].help)); } - bnet_fsend(ua->UA_sock, "\n"); + bsendmsg(ua, "\n"); return 1; } diff --git a/bacula/src/dird/ua_prune.c b/bacula/src/dird/ua_prune.c index 82a6583d79..fd972682ee 100644 --- a/bacula/src/dird/ua_prune.c +++ b/bacula/src/dird/ua_prune.c @@ -41,86 +41,23 @@ static int mark_media_purged(UAContext *ua, MEDIA_DBR *mr); #define MAX_DEL_LIST_LEN 1000000 -/* - * Select JobIds for File deletion. - */ -static char *select_job = - "SELECT JobId from Job " - "WHERE JobTDate < %s " - "AND ClientId=%d " - "AND PurgedFiles=0"; - -/* - * List of SQL commands terminated by NULL for deleting - * temporary tables and indicies - */ -static char *drop_deltabs[] = { - "DROP TABLE DelCandidates", - "DROP INDEX DelInx1", - NULL}; - -/* - * List of SQL commands to create temp table and indicies - */ -static char *create_deltabs[] = { - "CREATE TABLE DelCandidates (" - "JobId INTEGER UNSIGNED NOT NULL, " - "PurgedFiles TINYINT, " - "FileSetId INTEGER UNSIGNED)", - "CREATE INDEX DelInx1 ON DelCandidates (JobId)", - NULL}; - - -/* - * Fill candidates table with all Files subject to being deleted. - * This is used for pruning Jobs (first the files, then the Jobs). - */ -static char *insert_delcand = - "INSERT INTO DelCandidates " - "SELECT JobId, PurgedFiles, FileSetId FROM Job " - "WHERE JobTDate < %s " - "AND ClientId=%d"; - -/* - * Select files from the DelCandidates table that have a - * more recent backup -- i.e. are not the only backup. - * This is the list of files to delete for a Backup Job. - */ -static char *select_backup_del = - "SELECT DelCandidates.JobId " - "FROM Job,DelCandidates " - "WHERE Job.JobTDate >= %s " - "AND Job.ClientId=%d " - "AND Job.JobType='B' " - "AND Job.Level='F' " - "AND Job.JobStatus='T' " - "AND Job.FileSetId=DelCandidates.FileSetId"; +/* Imported variables */ +extern char *select_job; +extern char *drop_deltabs[]; +extern char *create_deltabs[]; +extern char *insert_delcand; +extern char *select_backup_del; +extern char *select_verify_del; +extern char *select_restore_del; +extern char *cnt_File; +extern char *del_File; +extern char *upd_Purged; +extern char *cnt_DelCand; +extern char *del_Job; +extern char *del_JobMedia; +extern char *cnt_JobMedia; +extern char *sel_JobMedia; -/* - * Select files from the DelCandidates table that have a - * more recent InitCatalog -- i.e. are not the only InitCatalog - * This is the list of files to delete for a Verify Job. - */ -static char *select_verify_del = - "SELECT DelCandidates.JobId " - "FROM Job,DelCandidates " - "WHERE Job.JobTDate >= %s " - "AND Job.ClientId=%d " - "AND Job.JobType='V' " - "AND Job.Level='V' " - "AND Job.JobStatus='T' " - "AND Job.FileSetId=DelCandidates.FileSetId"; - -/* - * Select files from the DelCandidates table. - * This is the list of files to delete for a Restore Job. - */ -static char *select_restore_del = - "SELECT DelCandidates.JobId " - "FROM Job,DelCandidates " - "WHERE Job.JobTDate >= %s " - "AND Job.ClientId=%d " - "AND Job.JobType='R'"; /* In memory list of JobIds */ struct s_file_del_ctx { @@ -336,8 +273,7 @@ int prune_files(UAContext *ua, CLIENT *client) if (del.tot_ids == 0) { if (ua->verbose) { - bsendmsg(ua, _("No Files found for client %s to prune from %s catalog.\n"), - client->hdr.name, client->catalog->hdr.name); + bsendmsg(ua, _("No Files found to prune.\n")); } goto bail_out; } @@ -357,11 +293,11 @@ int prune_files(UAContext *ua, CLIENT *client) for (i=0; i < del.num_ids; i++) { struct s_count_ctx cnt; Dmsg1(050, "Delete JobId=%d\n", del.JobId[i]); - Mmsg(&query, "SELECT count(*) FROM File WHERE JobId=%d", del.JobId[i]); + Mmsg(&query, cnt_File, del.JobId[i]); cnt.count = 0; db_sql_query(ua->db, query, count_handler, (void *)&cnt); del.tot_ids += cnt.count; - Mmsg(&query, "DELETE FROM File WHERE JobId=%d", del.JobId[i]); + Mmsg(&query, del_File, del.JobId[i]); db_sql_query(ua->db, query, NULL, (void *)NULL); /* * Now mark Job as having files purged. This is necessary to @@ -369,7 +305,7 @@ int prune_files(UAContext *ua, CLIENT *client) * we don't do this, the number of JobId's in our in memory list * will grow very large. */ - Mmsg(&query, "UPDATE Job Set PurgedFiles=1 WHERE JobId=%d", del.JobId[i]); + Mmsg(&query, upd_Purged, del.JobId[i]); db_sql_query(ua->db, query, NULL, (void *)NULL); Dmsg1(050, "Del sql=%s\n", query); } @@ -469,7 +405,7 @@ int prune_jobs(UAContext *ua, CLIENT *client, int JobType) } /* Count Files to be deleted */ - strcpy(query, "SELECT count(*) FROM DelCandidates"); + strcpy(query, cnt_DelCand); Dmsg1(100, "select sql=%s\n", query); if (!db_sql_query(ua->db, query, count_handler, (void *)&cnt)) { if (ua->verbose) { @@ -481,8 +417,7 @@ int prune_jobs(UAContext *ua, CLIENT *client, int JobType) if (cnt.count == 0) { if (ua->verbose) { - bsendmsg(ua, _("No Jobs found for client %s to prune from %s catalog.\n"), - client->hdr.name, client->catalog->hdr.name); + bsendmsg(ua, _("No Jobs found to prune.\n")); } goto bail_out; } @@ -517,16 +452,16 @@ int prune_jobs(UAContext *ua, CLIENT *client, int JobType) for (i=0; i < del.num_ids; i++) { Dmsg1(050, "Delete JobId=%d\n", del.JobId[i]); if (!del.PurgedFiles[i]) { - Mmsg(&query, "DELETE FROM File WHERE JobId=%d", del.JobId[i]); + Mmsg(&query, del_File, del.JobId[i]); db_sql_query(ua->db, query, NULL, (void *)NULL); Dmsg1(050, "Del sql=%s\n", query); } - Mmsg(&query, "DELETE FROM Job WHERE JobId=%d", del.JobId[i]); + Mmsg(&query, del_Job, del.JobId[i]); db_sql_query(ua->db, query, NULL, (void *)NULL); Dmsg1(050, "Del sql=%s\n", query); - Mmsg(&query, "DELETE FROM JobMedia WHERE JobId=%d", del.JobId[i]); + Mmsg(&query, del_JobMedia, del.JobId[i]); db_sql_query(ua->db, query, NULL, (void *)NULL); Dmsg1(050, "Del sql=%s\n", query); } @@ -562,7 +497,7 @@ int prune_volume(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr) memset(&jr, 0, sizeof(jr)); memset(&del, 0, sizeof(del)); cnt.count = 0; - Mmsg(&query, "SELECT count(*) FROM JobMedia WHERE MediaId=%d", mr->MediaId); + Mmsg(&query, cnt_JobMedia, mr->MediaId); if (!db_sql_query(ua->db, query, count_handler, (void *)&cnt)) { bsendmsg(ua, "%s", db_strerror(ua->db)); Dmsg0(050, "Count failed\n"); @@ -587,7 +522,7 @@ int prune_volume(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr) del.JobId = (JobId_t *)malloc(sizeof(JobId_t) * del.max_ids); /* ***FIXME*** could make this do JobTDate check too */ - Mmsg(&query, "SELECT JobId FROM JobMedia WHERE MediaId=%d", mr->MediaId); + Mmsg(&query, sel_JobMedia, mr->MediaId); if (!db_sql_query(ua->db, query, file_delete_handler, (void *)&del)) { if (ua->verbose) { bsendmsg(ua, "%s", db_strerror(ua->db)); @@ -612,11 +547,11 @@ int prune_volume(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr) continue; } Dmsg2(200, "Delete JobId=%d Job=%s\n", del.JobId[i], jr.Job); - Mmsg(&query, "DELETE FROM File WHERE JobId=%d", del.JobId[i]); + Mmsg(&query, del_File, del.JobId[i]); db_sql_query(ua->db, query, NULL, (void *)NULL); - Mmsg(&query, "DELETE FROM Job WHERE JobId=%d", del.JobId[i]); + Mmsg(&query, del_Job, del.JobId[i]); db_sql_query(ua->db, query, NULL, (void *)NULL); - Mmsg(&query, "DELETE FROM JobMedia WHERE JobId=%d", del.JobId[i]); + Mmsg(&query, del_JobMedia, del.JobId[i]); db_sql_query(ua->db, query, NULL, (void *)NULL); Dmsg1(050, "Del sql=%s\n", query); del.num_del++; diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c new file mode 100644 index 0000000000..f45832be4f --- /dev/null +++ b/bacula/src/dird/ua_restore.c @@ -0,0 +1,614 @@ +/* + * + * Bacula Director -- User Agent Database restore Command + * Creates a bootstrap file for restoring files + * + * Kern Sibbald, July MMII + * + * Version $Id$ + */ + +/* + Copyright (C) 2002 Kern Sibbald and John Walker + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. + + */ + +#include "bacula.h" +#include "dird.h" +#include "ua.h" +#include + + + +/* Imported functions */ +extern char *uar_list_jobs; +extern char *uar_file; +extern char *uar_sel_files; + +/* Context for insert_tree_handler() */ +typedef struct s_tree_ctx { + TREE_ROOT *root; /* root */ + TREE_NODE *node; /* current node */ + TREE_NODE *avail_node; /* unused node last insert */ + int cnt; /* count for user feedback */ + UAContext *ua; +} TREE_CTX; + + +/* FileIndex entry in bootstrap record */ +typedef struct s_rbsr_findex { + struct s_rbsr_findex *next; + int32_t findex; + int32_t findex2; +} RBSR_FINDEX; + +/* Restore bootstrap record -- not the real one, but useful here */ +typedef struct s_rbsr { + struct s_rbsr *next; /* next JobId */ + uint32_t JobId; /* JobId this bsr */ + uint32_t VolSessionId; + uint32_t VolSessionTime; + char *VolumeName; /* Volume name */ + RBSR_FINDEX *fi; /* File indexes this JobId */ +} RBSR; + +/* Forward referenced functions */ +static RBSR *new_bsr(); +static void free_bsr(RBSR *bsr); +static void print_bsr(UAContext *ua, RBSR *bsr); +static int complete_bsr(UAContext *ua, RBSR *bsr); +static int insert_tree_handler(void *ctx, int num_fields, char **row); +static void add_findex(RBSR *bsr, uint32_t JobId, int32_t findex); +static void user_select_files(TREE_CTX *tree); + + + +/* + * Restore files + * + */ +int restorecmd(UAContext *ua, char *cmd) +{ + POOLMEM *query; + int JobId, done = 0; + TREE_CTX tree; + RBSR *bsr; + char *nofname = ""; + JOB_DBR jr; + char *list[] = { + "List last Jobs run", + "Enter list of JobIds", + "Enter SQL list command", + "Select a File", + "Cancel", + NULL }; + + if (!open_db(ua)) { + return 0; + } + + memset(&tree, 0, sizeof(TREE_CTX)); + + for ( ; !done; ) { + start_prompt(ua, _("To narrow down the restore, you have the following choices:\n")); + for (int i=0; list[i]; i++) { + add_prompt(ua, list[i]); + } + done = 1; + switch (do_prompt(ua, "Select item: ", NULL)) { + case -1: + return 0; + case 0: + db_list_sql_query(ua->db, uar_list_jobs, prtit, ua, 1); + if (!get_cmd(ua, _("Enter JobId to select files for restore: "))) { + return 0; + } + if (!is_a_number(ua->cmd)) { + bsendmsg(ua, _("Bad JobId entered.\n")); + return 0; + } + JobId = atoi(ua->cmd); + break; + + case 1: + if (!get_cmd(ua, _("Enter JobIds: "))) { + return 0; + } + JobId = atoi(ua->cmd); + break; + case 2: + if (!get_cmd(ua, _("Enter SQL list command: "))) { + return 0; + } + db_list_sql_query(ua->db, ua->cmd, prtit, ua, 1); + done = 0; + break; + case 3: + if (!get_cmd(ua, _("Enter Filename: "))) { + return 0; + } + query = get_pool_memory(PM_MESSAGE); + Mmsg(&query, uar_file, ua->cmd); + db_list_sql_query(ua->db, query, prtit, ua, 1); + free_pool_memory(query); + if (!get_cmd(ua, _("Enter JobId to select files for restore: "))) { + return 0; + } + if (!is_a_number(ua->cmd)) { + bsendmsg(ua, _("Bad JobId entered.\n")); + return 0; + } + JobId = atoi(ua->cmd); + break; + case 4: + return 0; + } + } + + memset(&jr, 0, sizeof(JOB_DBR)); + jr.JobId = JobId; + if (!db_get_job_record(ua->db, &jr)) { + bsendmsg(ua, _("Unable to get Job record. ERR=%s\n"), db_strerror(ua->db)); + return 0; + } + + /* + * Build the directory tree + */ + bsendmsg(ua, _("Building directory tree of backed up files ...\n")); + memset(&tree, 0, sizeof(tree)); + tree.root = new_tree(jr.JobFiles); + tree.root->fname = nofname; + tree.ua = ua; + query = get_pool_memory(PM_MESSAGE); + Mmsg(&query, uar_sel_files, JobId); + if (!db_sql_query(ua->db, query, insert_tree_handler, (void *)&tree)) { + bsendmsg(ua, "%s", db_strerror(ua->db)); + } + free_pool_memory(query); + + /* Let the user select which files to restore */ + user_select_files(&tree); + + /* + * Walk down through the tree finding all files marked to be + * extracted making a bootstrap file. + */ + bsr = new_bsr(); + for (TREE_NODE *node=first_tree_node(tree.root); node; node=next_tree_node(node)) { + Dmsg2(400, "FI=%d node=0x%x\n", node->FileIndex, node); + if (node->extract) { + Dmsg2(400, "type=%d FI=%d\n", node->type, node->FileIndex); + add_findex(bsr, node->JobId, node->FileIndex); + } + } + + free_tree(tree.root); /* free the directory tree */ + + if (bsr->JobId) { + complete_bsr(ua, bsr); + print_bsr(ua, bsr); + } else { + bsendmsg(ua, _("No files selected to restore.\n")); + } + free_bsr(bsr); + + bsendmsg(ua, _("Restore command done.\n")); + return 1; +} + + + +/* Forward referenced commands */ + +static int addcmd(UAContext *ua, TREE_CTX *tree); +static int lscmd(UAContext *ua, TREE_CTX *tree); +static int helpcmd(UAContext *ua, TREE_CTX *tree); +static int cdcmd(UAContext *ua, TREE_CTX *tree); +static int pwdcmd(UAContext *ua, TREE_CTX *tree); +static int rmcmd(UAContext *ua, TREE_CTX *tree); +static int quitcmd(UAContext *ua, TREE_CTX *tree); + + +struct cmdstruct { char *key; int (*func)(UAContext *ua, TREE_CTX *tree); char *help; }; +static struct cmdstruct commands[] = { + { N_("add"), addcmd, _("add file")}, + { N_("ls"), lscmd, _("list current directory")}, + { N_("dir"), lscmd, _("list current directory")}, + { N_("help"), helpcmd, _("print help")}, + { N_("cd"), cdcmd, _("change directory")}, + { N_("pwd"), pwdcmd, _("print directory")}, + { N_("rm"), rmcmd, _("remove a file")}, + { N_("remove"), rmcmd, _("remove a file")}, + { N_("done"), quitcmd, _("quit")}, + { N_("exit"), quitcmd, _("exit = quit")}, + { N_("?"), helpcmd, _("print help")}, + }; +#define comsize (sizeof(commands)/sizeof(struct cmdstruct)) + + +/* + * Enter a prompt mode where the user can select/deselect + * files to be restored. This is sort of like a mini-shell + * that allows "cd", "pwd", "add", "rm", ... + */ +static void user_select_files(TREE_CTX *tree) +{ + char cwd[2000]; + /* + * Enter interactive command handler allowing selection + * of individual files. + */ + tree->node = (TREE_NODE *)tree->root; + tree_getpath(tree->node, cwd, sizeof(cwd)); + bsendmsg(tree->ua, _("cwd is: %s\n"), cwd); + for ( ;; ) { + int found, len, stat, i; + if (!get_cmd(tree->ua, "$ ")) { + break; + } + parse_command_args(tree->ua); + if (tree->ua->argc == 0) { + return; + } + + len = strlen(tree->ua->argk[0]); + found = 0; + for (i=0; i<(int)comsize; i++) /* search for command */ + if (strncasecmp(tree->ua->argk[0], _(commands[i].key), len) == 0) { + stat = (*commands[i].func)(tree->ua, tree); /* go execute command */ + found = 1; + break; + } + if (!found) { + bsendmsg(tree->ua, _("Illegal command\n")); + } + if (!stat) { + break; + } + } +} + + +static RBSR_FINDEX *new_findex() +{ + RBSR_FINDEX *fi = (RBSR_FINDEX *)malloc(sizeof(RBSR_FINDEX)); + memset(fi, 0, sizeof(RBSR_FINDEX)); + return fi; +} + +static void free_findex(RBSR_FINDEX *fi) +{ + if (fi) { + free_findex(fi->next); + free(fi); + } +} + +static void print_findex(UAContext *ua, RBSR_FINDEX *fi) +{ + if (fi) { + if (fi->findex == fi->findex2) { + bsendmsg(ua, "FileIndex=%d\n", fi->findex); + } else { + bsendmsg(ua, "FileIndex=%d-%d\n", fi->findex, fi->findex2); + } + print_findex(ua, fi->next); + } +} + +static RBSR *new_bsr() +{ + RBSR *bsr = (RBSR *)malloc(sizeof(RBSR)); + memset(bsr, 0, sizeof(RBSR)); + return bsr; +} + +static void free_bsr(RBSR *bsr) +{ + if (bsr) { + free_findex(bsr->fi); + free_bsr(bsr->next); + if (bsr->VolumeName) { + free(bsr->VolumeName); + } + free(bsr); + } +} + +/* + * Complete the BSR by filling in the VolumeName and + * VolSessionId and VolSessionTime + */ +static int complete_bsr(UAContext *ua, RBSR *bsr) +{ + JOB_DBR jr; + char VolumeNames[1000]; /* ****FIXME**** */ + + if (bsr) { + memset(&jr, 0, sizeof(jr)); + jr.JobId = bsr->JobId; + if (!db_get_job_record(ua->db, &jr)) { + bsendmsg(ua, _("Unable to get Job record. ERR=%s\n"), db_strerror(ua->db)); + return 0; + } + bsr->VolSessionId = jr.VolSessionId; + bsr->VolSessionTime = jr.VolSessionTime; + if (!db_get_job_volume_names(ua->db, bsr->JobId, VolumeNames)) { + bsendmsg(ua, _("Unable to get Job Volumes. ERR=%s\n"), db_strerror(ua->db)); + return 0; + } + bsr->VolumeName = bstrdup(VolumeNames); + return complete_bsr(ua, bsr->next); + } + return 1; +} + + +static void print_bsr(UAContext *ua, RBSR *bsr) +{ + if (bsr) { + if (bsr->VolumeName) { + bsendmsg(ua, "VolumeName=%s\n", bsr->VolumeName); + } +// bsendmsg(ua, "JobId=%u\n", bsr->JobId); + bsendmsg(ua, "VolSessionId=%u\n", bsr->VolSessionId); + bsendmsg(ua, "VolSessionTime=%u\n", bsr->VolSessionTime); + print_findex(ua, bsr->fi); + print_bsr(ua, bsr->next); + } +} + + +/* + * Add a FileIndex to the list of BootStrap records. + * Here we are only dealing with JobId's and the FileIndexes + * associated with those JobIds. + */ +static void add_findex(RBSR *bsr, uint32_t JobId, int32_t findex) +{ + RBSR *nbsr; + RBSR_FINDEX *fi, *lfi; + + if (findex == 0) { + return; /* probably a dummy directory */ + } + + if (!bsr->fi) { /* if no FI add one */ + /* This is the first FileIndex item in the chain */ + bsr->fi = new_findex(); + bsr->JobId = JobId; + bsr->fi->findex = findex; + bsr->fi->findex2 = findex; + return; + } + /* Walk down list of bsrs until we find the JobId */ + if (bsr->JobId != JobId) { + for (nbsr=bsr->next; nbsr; nbsr=nbsr->next) { + if (nbsr->JobId == JobId) { + bsr = nbsr; + break; + } + } + + if (!nbsr) { /* Must add new JobId */ + /* Add new JobId at end of chain */ + for (nbsr=bsr; nbsr->next; nbsr=nbsr->next) + { } + nbsr->next = new_bsr(); + nbsr->next->JobId = JobId; + nbsr->next->fi = new_findex(); + nbsr->next->fi->findex = findex; + nbsr->next->fi->findex2 = findex; + return; + } + } + + /* + * At this point, bsr points to bsr containing JobId, + * and we are sure that there is at least one fi record. + */ + lfi = fi = bsr->fi; + /* Check if this findex is smaller than first item */ + if (findex < fi->findex) { + if ((findex+1) == fi->findex) { + fi->findex = findex; /* extend down */ + return; + } + fi = new_findex(); /* yes, insert before first item */ + fi->findex = findex; + fi->findex2 = findex; + fi->next = lfi; + bsr->fi = fi; + return; + } + /* Walk down fi chain and find where to insert insert new FileIndex */ + for ( ; fi; fi=fi->next) { + if (findex == (fi->findex2 + 1)) { /* extend up */ + RBSR_FINDEX *nfi; + fi->findex2 = findex; + if (fi->next && ((findex+1) == fi->next->findex)) { + Dmsg1(400, "Coallase %d\n", findex); + nfi = fi->next; + fi->findex2 = nfi->findex2; + fi->next = nfi->next; + free(nfi); + } + return; + } + if (findex < fi->findex) { /* add before */ + if ((findex+1) == fi->findex) { + fi->findex = findex; + return; + } + break; + } + lfi = fi; + } + /* Add to last place found */ + fi = new_findex(); + fi->findex = findex; + fi->findex2 = findex; + fi->next = lfi->next; + lfi->next = fi; + return; +} + +static int insert_tree_handler(void *ctx, int num_fields, char **row) +{ + TREE_CTX *tree = (TREE_CTX *)ctx; + char fname[2000]; + TREE_NODE *node, *new_node; + int type; + + strip_trailing_junk(row[1]); + if (*row[1] == 0) { + type = TN_DIR; + } else { + type = TN_FILE; + } + sprintf(fname, "%s%s", row[0], row[1]); + if (tree->avail_node) { + node = tree->avail_node; + } else { + node = new_tree_node(tree->root, type); + tree->avail_node = node; + } + Dmsg2(400, "FI=%d fname=%s\n", node->FileIndex, fname); + new_node = insert_tree_node(fname, node, tree->root, NULL); + /* Note, if node already exists, save new one for next time */ + if (new_node != node) { + tree->avail_node = node; + } else { + tree->avail_node = NULL; + } + new_node->FileIndex = atoi(row[2]); + new_node->JobId = atoi(row[3]); + new_node->type = type; + if (((tree->cnt) % 10000) == 0) { + bsendmsg(tree->ua, "%d ", tree->cnt); + } + tree->cnt++; + return 0; +} + + +/* + * Set extract to value passed. We recursively walk + * down the tree setting all children. + */ +static void set_extract(TREE_NODE *node, int value) +{ + TREE_NODE *n; + + node->extract = value; + if (node->type != TN_FILE) { + for (n=node->child; n; n=n->sibling) { + set_extract(n, value); + } + } +} + +static int addcmd(UAContext *ua, TREE_CTX *tree) +{ + TREE_NODE *node; + + if (ua->argc < 2) + return 1; + if (!tree->node->child) { + return 1; + } + for (node = tree->node->child; node; node=node->sibling) { + if (fnmatch(ua->argk[1], node->fname, 0) == 0) { + set_extract(node, 1); + } + } + return 1; +} + +static int lscmd(UAContext *ua, TREE_CTX *tree) +{ + TREE_NODE *node; + + if (!tree->node->child) { + return 1; + } + for (node = tree->node->child; node; node=node->sibling) { + if (ua->argc == 1 || fnmatch(ua->argk[1], node->fname, 0) == 0) { + bsendmsg(ua, "%s%s%s\n", node->extract?"*":"", node->fname, + (node->type==TN_DIR||node->type==TN_NEWDIR)?"/":""); + } + } + return 1; +} + +static int helpcmd(UAContext *ua, TREE_CTX *tree) +{ + unsigned int i; + +/* usage(); */ + bsendmsg(ua, _(" Command Description\n ======= ===========\n")); + for (i=0; iargc != 2) { + return 1; + } + tree->node = tree_cwd(ua->argk[1], tree->root, tree->node); + tree_getpath(tree->node, cwd, sizeof(cwd)); + bsendmsg(ua, _("cwd is: %s\n"), cwd); + return 1; +} + +static int pwdcmd(UAContext *ua, TREE_CTX *tree) +{ + char cwd[2000]; + tree_getpath(tree->node, cwd, sizeof(cwd)); + bsendmsg(ua, _("cwd is: %s\n"), cwd); + return 1; +} + + +static int rmcmd(UAContext *ua, TREE_CTX *tree) +{ + TREE_NODE *node; + + if (ua->argc < 2) + return 1; + if (!tree->node->child) { + return 1; + } + for (node = tree->node->child; node; node=node->sibling) { + if (fnmatch(ua->argk[1], node->fname, 0) == 0) { + set_extract(node, 0); + } + } + return 1; +} + +static int quitcmd(UAContext *ua, TREE_CTX *tree) +{ + return 0; +} diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 01864faafc..594f9f0793 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -215,6 +215,19 @@ try_again: Dmsg1(20, "JobType=%c\n", jcr->JobType); switch (jcr->JobType) { char ec1[30]; + case JT_ADMIN: + bsendmsg(ua, _("Run %s job\n\ +JobName: %s\n\ +FileSet: %s\n\ +Client: %s\n\ +Storage: %s\n"), + _("Admin"), + job->hdr.name, + jcr->fileset->hdr.name, + NPRT(jcr->client->hdr.name), + NPRT(jcr->store->hdr.name)); + break; + break; case JT_BACKUP: case JT_VERIFY: if (level_name) { diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c index db1477e802..7948f143b3 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -327,8 +327,10 @@ int select_pool_dbr(UAContext *ua, POOL_DBR *pr) */ int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr) { - int found = FALSE; int i; + static char *kw[] = { + N_("volume"), + NULL}; memset(pr, 0, sizeof(POOL_DBR)); memset(mr, 0, sizeof(MEDIA_DBR)); @@ -339,23 +341,22 @@ int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr) } mr->PoolId = pr->PoolId; - /* See if a volume name is specified as an argument */ - for (i=1; iargc; i++) { - if (strcasecmp(ua->argk[i], _("volume")) == 0 && ua->argv[i]) { - found = TRUE; - break; - } - } - if (found) { + i = find_arg_keyword(ua, kw); + if (i == 0 && ua->argv[i]) { strcpy(mr->VolumeName, ua->argv[i]); - } else { + } + if (mr->VolumeName[0] == 0) { db_list_media_records(ua->db, mr, prtit, ua); - if (!get_cmd(ua, _("Enter the Volume name: "))) { - return 01; + if (!get_cmd(ua, _("Enter MediaId or Volume name to update: "))) { + return 0; + } + if (is_a_number(ua->cmd)) { + mr->MediaId = atoi(ua->cmd); + } else { + strcpy(mr->VolumeName, ua->cmd); } - strcpy(mr->VolumeName, ua->cmd); } - mr->MediaId = 0; + if (!db_get_media_record(ua->db, mr)) { bsendmsg(ua, "%s", db_strerror(ua->db)); return 0; diff --git a/bacula/src/lib/smartall.c b/bacula/src/lib/smartall.c index c5596e5d2c..a3931d4160 100644 --- a/bacula/src/lib/smartall.c +++ b/bacula/src/lib/smartall.c @@ -221,6 +221,7 @@ void *sm_realloc(char *fname, int lineno, void *ptr, unsigned int size) void *buf; char *cp = (char *) ptr; + Dmsg4(400, "sm_realloc %s:%d 0x%x %d\n", fname, lineno, ptr, size); sm_check(fname, lineno, True); if (size <= 0) { e_msg(fname, lineno, M_ABORT, 0, "sm_realloc size: %d\n", size); @@ -292,6 +293,7 @@ void *actuallycalloc(unsigned int nelem, unsigned int elsize) void *actuallyrealloc(void *ptr, unsigned int size) { + Dmsg2(400, "Actuallyrealloc 0x%x %d\n", ptr, size); return realloc(ptr, size); } diff --git a/bacula/src/lib/tree.c b/bacula/src/lib/tree.c index 05ff49a73e..163198259f 100755 --- a/bacula/src/lib/tree.c +++ b/bacula/src/lib/tree.c @@ -33,76 +33,202 @@ #define MAXPATHLEN 1000 #endif -TREE_NODE *new_tree_node(int type) +/* + * This subrouting gets a big buffer. + */ +static void malloc_buf(TREE_ROOT *root, int size) +{ + struct s_mem *mem; + + mem = (struct s_mem *)malloc(size); + mem->next = root->mem; + root->mem = mem; + mem->mem = mem->first; + mem->rem = (char *)mem + size - mem->mem; + Dmsg2(400, "malloc buf size=%d rem=%d\n", size, mem->rem); +} + + +/* + * Note, we allocate a big buffer in the tree root + * from which we allocate nodes. This runs more + * than 100 times as fast as directly using malloc() + * for each of the nodes. + */ +TREE_ROOT *new_tree(int count) +{ + TREE_ROOT *root; + uint32_t size; + + root = (TREE_ROOT *)malloc(sizeof(TREE_ROOT)); + memset(root, 0, sizeof(TREE_ROOT)); + root->type = TN_ROOT; + /* Assume filename = 20 characters average length */ + size = count * (BALIGN(sizeof(TREE_NODE)) + 20); + if (size > 10000000) { + size = 10000000; + } + Dmsg2(400, "count=%d size=%d\n", count, size); + malloc_buf(root, size); + return root; +} + +/* + * Create a new tree node. Size depends on type. + */ +TREE_NODE *new_tree_node(TREE_ROOT *root, int type) { TREE_NODE *node; - int size; + int size = BALIGN(sizeof(TREE_NODE)); - if (type == TN_ROOT) { - size = sizeof(TREE_ROOT); - } else { - size = sizeof(TREE_NODE); + if (root->mem->rem < size) { + malloc_buf(root, 20000); } - node = (TREE_NODE *)malloc(size); - memset(node, 0, size); + + root->mem->rem -= size; + node = (TREE_NODE *)root->mem->mem; + root->mem->mem += size; + memset(node, 0, sizeof(TREE_NODE)); node->type = type; return node; } + +/* + * Allocate bytes for filename in tree structure. + * Keep the pointers properly aligned by allocating + * sizes that are aligned. + */ +static char *tree_alloc(TREE_ROOT *root, int size) +{ + char *buf; + int asize = BALIGN(size); + + if (root->mem->rem < asize) { + malloc_buf(root, 20000+asize); + } + root->mem->rem -= asize; + buf = root->mem->mem; + root->mem->mem += asize; + return buf; +} + + +/* This routine frees the whole tree */ +void free_tree(TREE_ROOT *root) +{ + struct s_mem *mem, *rel; + + for (mem=root->mem; mem; ) { + rel = mem; + mem = mem->next; + free(rel); + } + free(root); + return; +} + + + +/* + * Insert a node in the tree + * + */ TREE_NODE *insert_tree_node(char *path, TREE_NODE *node, TREE_ROOT *root, TREE_NODE *parent) { - char *p, *fname; + TREE_NODE *sibling; + char *p, *q, *fname; + int len = strlen(path); Dmsg1(100, "insert_tree_node: %s\n", path); - p = strrchr(path, '/'); - if (!p) { - Dmsg1(000, "No / found: %s\n", path); - exit(1); + /* + * If trailing slash, strip it + */ + if (len > 0) { + q = path + len - 1; + if (*q == '/') { + *q = 0; /* strip trailing slash */ + } else { + q = NULL; /* no trailing slash */ + } + } else { + q = NULL; /* no trailing slash */ } - *p = 0; - fname = p + 1; - if (!parent) { - parent = make_tree_path(path, root); + p = strrchr(path, '/'); /* separate path and filename */ + if (p) { + fname = p + 1; + if (!parent) { + *p = 0; /* terminate path */ + Dmsg1(100, "make_tree_path for %s\n", path); + parent = make_tree_path(path, root); + Dmsg1(100, "parent=%s\n", parent->fname); + *p = '/'; /* restore full name */ + } + } else { + fname = path; + if (!parent) { + parent = (TREE_NODE *)root; + } + Dmsg1(100, "No / found: %s\n", path); + } + + for (sibling=parent->child; sibling; sibling=sibling->sibling) { + Dmsg2(100, "sibling->fname=%s fname=%s\n", sibling->fname, fname); + if (strcmp(sibling->fname, fname) == 0) { + Dmsg1(100, "make_tree_path: found parent=%s\n", parent->fname); + if (q) { /* if trailing slash on entry */ + *q = '/'; /* restore it */ + } + return sibling; + } } - *p = '/'; + + append_tree_node(fname, node, root, parent); Dmsg1(100, "insert_tree_node: parent=%s\n", parent->fname); - return parent; + if (q) { /* if trailing slash on entry */ + *q = '/'; /* restore it */ + } + return node; } +/* + * Ensure that all appropriate nodes for a full path exist in + * the tree. + */ TREE_NODE *make_tree_path(char *path, TREE_ROOT *root) { - TREE_NODE *parent, *sibling; + TREE_NODE *parent, *sibling, *node; char *fname, *p; Dmsg1(100, "make_tree_path: %s\n", path); - if (!*path) { + if (*path == 0) { Dmsg0(100, "make_tree_path: parent=*root*\n"); return (TREE_NODE *)root; } - p = strrchr(path, '/'); - if (!p) { - Dmsg1(000, "No / found: %s\n", path); - exit(1); + p = strrchr(path, '/'); /* separate path and filename */ + if (p) { + fname = p + 1; + *p = 0; /* terminate path */ + parent = make_tree_path(path, root); + *p = '/'; /* restore full name */ + } else { + fname = path; + parent = (TREE_NODE *)root; } - *p = 0; - fname = p + 1; - /* Find parent */ - parent = make_tree_path(path, root); - *p = '/'; /* Is it already a sibling? */ - for (sibling=parent->sibling; sibling; sibling=sibling->sibling) { + for (sibling=parent->child; sibling; sibling=sibling->sibling) { + Dmsg2(100, "sibling->fname=%s fname=%s\n", sibling->fname, fname); if (strcmp(sibling->fname, fname) == 0) { Dmsg1(100, "make_tree_path: found parent=%s\n", parent->fname); - return parent; + return sibling; } } /* Must add */ - sibling = new_tree_node(TN_NEWDIR); - append_tree_node(fname, sibling, root, parent); - parent = sibling; - Dmsg1(100, "make_tree_path: add parent=%s\n", parent->fname); - return parent; + node = new_tree_node(root, TN_NEWDIR); + append_tree_node(fname, node, root, parent); + Dmsg1(100, "make_tree_path: add parent=%s\n", node->fname); + return node; } /* @@ -113,16 +239,19 @@ void append_tree_node(char *fname, TREE_NODE *node, TREE_ROOT *root, TREE_NODE * TREE_NODE *child; Dmsg1(100, "append_tree_node: %s\n", fname); - node->fname = bstrdup(fname); + node->fname = tree_alloc(root, strlen(fname) + 1); + strcpy(node->fname, fname); node->parent = parent; if (!parent->child) { parent->child = node; goto item_link; } + /* Append to end of sibling chain */ for (child=parent->child; child->sibling; child=child->sibling) { } child->sibling = node; + /* Maintain a linear chain of nodes */ item_link: if (!root->first) { root->first = node; @@ -186,29 +315,6 @@ void print_tree(char *path, TREE_NODE *tree) return; } -void free_tree(TREE_NODE *node) -{ - if (!node) { - return; - } - switch (node->type) { - case TN_FILE: - break; - case TN_DIR: - case TN_ROOT: - case TN_NEWDIR: - free_tree(node->child); - break; - default: - Dmsg1(000, "Unknown node type %d\n", node->type); - break; - } - free_tree(node->sibling); - free(node->fname); - free(node); - return; -} - int tree_getpath(TREE_NODE *node, char *buf, int buf_size) { if (!node) { @@ -267,7 +373,6 @@ TREE_NODE *tree_relcwd(char *path, TREE_ROOT *root, TREE_NODE *node) } } if (!cd || cd->type == TN_FILE) { - Dmsg1(100, "tree_relcwd: failed %s is a file.\n", cd->fname); return NULL; } if (!p) { @@ -294,8 +399,9 @@ int main(int argc, char *argv[]) TREE_NODE *node; char buf[MAXPATHLEN]; - root = (TREE_ROOT *)new_tree_node(TN_ROOT); - root->fname = bstrdup(""); + root = new_tree(); + root->fname = tree_alloc(root, 1); + *root->fname = 0; FillDirectoryTree("/home/kern/bacula/k", root, NULL); @@ -375,7 +481,7 @@ void FillDirectoryTree(char *path, TREE_ROOT *root, TREE_NODE *parent) } Dmsg2(100, "Doing: %d %s\n", type, pathbuf); - node = new_tree_node(type); + node = new_tree_node(root, type); node->FileIndex = ++FileIndex; parent = insert_tree_node(pathbuf, node, root, parent); if (S_ISDIR(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode)) { diff --git a/bacula/src/lib/tree.h b/bacula/src/lib/tree.h index cbc80c188b..9c7db8c734 100644 --- a/bacula/src/lib/tree.h +++ b/bacula/src/lib/tree.h @@ -24,10 +24,19 @@ */ +struct s_mem { + struct s_mem *next; /* next buffer */ + int rem; /* remaining bytes */ + char *mem; /* memory pointer */ + char first[]; /* first byte */ +}; + struct s_tree_node { char *fname; /* file name */ uint32_t FileIndex; /* file index */ - int type; /* node type */ + uint32_t JobId; /* JobId */ + short type; /* node type */ + short extract; /* set if extracting */ struct s_tree_node *parent; struct s_tree_node *sibling; struct s_tree_node *child; @@ -38,7 +47,9 @@ typedef struct s_tree_node TREE_NODE; struct s_tree_root { char *fname; /* file name */ uint32_t FileIndex; /* file index */ - int type; /* node type */ + uint32_t JobId; /* JobId */ + short type; /* node type */ + short extract; /* set if extracting */ struct s_tree_node *parent; struct s_tree_node *sibling; struct s_tree_node *child; @@ -47,6 +58,7 @@ struct s_tree_root { /* The above ^^^ must be identical to a TREE_NODE structure */ struct s_tree_node *first; /* first entry in the tree */ struct s_tree_node *last; /* last entry in tree */ + struct s_mem *mem; /* tree memory */ }; typedef struct s_tree_root TREE_ROOT; @@ -56,7 +68,8 @@ typedef struct s_tree_root TREE_ROOT; #define TN_DIR 3 /* directory entry */ #define TN_FILE 4 /* file entry */ -TREE_NODE *new_tree_node(int type); +TREE_ROOT *new_tree(int count); +TREE_NODE *new_tree_node(TREE_ROOT *root, int type); TREE_NODE *insert_tree_node(char *path, TREE_NODE *node, TREE_ROOT *root, TREE_NODE *parent); TREE_NODE *make_tree_path(char *path, TREE_ROOT *root); TREE_NODE *first_tree_node(TREE_ROOT *root); @@ -65,6 +78,5 @@ TREE_NODE *tree_cwd(char *path, TREE_ROOT *root, TREE_NODE *node); TREE_NODE *tree_relcwd(char *path, TREE_ROOT *root, TREE_NODE *node); void append_tree_node(char *fname, TREE_NODE *node, TREE_ROOT *root, TREE_NODE *parent); void print_tree(char *path, TREE_NODE *root); -void free_tree(TREE_NODE *node); +void free_tree(TREE_ROOT *root); int tree_getpath(TREE_NODE *node, char *buf, int buf_size); - diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c index 225b9cf86e..b76f77b1db 100644 --- a/bacula/src/stored/append.c +++ b/bacula/src/stored/append.c @@ -56,6 +56,7 @@ int do_append_data(JCR *jcr) sm_check(__FILE__, __LINE__, False); +// jcr->spool_attributes = 1; if (!jcr->no_attributes && jcr->spool_attributes) { open_spool_file(jcr, jcr->dir_bsock); } diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 61351ae117..7e1de01163 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -326,12 +326,13 @@ int write_block_to_dev(DEVICE *dev, DEV_BLOCK *block) dev->state |= ST_EOF | ST_EOT | ST_WEOT; clrerror_dev(dev, -1); - Dmsg2(0, "=== Write error %d: ERR=%s\n", dev->dev_errno, - strerror(dev->dev_errno)); - if (dev->dev_errno == 0) { dev->dev_errno = ENOSPC; /* out of space */ } + + Dmsg2(0, "=== Write error errno=%d: ERR=%s\n", dev->dev_errno, + strerror(dev->dev_errno)); + Mmsg2(&dev->errmsg, _("Write error on device %s. ERR=%s.\n"), dev->dev_name, strerror(dev->dev_errno)); block->failed_write = TRUE; diff --git a/bacula/src/stored/match_bsr.c b/bacula/src/stored/match_bsr.c index ad869bdffe..b7e331d7f0 100755 --- a/bacula/src/stored/match_bsr.c +++ b/bacula/src/stored/match_bsr.c @@ -30,6 +30,7 @@ #include "bacula.h" #include "stored.h" +#include /* Forward references */ static int match_sesstime(BSR_SESSTIME *sesstime, DEV_RECORD *rec); @@ -103,7 +104,7 @@ static int match_client(BSR_CLIENT *client, SESSION_LABEL *sessrec) if (!client) { return 1; /* no specification matches all */ } - if (strcmp(client->ClientName, sessrec->ClientName) == 0) { + if (fnmatch(client->ClientName, sessrec->ClientName, 0) == 0) { return 1; } if (client->next) { @@ -117,7 +118,7 @@ static int match_job(BSR_JOB *job, SESSION_LABEL *sessrec) if (!job) { return 1; /* no specification matches all */ } - if (strcmp(job->Job, sessrec->Job) == 0) { + if (fnmatch(job->Job, sessrec->Job, 0) == 0) { job->found++; return 1; } diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c index 5a7111d574..36a54278a9 100644 --- a/bacula/src/stored/stored_conf.c +++ b/bacula/src/stored/stored_conf.c @@ -98,7 +98,7 @@ static struct res_items dev_items[] = { {"changercommand", store_strname,ITEM(res_dev.changer_command), 0, 0, 0}, {"maximumchangerwait", store_pint, ITEM(res_dev.max_changer_wait), 0, ITEM_DEFAULT, 2 * 60}, {"maximumopenwait", store_pint, ITEM(res_dev.max_open_wait), 0, ITEM_DEFAULT, 5 * 60}, - {"offlineonunmount", store_yesno, ITEM(res_dev.cap_bits), CAP_OFFLINEUNMOUNT, ITEM_DEFAULT, 1}, + {"offlineonunmount", store_yesno, ITEM(res_dev.cap_bits), CAP_OFFLINEUNMOUNT, ITEM_DEFAULT, 0}, {"maximumrewindwait", store_pint, ITEM(res_dev.max_rewind_wait), 0, ITEM_DEFAULT, 5 * 60}, {"minimumblocksize", store_pint, ITEM(res_dev.min_block_size), 0, 0, 0}, {"maximumblocksize", store_pint, ITEM(res_dev.max_block_size), 0, 0, 0}, @@ -120,7 +120,7 @@ struct s_res resources[] = { {"storage", store_items, R_STORAGE, NULL}, {"device", dev_items, R_DEVICE, NULL}, {"messages", msgs_items, R_MSGS, NULL}, - {NULL, NULL, 0, NULL} + {NULL, NULL, 0, NULL} }; @@ -136,81 +136,81 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, char *fmt, ... return; } sendit(sock, "dump_resource type=%d\n", type); - if (type < 0) { /* no recursion */ + if (type < 0) { /* no recursion */ type = - type; recurse = 0; } switch (type) { case R_DIRECTOR: sendit(sock, "Director: name=%s\n", res->res_dir.hdr.name); - break; + break; case R_STORAGE: sendit(sock, "Storage: name=%s address=%s SDport=%d SDDport=%d\n", - res->res_store.hdr.name, res->res_store.address, - res->res_store.SDport, res->res_store.SDDport); - break; + res->res_store.hdr.name, res->res_store.address, + res->res_store.SDport, res->res_store.SDDport); + break; case R_DEVICE: sendit(sock, "Device: name=%s MediaType=%s Device=%s\n", - res->res_dev.hdr.name, - res->res_dev.media_type, res->res_dev.device_name); + res->res_dev.hdr.name, + res->res_dev.media_type, res->res_dev.device_name); sendit(sock, " rew_wait=%d min_bs=%d max_bs=%d\n", - res->res_dev.max_rewind_wait, res->res_dev.min_block_size, - res->res_dev.max_block_size); + res->res_dev.max_rewind_wait, res->res_dev.min_block_size, + res->res_dev.max_block_size); sendit(sock, " max_jobs=%d max_files=%" lld " max_size=%" lld "\n", - res->res_dev.max_volume_jobs, res->res_dev.max_volume_files, - res->res_dev.max_volume_size); + res->res_dev.max_volume_jobs, res->res_dev.max_volume_files, + res->res_dev.max_volume_size); sendit(sock, " max_file_size=%" lld " capacity=%" lld "\n", - res->res_dev.max_file_size, res->res_dev.volume_capacity); + res->res_dev.max_file_size, res->res_dev.volume_capacity); strcpy(buf, " "); - if (res->res_dev.cap_bits & CAP_EOF) { + if (res->res_dev.cap_bits & CAP_EOF) { strcat(buf, "CAP_EOF "); - } - if (res->res_dev.cap_bits & CAP_BSR) { + } + if (res->res_dev.cap_bits & CAP_BSR) { strcat(buf, "CAP_BSR "); - } - if (res->res_dev.cap_bits & CAP_BSF) { + } + if (res->res_dev.cap_bits & CAP_BSF) { strcat(buf, "CAP_BSF "); - } - if (res->res_dev.cap_bits & CAP_FSR) { + } + if (res->res_dev.cap_bits & CAP_FSR) { strcat(buf, "CAP_FSR "); - } - if (res->res_dev.cap_bits & CAP_FSF) { + } + if (res->res_dev.cap_bits & CAP_FSF) { strcat(buf, "CAP_FSF "); - } - if (res->res_dev.cap_bits & CAP_EOM) { + } + if (res->res_dev.cap_bits & CAP_EOM) { strcat(buf, "CAP_EOM "); - } - if (res->res_dev.cap_bits & CAP_REM) { + } + if (res->res_dev.cap_bits & CAP_REM) { strcat(buf, "CAP_REM "); - } - if (res->res_dev.cap_bits & CAP_RACCESS) { + } + if (res->res_dev.cap_bits & CAP_RACCESS) { strcat(buf, "CAP_RACCESS "); - } - if (res->res_dev.cap_bits & CAP_AUTOMOUNT) { + } + if (res->res_dev.cap_bits & CAP_AUTOMOUNT) { strcat(buf, "CAP_AUTOMOUNT "); - } - if (res->res_dev.cap_bits & CAP_LABEL) { + } + if (res->res_dev.cap_bits & CAP_LABEL) { strcat(buf, "CAP_LABEL "); - } - if (res->res_dev.cap_bits & CAP_ANONVOLS) { + } + if (res->res_dev.cap_bits & CAP_ANONVOLS) { strcat(buf, "CAP_ANONVOLS "); - } - if (res->res_dev.cap_bits & CAP_ALWAYSOPEN) { + } + if (res->res_dev.cap_bits & CAP_ALWAYSOPEN) { strcat(buf, "CAP_ALWAYSOPEN "); - } + } strcat(buf, "\n"); - sendit(sock, buf); - break; + sendit(sock, buf); + break; case R_MSGS: sendit(sock, "Messages: name=%s\n", res->res_msgs.hdr.name); - if (res->res_msgs.mail_cmd) + if (res->res_msgs.mail_cmd) sendit(sock, " mailcmd=%s\n", res->res_msgs.mail_cmd); - if (res->res_msgs.operator_cmd) + if (res->res_msgs.operator_cmd) sendit(sock, " opcmd=%s\n", res->res_msgs.operator_cmd); - break; + break; default: sendit(sock, _("Warning: unknown resource type %d\n"), type); - break; + break; } if (recurse && res->res_dir.hdr.next) dump_resource(type, (RES *)res->res_dir.hdr.next, sendit, sock); @@ -240,42 +240,42 @@ void free_resource(int type) switch (type) { case R_DIRECTOR: - if (res->res_dir.password) - free(res->res_dir.password); - if (res->res_dir.address) - free(res->res_dir.address); - break; + if (res->res_dir.password) + free(res->res_dir.password); + if (res->res_dir.address) + free(res->res_dir.address); + break; case R_STORAGE: - if (res->res_store.address) - free(res->res_store.address); - if (res->res_store.working_directory) - free(res->res_store.working_directory); - if (res->res_store.pid_directory) - free(res->res_store.pid_directory); - if (res->res_store.subsys_directory) - free(res->res_store.subsys_directory); - break; + if (res->res_store.address) + free(res->res_store.address); + if (res->res_store.working_directory) + free(res->res_store.working_directory); + if (res->res_store.pid_directory) + free(res->res_store.pid_directory); + if (res->res_store.subsys_directory) + free(res->res_store.subsys_directory); + break; case R_DEVICE: - if (res->res_dev.media_type) - free(res->res_dev.media_type); - if (res->res_dev.device_name) - free(res->res_dev.device_name); - if (res->res_dev.changer_name) - free(res->res_dev.changer_name); - if (res->res_dev.changer_command) - free(res->res_dev.changer_command); - break; + if (res->res_dev.media_type) + free(res->res_dev.media_type); + if (res->res_dev.device_name) + free(res->res_dev.device_name); + if (res->res_dev.changer_name) + free(res->res_dev.changer_name); + if (res->res_dev.changer_command) + free(res->res_dev.changer_command); + break; case R_MSGS: - if (res->res_msgs.mail_cmd) - free(res->res_msgs.mail_cmd); - if (res->res_msgs.operator_cmd) - free(res->res_msgs.operator_cmd); - free_msgs_res((MSGS *)res); /* free message resource */ - res = NULL; - break; + if (res->res_msgs.mail_cmd) + free(res->res_msgs.mail_cmd); + if (res->res_msgs.operator_cmd) + free(res->res_msgs.operator_cmd); + free_msgs_res((MSGS *)res); /* free message resource */ + res = NULL; + break; default: Dmsg1(0, "Unknown resource type %d\n", type); - break; + break; } /* Common stuff again -- free the resource, recurse to next one */ if (res) { @@ -303,10 +303,10 @@ void save_resource(int type, struct res_items *items, int pass) */ for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { - if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) { + if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) { Emsg2(M_ABORT, 0, _("%s item is required in %s resource, but not found.\n"), - items[i].name, resources[rindex]); - } + items[i].name, resources[rindex]); + } } /* If this triggers, take a look at lib/parse_conf.h */ if (i >= MAX_RES_ITEMS) { @@ -321,33 +321,33 @@ void save_resource(int type, struct res_items *items, int pass) */ if (pass == 2) { switch (type) { - /* Resources not containing a resource */ - case R_DIRECTOR: - case R_DEVICE: - case R_MSGS: - break; - - /* Resources containing a resource */ - case R_STORAGE: - if ((res = (URES *)GetResWithName(R_STORAGE, res_all.res_dir.hdr.name)) == NULL) { + /* Resources not containing a resource */ + case R_DIRECTOR: + case R_DEVICE: + case R_MSGS: + break; + + /* Resources containing a resource */ + case R_STORAGE: + if ((res = (URES *)GetResWithName(R_STORAGE, res_all.res_dir.hdr.name)) == NULL) { Emsg1(M_ABORT, 0, "Cannot find Storage resource %s\n", res_all.res_dir.hdr.name); - } - res->res_store.messages = res_all.res_store.messages; - break; - default: + } + res->res_store.messages = res_all.res_store.messages; + break; + default: printf("Unknown resource type %d\n", type); - error = 1; - break; + error = 1; + break; } if (res_all.res_dir.hdr.name) { - free(res_all.res_dir.hdr.name); - res_all.res_dir.hdr.name = NULL; + free(res_all.res_dir.hdr.name); + res_all.res_dir.hdr.name = NULL; } if (res_all.res_dir.hdr.desc) { - free(res_all.res_dir.hdr.desc); - res_all.res_dir.hdr.desc = NULL; + free(res_all.res_dir.hdr.desc); + res_all.res_dir.hdr.desc = NULL; } return; } @@ -355,36 +355,36 @@ void save_resource(int type, struct res_items *items, int pass) /* The following code is only executed on pass 1 */ switch (type) { case R_DIRECTOR: - size = sizeof(DIRRES); - break; + size = sizeof(DIRRES); + break; case R_STORAGE: - size = sizeof(STORES); - break; + size = sizeof(STORES); + break; case R_DEVICE: - size = sizeof(DEVRES); - break; + size = sizeof(DEVRES); + break; case R_MSGS: - size = sizeof(MSGS); - break; + size = sizeof(MSGS); + break; default: printf("Unknown resource type %d\n", type); - error = 1; - break; + error = 1; + break; } /* Common */ if (!error) { res = (URES *)malloc(size); memcpy(res, &res_all, size); if (!resources[rindex].res_head) { - resources[rindex].res_head = (RES *)res; /* store first entry */ + resources[rindex].res_head = (RES *)res; /* store first entry */ } else { - RES *next; - /* Add new res to end of chain */ - for (next=resources[rindex].res_head; next->next; next=next->next) - { } - next->next = (RES *)res; + RES *next; + /* Add new res to end of chain */ + for (next=resources[rindex].res_head; next->next; next=next->next) + { } + next->next = (RES *)res; Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type), - res->res_dir.hdr.name); + res->res_dir.hdr.name); } } } diff --git a/bacula/src/version.h b/bacula/src/version.h index acb2b81461..47140df20f 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ -#define VERSION "1.23a" +#define VERSION "1.24" #define VSTRING "1" -#define DATE "26 July 2002" -#define LSMDATE "26Jul02" +#define DATE "01 August 2002" +#define LSMDATE "01Aug02" /* Debug flags */ #define DEBUG 1