From: Andreas D. <ad...@ho...> - 2000-02-24 21:57:04
|
Hello, I've been using ext2 dump since way back, and I have to say it's great that someone is maintaining it again (I had previously sent bug reports to the Debian maintainer). There are a couple minor things I noticed when building dump on my system: 1) even though I've done it properly before, it is not obvious when installing e2fsprogs that you need to run "make install-libs" and not just "make install", so it would be nice to have a note to that effect in the configure error message for ext2fs_lib. 2) It's nice to get "PWD" when using restore in interactive mode. I have it tied to verbose mode, but it could also just be the default mode, or have its own "prompt" mode or something. 3) The default tape device for dump and mt are not the same. 4) I removed a bit of unused cruft. I've included a patch which will do these things below. As I don't know anything about autoconf, I haven't added a check for <sys/mtio.h>, which might be a better solution than my code. Cheers, Andreas --- cut here --- diff -ru dump-0.4b14/configure dump-0.4b14a/configure --- dump-0.4b14/configure Sun Nov 21 08:39:46 1999 +++ dump-0.4b14a/configure Thu Feb 24 13:04:32 2000 @@ -1632,7 +1632,7 @@ fi if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then - { echo "configure: error: You need to install the Ext2fs libraries from the E2fsprogs distribution first" 1>&2; exit 1; } + { echo "configure: error: You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs" 1>&2; exit 1; } fi for ac_func in err errx verr verrx vwarn vwarnx warn warnx realpath lchown diff -ru dump-0.4b14/configure.in dump-0.4b14a/configure.in --- dump-0.4b14/configure.in Sun Nov 21 08:39:46 1999 +++ dump-0.4b14a/configure.in Thu Feb 24 13:03:57 2000 @@ -226,7 +226,7 @@ AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no]) AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err]) if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then - AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first) + AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs) fi dnl diff -ru dump-0.4b14/dump/dump.h dump-0.4b14a/dump/dump.h --- dump-0.4b14/dump/dump.h Thu Feb 24 12:45:56 2000 +++ dump-0.4b14a/dump/dump.h Thu Feb 24 12:21:15 2000 @@ -71,7 +71,6 @@ char tape[NAME_MAX]; /* name of the tape file */ char *tapeprefix; /* prefix of the tape file */ char *dumpdates; /* name of the file containing dump date information*/ -char *temp; /* name of the file for doing rewrite of dumpdates */ char lastlevel; /* dump level of previous dump */ char level; /* dump level of this dump */ int uflag; /* update flag */ diff -ru dump-0.4b14/dump/main.c dump-0.4b14a/dump/main.c --- dump-0.4b14/dump/main.c Thu Feb 24 12:45:56 2000 +++ dump-0.4b14a/dump/main.c Thu Feb 24 12:59:41 2000 @@ -144,7 +144,6 @@ if ((tapeprefix = getenv("TAPE")) == NULL) tapeprefix = _PATH_DEFTAPE; dumpdates = _PATH_DUMPDATES; - temp = _PATH_DTMP; strcpy(labelstr, "none"); /* XXX safe strcpy. */ if (TP_BSIZE / DEV_BSIZE == 0 || TP_BSIZE % DEV_BSIZE != 0) quit("TP_BSIZE must be a multiple of DEV_BSIZE\n"); diff -ru dump-0.4b14/dump/tape.c dump-0.4b14a/dump/tape.c --- dump-0.4b14/dump/tape.c Thu Feb 24 12:45:56 2000 +++ dump-0.4b14a/dump/tape.c Thu Feb 24 13:00:49 2000 @@ -732,10 +732,11 @@ msg("Dumping volume %d on %s\n", tapeno, tape); } #ifdef RDUMP - while ((tapefd = (host ? rmtopen(tape, 2) : - pipeout ? 1 : open(tape, O_WRONLY|O_CREAT, 0666))) < 0) + while ((tapefd = (host ? rmtopen(tape, 2) : pipeout ? + fileno(stdout) : + open(tape, O_WRONLY|O_CREAT, 0666))) < 0) #else - while ((tapefd = (pipeout ? 1 : + while ((tapefd = (pipeout ? fileno(stdout) : open(tape, O_WRONLY|O_CREAT, 0666))) < 0) #endif { diff -ru dump-0.4b14/restore/interactive.c dump-0.4b14a/restore/interactive.c --- dump-0.4b14/restore/interactive.c Fri Jan 21 03:17:41 2000 +++ dump-0.4b14a/restore/interactive.c Thu Feb 24 12:50:05 2000 @@ -337,7 +337,11 @@ * Read a command line and trim off trailing white space. */ do { - fprintf(stderr, "%s > ", __progname); + if (vflag) + fprintf(stderr, "%s:%s:%s > ", __progname, + spcl.c_filesys, curdir[1] ? &curdir[1] : "/"); + else + fprintf(stderr, "%s > ", __progname); (void) fflush(stderr); (void) fgets(input, BUFSIZ, terminal); } while (!feof(terminal) && input[0] == '\n'); diff -ru dump-0.4b14/compat/include/pathnames.h dump-0.4b14a/compat/include/pathnames.h --- dump-0.4b14/compat/include/pathnames.h Fri Jan 21 03:17:41 2000 +++ dump-0.4b14a/compat/include/pathnames.h Thu Feb 24 14:25:23 2000 @@ -42,7 +42,10 @@ #include <paths.h> +#ifdef __linux__ +#include <sys/mtio.h> +#define _PATH_DEFTAPE DEFTAPE +#else #define _PATH_DEFTAPE "/dev/st0" -#define _PATH_DTMP "/etc/dtmp" -#define _PATH_LOCK "/tmp/dumplockXXXXXX" +#endif /* __linux__ */ #define _PATH_RMT "/etc/rmt" /* path on remote host */ --- cut here --- -- Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto, \ would they cancel out, leaving him still hungry?" http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert |