From d8574d458324cdde27484485cb09e7c9b8fa1a77 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Thu, 1 Jun 2000 18:30:08 +0000 Subject: [PATCH] Added --with-oldstylefscript in configure. Compare on the fly in restore code. --- CHANGES | 23 ++++-- THANKS | 4 +- TODO | 6 +- config.h.in | 3 + configure | 173 +++++++++++++++++++++++++--------------------- configure.in | 45 +++++++----- dump/tape.c | 6 +- restore/restore.c | 3 +- restore/tape.c | 101 ++++++++++++++++++++++++++- 9 files changed, 256 insertions(+), 108 deletions(-) diff --git a/CHANGES b/CHANGES index f3764a0..dccf3c7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.59 2000/05/29 14:17:37 stelian Exp $ +$Id: CHANGES,v 1.60 2000/06/01 18:30:08 stelian Exp $ Changes between versions 0.4b16 and 0.4b17 (released ??????????????) ==================================================================== @@ -7,6 +7,12 @@ Changes between versions 0.4b16 and 0.4b17 (released ??????????????) not at the end of the dump. Thanks to Chris for the bug report. + Normally, the device name and the current volume number + are passed on the command line of the script. However, + if you want the old style script (with no arguments + passed on the command line), you can enable it in + configure with the --enable-oldstylefscript. + 2. Use posix signal handling to preserve dump functionality with libc5. Thanks to Jeff Johnson for the patch. @@ -14,15 +20,24 @@ Changes between versions 0.4b16 and 0.4b17 (released ??????????????) 3. Made the exit code of restore in case of a 'C'ompare command reflect the result of the compare. An exit status of 0 means the dump archive is correct, 1 means tape errors, - 2 means that some files were modified. + 2 means that some files were modified. Thanks to Kenneth Porter + for the suggestion. -4. Made quotes work in interactive restore. +4. Made (finally) quotes work in interactive restore. 5. Small fixes in order to allow dump to compile with a - really old e2fsprogs version. + really old e2fsprogs version. Thanks to Ian Zimmerman + for the bug report. 6. Add GNU readline capabilities to interactive restore. Use configure's --enable-readline flag to enable this feature. + Thanks to Patrik Schindler for the + suggestion. + +7. Do the compare on the fly in restore 'C' mode (this will + allow not to exhaust the available /tmp space when + ccmparing large files). Thanks to Kenneth Porter + for the suggestion. Changes between versions 0.4b15 and 0.4b16 (released March 11, 2000) ==================================================================== diff --git a/THANKS b/THANKS index ed4d8b2..4f7341c 100644 --- a/THANKS +++ b/THANKS @@ -1,4 +1,4 @@ -$Id: THANKS,v 1.26 2000/05/28 16:24:13 stelian Exp $ +$Id: THANKS,v 1.27 2000/06/01 18:30:08 stelian Exp $ Dump and restore were written by the people of the CSRG at the University of California, Berkeley. @@ -50,6 +50,7 @@ Dejan Muhamedagic dejan@quant-x.com Lukas Nellen L.Nellen@ThPhys.Uni-Heidelberg.DE Nuno Oliveira nuno@eq.uc.pt Brent Olson night@halcyon.com +Kenneth Porter scratchmonkey@users.sourceforge.net Bernhard Sadlowski sadlowsk@Mathematik.Uni-Bielefeld.DE Jan Sanislo oystr@cs.washington.edu Patrik Schindler poc@pocnet.net @@ -64,3 +65,4 @@ Daniel Veillard Daniel.Veillard@imag.fr Jason Venner jason@idiom.com Christian Weisgerber naddy@mips.rhein-neckar.de Kim Yong-jun loveyou@hackerslab.org +Ian Zimmerman itz@speakeasy.org> diff --git a/TODO b/TODO index 590a3e4..922465b 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -$Id: TODO,v 1.15 2000/05/29 14:17:37 stelian Exp $ +$Id: TODO,v 1.16 2000/06/01 18:30:08 stelian Exp $ Need to verify: --------------- @@ -43,7 +43,3 @@ All others: the specified archive_file to be used by ufsrestore(1M) to determine whether a file is in the dump file that is being restored. - -9. Do the compare on the fly in restore C mode (useful - when comparing huge files and you have not enough space - in /tmp). diff --git a/config.h.in b/config.h.in index 57b5247..1f51bea 100644 --- a/config.h.in +++ b/config.h.in @@ -44,3 +44,6 @@ /* Define if you want to include readline support. */ #undef HAVE_READLINE + +/* Define this is you want old style F script (no arguments) */ +#undef OLD_STYLE_FSCRIPT diff --git a/configure b/configure index 74aaaa8..6a6911f 100755 --- a/configure +++ b/configure @@ -12,37 +12,39 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help - --enable-debug include debugging code" + --enable-debug include debugging code" ac_help="$ac_help - --enable-static link dump and restore statically" + --enable-static link dump and restore statically" ac_help="$ac_help - --enable-rmt compile and install rmt" + --enable-rmt compile and install rmt" ac_help="$ac_help - --enable-kerberos compile kerberos extensions" + --enable-kerberos compile kerberos extensions" ac_help="$ac_help - --enable-readline enable readline support in restore" + --enable-readline enable readline support in restore" ac_help="$ac_help - --with-cc=COMPILER select compiler to use" + --enable-oldstylefscript enable old style F script (no arguments)" ac_help="$ac_help - --with-linker=LINKER select linker to use" + --with-cc=COMPILER select compiler to use" ac_help="$ac_help - --with-ccopts=CCOPTS select compiler command line options" + --with-linker=LINKER select linker to use" ac_help="$ac_help - --with-ldopts=LDOPTS select linker command line options" + --with-ccopts=CCOPTS select compiler command line options" ac_help="$ac_help - --with-binowner=USER select owner for binaries" + --with-ldopts=LDOPTS select linker command line options" ac_help="$ac_help - --with-bingrp=GROUP select group for binaries" + --with-binowner=USER select owner for binaries" ac_help="$ac_help - --with-binmode=MODE select mode for binaries" + --with-bingrp=GROUP select group for binaries" ac_help="$ac_help - --with-manowner=USER select owner for manual pages" + --with-binmode=MODE select mode for binaries" ac_help="$ac_help - --with-mangrp=group select group for manual pages" + --with-manowner=USER select owner for manual pages" ac_help="$ac_help - --with-manmode=MODE select mode for manual pages" + --with-mangrp=GROUP select group for manual pages" ac_help="$ac_help - --with-dumpdatespath=path select path for dumpdates file" + --with-manmode=MODE select mode for manual pages" +ac_help="$ac_help + --with-dumpdatespath=PATH select path for dumpdates file" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -560,7 +562,7 @@ MCONFIG=./MCONFIG echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:564: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:566: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -587,7 +589,7 @@ else fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:591: checking whether ln -s works" >&5 +echo "configure:593: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -610,7 +612,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:614: checking for $ac_word" >&5 +echo "configure:616: 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 @@ -646,7 +648,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:650: checking for $ac_word" >&5 +echo "configure:652: 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 @@ -682,7 +684,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:686: checking for $ac_word" >&5 +echo "configure:688: 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 @@ -741,7 +743,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:745: checking host system type" >&5 +echo "configure:747: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -762,7 +764,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:766: checking build system type" >&5 +echo "configure:768: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -788,7 +790,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:792: checking for $ac_word" >&5 +echo "configure:794: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -820,7 +822,7 @@ if test -n "$ac_tool_prefix"; then # 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:824: checking for $ac_word" >&5 +echo "configure:826: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -855,7 +857,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:859: checking for $ac_word" >&5 +echo "configure:861: 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 @@ -887,7 +889,7 @@ if test -n "$ac_tool_prefix"; then # 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:891: checking for $ac_word" >&5 +echo "configure:893: 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 @@ -922,7 +924,7 @@ fi # Extract the first word of "${ac_tool_prefix}patch", so it can be a program name with args. set dummy ${ac_tool_prefix}patch; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:926: checking for $ac_word" >&5 +echo "configure:928: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PATCH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -954,7 +956,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "patch", so it can be a program name with args. set dummy patch; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:958: checking for $ac_word" >&5 +echo "configure:960: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PATCH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -989,7 +991,7 @@ fi # 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:993: checking for $ac_word" >&5 +echo "configure:995: 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 @@ -1019,7 +1021,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:1023: checking for $ac_word" >&5 +echo "configure:1025: 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 @@ -1070,7 +1072,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:1074: checking for $ac_word" >&5 +echo "configure:1076: 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 @@ -1102,7 +1104,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1106: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1108: 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. @@ -1113,12 +1115,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1117 "configure" +#line 1119 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1124: \"$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 @@ -1144,12 +1146,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:1148: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1150: 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:1153: checking whether we are using GNU C" >&5 +echo "configure:1155: 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 @@ -1158,7 +1160,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1162: \"$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:1164: \"$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 @@ -1177,7 +1179,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:1181: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1183: 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 @@ -1220,7 +1222,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:1224: checking for a BSD compatible install" >&5 +echo "configure:1226: 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 @@ -1371,6 +1373,23 @@ fi +# Check whether --enable-oldstylefscript or --disable-oldstylefscript was given. +if test "${enable_oldstylefscript+set}" = set; then + enableval="$enable_oldstylefscript" + if test "$enableval" = "yes" +then + cat >> confdefs.h <<\EOF +#define OLD_STYLE_FSCRIPT 1 +EOF + +fi + +else + echo "Using new style F script" + +fi + + # Check whether --with-cc or --without-cc was given. if test "${with_cc+set}" = set; then withval="$with_cc" @@ -1501,7 +1520,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1505: checking how to run the C preprocessor" >&5 +echo "configure:1524: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1516,13 +1535,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:1526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1545: \"$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 : @@ -1533,13 +1552,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:1543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1562: \"$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 : @@ -1550,13 +1569,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:1560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1579: \"$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 : @@ -1582,17 +1601,17 @@ echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "ext2fs/ext2fs.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ext2fs/ext2fs.h""... $ac_c" 1>&6 -echo "configure:1586: checking for ext2fs/ext2fs.h" >&5 +echo "configure:1605: checking for ext2fs/ext2fs.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:1596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1615: \"$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* @@ -1615,7 +1634,7 @@ ext2fs_h=no fi echo $ac_n "checking for ext2fs_open in -lext2fs""... $ac_c" 1>&6 -echo "configure:1619: checking for ext2fs_open in -lext2fs" >&5 +echo "configure:1638: checking for ext2fs_open in -lext2fs" >&5 ac_lib_var=`echo ext2fs'_'ext2fs_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1623,7 +1642,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lext2fs -lcom_err $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1657: \"$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 @@ -1661,17 +1680,17 @@ fi ac_safe=`echo "readline/readline.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for readline/readline.h""... $ac_c" 1>&6 -echo "configure:1665: checking for readline/readline.h" >&5 +echo "configure:1684: checking for 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:1675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1694: \"$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* @@ -1694,7 +1713,7 @@ readline_h=no fi echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:1698: checking for readline in -lreadline" >&5 +echo "configure:1717: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1702,7 +1721,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1736: \"$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 @@ -1743,12 +1762,12 @@ fi for ac_func in err errx verr verrx vwarn vwarnx warn warnx realpath lchown do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1747: checking for $ac_func" >&5 +echo "configure:1766: 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:1794: \"$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 @@ -1796,12 +1815,12 @@ fi done echo $ac_n "checking for glob""... $ac_c" 1>&6 -echo "configure:1800: checking for glob" >&5 +echo "configure:1819: checking for glob" >&5 if eval "test \"`echo '$''{'ac_cv_func_glob'+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:1847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_glob=yes" else @@ -1846,7 +1865,7 @@ fi if test "$ac_cv_func_glob" = "yes"; then cat > conftest.$ac_ext < @@ -1874,12 +1893,12 @@ rm -f conftest* fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1878: checking for ANSI C header files" >&5 +echo "configure:1897: 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 @@ -1887,7 +1906,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1910: \"$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* @@ -1904,7 +1923,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 @@ -1922,7 +1941,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 @@ -1943,7 +1962,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1954,7 +1973,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1978,12 +1997,12 @@ EOF fi echo $ac_n "checking for quad_t""... $ac_c" 1>&6 -echo "configure:1982: checking for quad_t" >&5 +echo "configure:2001: checking for quad_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_quad_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2011,12 +2030,12 @@ EOF fi echo $ac_n "checking for u_quad_t""... $ac_c" 1>&6 -echo "configure:2015: checking for u_quad_t" >&5 +echo "configure:2034: checking for u_quad_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_quad_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS diff --git a/configure.in b/configure.in index 00038cd..a35359c 100644 --- a/configure.in +++ b/configure.in @@ -23,7 +23,7 @@ dnl dnl Handle --enable-debug dnl AC_ARG_ENABLE([debug], -[ --enable-debug include debugging code], +[ --enable-debug include debugging code], if test "$enableval" = "no" then DUMPDEBUG="" @@ -42,7 +42,7 @@ dnl dnl Handle --enable-static dnl AC_ARG_ENABLE([static], -[ --enable-static link dump and restore statically], +[ --enable-static link dump and restore statically], if test "$enableval" = "no" then STATIC="" @@ -59,7 +59,7 @@ dnl dnl Handle --enable-rmt dnl AC_ARG_ENABLE([rmt], -[ --enable-rmt compile and install rmt], +[ --enable-rmt compile and install rmt], if test "$enableval" = "no" then RMTDIR="" @@ -78,7 +78,7 @@ dnl dnl Handle --enable-kerberos dnl AC_ARG_ENABLE([kerberos], -[ --enable-kerberos compile kerberos extensions], +[ --enable-kerberos compile kerberos extensions], if test "$enableval" = "yes" then OPTDEFS="-DKERBEROS" @@ -95,7 +95,7 @@ dnl dnl Handle --enable-readline dnl AC_ARG_ENABLE([readline], -[ --enable-readline enable readline support in restore], +[ --enable-readline enable readline support in restore], if test "$enableval" = "no" then READLINE="" @@ -109,11 +109,24 @@ echo "Not including readline support by default" ) AC_SUBST(READLINE) +dnl +dnl Handle --enable-oldsylefscript +dnl +AC_ARG_ENABLE([oldstylefscript], +[ --enable-oldstylefscript enable old style F script (no arguments)], +if test "$enableval" = "yes" +then + AC_DEFINE(OLD_STYLE_FSCRIPT) +fi +, +echo "Using new style F script" +) + dnl dnl set $(CC) from --with-cc=value dnl AC_ARG_WITH([cc], -[ --with-cc=COMPILER select compiler to use], +[ --with-cc=COMPILER select compiler to use], AC_MSG_RESULT(CC=$withval) CC=$withval, if test -z "$CC" ; then CC=cc; fi @@ -125,7 +138,7 @@ dnl dnl set $(LD) from --with-linker=value dnl AC_ARG_WITH([linker], -[ --with-linker=LINKER select linker to use], +[ --with-linker=LINKER select linker to use], AC_MSG_RESULT(LD=$withval) LD=$withval, if test -z "$LD" ; then LD=$CC; fi @@ -137,7 +150,7 @@ dnl dnl set $(CCOPTS) from --with-ccopts=value dnl AC_ARG_WITH([ccopts], -[ --with-ccopts=CCOPTS select compiler command line options], +[ --with-ccopts=CCOPTS select compiler command line options], AC_MSG_RESULT(CCOPTS is $withval) CCOPTS=$withval CFLAGS="$CFLAGS $withval", @@ -148,7 +161,7 @@ dnl dnl set $(LDFLAGS) from --with-ldopts=value dnl AC_ARG_WITH([ldopts], -[ --with-ldopts=LDOPTS select linker command line options], +[ --with-ldopts=LDOPTS select linker command line options], AC_MSG_RESULT(LDFLAGS is $withval) LDFLAGS=$withval, LDFLAGS=)dnl @@ -158,7 +171,7 @@ dnl dnl set $(BINOWNER) from --with-binowner dnl AC_ARG_WITH([binowner], -[ --with-binowner=USER select owner for binaries], +[ --with-binowner=USER select owner for binaries], AC_MSG_RESULT(BINOWNER is $withval) BINOWNER=$withval, BINOWNER=root @@ -170,7 +183,7 @@ dnl dnl set $(BINGRP) from --with-bingrp dnl AC_ARG_WITH([bingrp], -[ --with-bingrp=GROUP select group for binaries], +[ --with-bingrp=GROUP select group for binaries], AC_MSG_RESULT(BINGRP is $withval) BINGRP=$withval, BINGRP=tty @@ -182,7 +195,7 @@ dnl dnl set $(BINMODE) from --with-binmode dnl AC_ARG_WITH([binmode], -[ --with-binmode=MODE select mode for binaries], +[ --with-binmode=MODE select mode for binaries], AC_MSG_RESULT(BINMODE is $withval) BINMODE=$withval, BINMODE=6555 @@ -194,7 +207,7 @@ dnl dnl set $(MANOWNER) from --with-manowner dnl AC_ARG_WITH([manowner], -[ --with-manowner=USER select owner for manual pages], +[ --with-manowner=USER select owner for manual pages], AC_MSG_RESULT(MANOWNER is $withval) MANOWNER=$withval, MANOWNER=man @@ -206,7 +219,7 @@ dnl dnl set $(MANGRP) from --with-mangrp dnl AC_ARG_WITH([mangrp], -[ --with-mangrp=group select group for manual pages], +[ --with-mangrp=GROUP select group for manual pages], AC_MSG_RESULT(MANGRP is $withval) MANGRP=$withval, MANGRP=tty @@ -218,7 +231,7 @@ dnl dnl set $(MANMODE) from --with-manmode dnl AC_ARG_WITH([manmode], -[ --with-manmode=MODE select mode for manual pages], +[ --with-manmode=MODE select mode for manual pages], AC_MSG_RESULT(MANMODE is $withval) MANMODE=$withval, MANMODE=0444 @@ -230,7 +243,7 @@ dnl dnl set $(DUMPDATESPATH) from --with-dumpdatespath dnl AC_ARG_WITH([dumpdatespath], -[ --with-dumpdatespath=path select path for dumpdates file], +[ --with-dumpdatespath=PATH select path for dumpdates file], AC_MSG_RESULT(DUMPDATESPATH is $withval) DUMPDATESPATH=$withval, DUMPDATESPATH="/etc/dumpdates" diff --git a/dump/tape.c b/dump/tape.c index 6971500..c104667 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -40,7 +40,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.19 2000/05/28 16:24:14 stelian Exp $"; + "$Id: tape.c,v 1.20 2000/06/01 18:30:08 stelian Exp $"; #endif /* not lint */ #ifdef __linux__ @@ -422,7 +422,11 @@ int system_command(const char *command, const char *device, int volnum) { if (pid == 0) { setuid(getuid()); setgid(getgid()); +#if OLD_STYLE_FSCRIPT + snprintf(commandstr, sizeof(commandstr), "%s", command); +#else snprintf(commandstr, sizeof(commandstr), "%s %s %d", command, device, volnum); +#endif commandstr[sizeof(commandstr) - 1] = '\0'; execl("/bin/sh", "sh", "-c", commandstr, NULL); perror(" DUMP: unable to execute shell"); diff --git a/restore/restore.c b/restore/restore.c index c577084..d438f41 100644 --- a/restore/restore.c +++ b/restore/restore.c @@ -40,7 +40,7 @@ #ifndef lint static const char rcsid[] = - "$Id: restore.c,v 1.8 2000/05/28 16:52:21 stelian Exp $"; + "$Id: restore.c,v 1.9 2000/06/01 18:30:08 stelian Exp $"; #endif /* not lint */ #include @@ -481,6 +481,7 @@ nodeupdates(char *name, ino_t ino, int type) if (compare_ignore_not_found) break; fprintf(stderr, "%s: (inode %lu) not found on tape\n", name, (unsigned long)ino); + compare_errors = 1; break; /* diff --git a/restore/tape.c b/restore/tape.c index 1b567bd..f59fc02 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -45,7 +45,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.15 2000/05/28 16:52:21 stelian Exp $"; + "$Id: tape.c,v 1.16 2000/06/01 18:30:08 stelian Exp $"; #endif /* not lint */ #include @@ -125,6 +125,15 @@ static void xtrmap __P((char *, size_t)); static void xtrmapskip __P((char *, size_t)); static void xtrskip __P((char *, size_t)); +#define COMPARE_ONTHEFLY 1 + +#if COMPARE_ONTHEFLY +static int ifile; /* input file for compare */ +static int cmperror; /* compare error */ +static void xtrcmpfile __P((char *, size_t)); +static void xtrcmpskip __P((char *, size_t)); +#endif + static int readmapflag; /* @@ -873,6 +882,63 @@ xtrnull(char *buf, size_t size) return; } +#if COMPARE_ONTHEFLY +/* + * Compare the next block of a file. + */ +static void +xtrcmpfile(char *buf, size_t size) +{ + static char cmpbuf[MAXBSIZE]; + + if (cmperror) + return; + + if (read(ifile, cmpbuf, size) != size) { + fprintf(stderr, "%s: size has changed.\n", + curfile.name); + cmperror = 1; + return; + } + + if (memcmp(buf, cmpbuf, size) != 0) { + fprintf(stderr, "%s: tape and disk copies are different\n", + curfile.name); + cmperror = 1; + return; + } +} + +/* + * Skip over a hole in a file. + */ +static void +xtrcmpskip(char *buf, size_t size) +{ + static char cmpbuf[MAXBSIZE]; + int i; + + if (cmperror) + return; + + if (read(ifile, cmpbuf, size) != size) { + fprintf(stderr, "%s: size has changed.\n", + curfile.name); + cmperror = 1; + return; + } + + for (i = 0; i < size; ++i) + if (cmpbuf[i] != '\0') { + fprintf(stderr, "%s: tape and disk copies are different\n", + curfile.name); + cmperror = 1; + return; + } +} +#endif /* COMPARE_ONTHEFLY */ + +#if !COMPARE_ONTHEFLY static int do_cmpfiles(int fd_tape, int fd_disk, long size) { @@ -982,16 +1048,22 @@ cmpfiles(char *tapefile, char *diskfile, struct stat *sbuf_disk) return (1); #endif } +#endif /* !COMPARE_ONTHEFLY */ +#if !COMPARE_ONTHEFLY static char tmpfilename[MAXPATHLEN]; +#endif void comparefile(char *name) { - static char *tmpfile = NULL; int mode; - struct stat sb, stemp; + struct stat sb; int r; +#if !COMPARE_ONTHEFLY + static char *tmpfile = NULL; + struct stat stemp; +#endif if ((r = lstat(name, &sb)) != 0) { warn("%s: does not exist (%d)", name, r); @@ -1085,6 +1157,28 @@ comparefile(char *name) return; case IFREG: +#if COMPARE_ONTHEFLY + if ((ifile = open(name, O_RDONLY)) < 0) { + panic("Can't open %s: %s\n", name, strerror(errno)); + skipfile(); + compare_errors = 1; + } + else { + cmperror = 0; + getfile(xtrcmpfile, xtrcmpskip); + if (!cmperror) { + char c; + if (read(ifile, &c, 1) != 0) { + fprintf(stderr, "%s: size has changed.\n", + name); + cmperror = 1; + } + } + if (cmperror) + compare_errors = 1; + close(ifile); + } +#else if (tmpfile == NULL) { /* argument to mktemp() must not be in RO space: */ snprintf(tmpfilename, sizeof(tmpfilename), "%s/restoreCXXXXXX", tmpdir); @@ -1107,6 +1201,7 @@ comparefile(char *name) cmpfiles(tmpfile, name, &sb); unlink(tmpfile); #endif +#endif /* COMPARE_ONTHEFLY */ return; } /* NOTREACHED */ -- 2.39.2