From 38406c353221d6b17ccd3e63d80c808599675d58 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 22 Mar 2004 20:14:57 +0000 Subject: [PATCH] Fix Update Volume Slot format error + documentation + termcap detection improvements git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1145 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/config.h.in | 3 -- bacula/autoconf/configure.in | 17 ++++--- bacula/configure | 93 +++++++++++++++++------------------- bacula/src/console/conio.c | 3 +- bacula/src/dird/ua_cmds.c | 2 +- bacula/src/version.h | 4 +- 6 files changed, 59 insertions(+), 63 deletions(-) diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index c645b3b2f8..58ddd8e8bf 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -475,9 +475,6 @@ /* Define to 1 if you have the `tcgetattr' function. */ #undef HAVE_TCGETATTR -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMCAP_H - /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index ddf614a4d2..96fdfa9e35 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -313,13 +313,16 @@ AC_ARG_ENABLE(conio, got_conio="no" if test x$support_conio = xyes; then - CONS_OBJ="conio.o" - CONS_SRC="conio.c" - got_conio="yes" - AC_CHECK_HEADERS(termcap.h) - AC_CHECK_LIB(termcap, tgetent, CONS_LIBS="-ltermcap") - support_readline=no - AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) + AC_CHECK_HEADER(termcap.h, + [ AC_CHECK_LIB(termcap, tgetent, + [ CONS_LIBS="-ltermcap" + CONS_OBJ="conio.o" + CONS_SRC="conio.c" + got_conio="yes" + support_readline=no + AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) + ], [ echo " "; echo "termcap library not found. CONIO turned off ..."; echo " "]) + ],[echo " "; echo "termcap.h not found. CONIO turned off ..."; echo " "]) fi diff --git a/bacula/configure b/bacula/configure index 1c5c2d4696..8e657a1530 100755 --- a/bacula/configure +++ b/bacula/configure @@ -4844,9 +4844,6 @@ fi; got_conio="no" if test x$support_conio = xyes; then - CONS_OBJ="conio.o" - CONS_SRC="conio.c" - got_conio="yes" echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then @@ -5070,22 +5067,18 @@ fi done - -for ac_header in termcap.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if test "${ac_cv_header_termcap_h+set}" = set; then + echo "$as_me:$LINENO: checking for termcap.h" >&5 +echo $ECHO_N "checking for termcap.h... $ECHO_C" >&6 +if test "${ac_cv_header_termcap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +echo "$as_me:$LINENO: result: $ac_cv_header_termcap_h" >&5 +echo "${ECHO_T}$ac_cv_header_termcap_h" >&6 else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking termcap.h usability" >&5 +echo $ECHO_N "checking termcap.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ @@ -5094,7 +5087,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$ac_header> +#include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -5120,8 +5113,8 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking termcap.h presence" >&5 +echo $ECHO_N "checking termcap.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ @@ -5129,7 +5122,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +#include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -5162,10 +5155,10 @@ echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: termcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: termcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: termcap.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: termcap.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## @@ -5176,12 +5169,12 @@ _ASBOX sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: termcap.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: termcap.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: termcap.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: termcap.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: termcap.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: termcap.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## @@ -5192,26 +5185,18 @@ _ASBOX sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +echo "$as_me:$LINENO: checking for termcap.h" >&5 +echo $ECHO_N "checking for termcap.h... $ECHO_C" >&6 +if test "${ac_cv_header_termcap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + ac_cv_header_termcap_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +echo "$as_me:$LINENO: result: $ac_cv_header_termcap_h" >&5 +echo "${ECHO_T}$ac_cv_header_termcap_h" >&6 fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - +if test $ac_cv_header_termcap_h = yes; then echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6 if test "${ac_cv_lib_termcap_tgetent+set}" = set; then @@ -5267,15 +5252,27 @@ fi echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6 if test $ac_cv_lib_termcap_tgetent = yes; then - CONS_LIBS="-ltermcap" -fi - - support_readline=no + CONS_LIBS="-ltermcap" + CONS_OBJ="conio.o" + CONS_SRC="conio.c" + got_conio="yes" + support_readline=no cat >>confdefs.h <<\_ACEOF #define HAVE_CONIO 1 _ACEOF + +else + echo " "; echo "termcap library not found. CONIO turned off ..."; echo " " +fi + + +else + echo " "; echo "termcap.h not found. CONIO turned off ..."; echo " " +fi + + fi diff --git a/bacula/src/console/conio.c b/bacula/src/console/conio.c index 88eb1865e5..7447ead95e 100755 --- a/bacula/src/console/conio.c +++ b/bacula/src/console/conio.c @@ -43,9 +43,8 @@ #endif -#ifdef HAVE_TERMCAP_H +#include #include -#endif #include "func.h" diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index e9fb8868e7..18d546bf31 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -987,7 +987,7 @@ static int update_volume(UAContext *ua) if (!db_update_media_record(ua->jcr, ua->db, &mr)) { bsendmsg(ua, _("Error updating media record Slot: ERR=%s"), db_strerror(ua->db)); } else { - bsendmsg(ua, _("New Slot is: %s\n"), mr.Slot); + bsendmsg(ua, _("New Slot is: %d\n"), mr.Slot); } break; diff --git a/bacula/src/version.h b/bacula/src/version.h index a1c8b22943..ec4c04dc9a 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -2,8 +2,8 @@ #undef VERSION #define VERSION "1.33.4" #define VSTRING "1" -#define BDATE "20 Mar 2004" -#define LSMDATE "20Mar04" +#define BDATE "22 Mar 2004" +#define LSMDATE "22Mar04" /* Debug flags */ #undef DEBUG -- 2.39.5