]> git.wh0rd.org - dump.git/commitdiff
Added the prompt command in restore interactive mode.
authorStelian Pop <stelian@popies.net>
Sat, 26 Feb 2000 01:35:48 +0000 (01:35 +0000)
committerStelian Pop <stelian@popies.net>
Sat, 26 Feb 2000 01:35:48 +0000 (01:35 +0000)
CHANGES
THANKS
compat/include/pathnames.h
configure
configure.in
dump/dump.h
dump/main.c
dump/tape.c
restore/interactive.c

diff --git a/CHANGES b/CHANGES
index 752cc8a33827386d9e89f2e74217d0e6979fa849..9fa3c596cd44f55d96adb44fdd7687c224cc90b7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,10 @@
-$Id: CHANGES,v 1.43 2000/02/10 10:22:04 stelian Exp $
+$Id: CHANGES,v 1.44 2000/02/26 01:35:48 stelian Exp $
+
+Changes between versions 0.4b14 and 0.4b15 (released ?????????????????)
+=======================================================================
+
+1.     Added a prompt command in interactive restore mode. Thanks
+       to Andreas Dilger <adilger@home.com> for the patch.
 
 Changes between versions 0.4b13 and 0.4b14 (released February 10, 2000)
 =======================================================================
 
 Changes between versions 0.4b13 and 0.4b14 (released February 10, 2000)
 =======================================================================
diff --git a/THANKS b/THANKS
index 7c464d5aff9d909f4f929df065196b4172b9ed64..284c05a6e497b7c8099cc2bf85e2fc874aab2cd6 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,4 +1,4 @@
-$Id: THANKS,v 1.21 2000/02/10 09:42:32 stelian Exp $
+$Id: THANKS,v 1.22 2000/02/26 01:35:48 stelian Exp $
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
@@ -27,6 +27,7 @@ Rob Cermak            cermak@ahab.rutgers.edu
 Isaac Chuang           ike@isl.stanford.edu
 Rainer Clasen          bj@ncc.cicely.de
 Abhijit Dasgupta       abhijit@ans.net
 Isaac Chuang           ike@isl.stanford.edu
 Rainer Clasen          bj@ncc.cicely.de
 Abhijit Dasgupta       abhijit@ans.net
+Andreas Dilger         adilger@home.com
 Jason Fearon           jasonf@netrider.org.au
 Jeremy Fitzhardinge    jeremy@goop.org
 Eirik Fuller           eirik@netcom.com
 Jason Fearon           jasonf@netrider.org.au
 Jeremy Fitzhardinge    jeremy@goop.org
 Eirik Fuller           eirik@netcom.com
index fb8f500715bc6dece7e5fd14c1cd5f409ab64d98..29bbd681a14916473308e854c4e7b221ff52cdf7 100644 (file)
@@ -4,7 +4,7 @@
  *     Remy Card <card@Linux.EU.Org>, 1994-1997
  *     Stelian Pop <pop@cybercable.fr>, 1999-2000
  *
  *     Remy Card <card@Linux.EU.Org>, 1994-1997
  *     Stelian Pop <pop@cybercable.fr>, 1999-2000
  *
- *     $Id: pathnames.h,v 1.6 2000/01/21 10:17:41 stelian Exp $
+ *     $Id: pathnames.h,v 1.7 2000/02/26 01:35:48 stelian Exp $
  */
 
 /*
  */
 
 /*
@@ -43,6 +43,4 @@
 #include <paths.h>
 
 #define        _PATH_DEFTAPE   "/dev/st0"
 #include <paths.h>
 
 #define        _PATH_DEFTAPE   "/dev/st0"
-#define        _PATH_DTMP      "/etc/dtmp"
-#define        _PATH_LOCK      "/tmp/dumplockXXXXXX"
 #define        _PATH_RMT       "/etc/rmt"              /* path on remote host */
 #define        _PATH_RMT       "/etc/rmt"              /* path on remote host */
index cf65578354c114c1b48cbb064db16c5e43b4f29e..60c7d2da8e778b3cd62c5f42801bb296f10f8a30 100755 (executable)
--- a/configure
+++ b/configure
@@ -1632,7 +1632,7 @@ ext2fs_lib=no
 fi
 
 if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
 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
 fi
 
 for ac_func in err errx verr verrx vwarn vwarnx warn warnx realpath lchown
index fbc45e4eefe1e79b09c19f4f3113256d24493a9e..6cf0b35234c10a5aede24808c6228f028b727e8c 100644 (file)
@@ -226,7 +226,7 @@ dnl
 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_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
 fi
 
 dnl
index 23331ff8dd66c6ba950414c3b947f86c7cd266bc..994706cf8fcfaf8324fe806283c11c6c53a10e0a 100644 (file)
@@ -4,7 +4,7 @@
  *     Remy Card <card@Linux.EU.Org>, 1994-1997
  *     Stelian Pop <pop@cybercable.fr>, 1999-2000
  *
  *     Remy Card <card@Linux.EU.Org>, 1994-1997
  *     Stelian Pop <pop@cybercable.fr>, 1999-2000
  *
- *     $Id: dump.h,v 1.10 2000/02/04 20:22:21 stelian Exp $
+ *     $Id: dump.h,v 1.11 2000/02/26 01:35:48 stelian Exp $
  */
 
 /*-
  */
 
 /*-
@@ -71,7 +71,6 @@ char  *disk;          /* name of the disk file */
 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   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 */
 char   lastlevel;      /* dump level of previous dump */
 char   level;          /* dump level of this dump */
 int    uflag;          /* update flag */
index 806de5efe278b990f2844d9f994f9b39d02b7cb1..bc4de017f7b1fa0b526d9798ba9018129428e4f2 100644 (file)
@@ -40,7 +40,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.15 2000/02/04 20:22:21 stelian Exp $";
+       "$Id: main.c,v 1.16 2000/02/26 01:35:48 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -144,7 +144,6 @@ main(int argc, char *argv[])
        if ((tapeprefix = getenv("TAPE")) == NULL)
                tapeprefix = _PATH_DEFTAPE;
        dumpdates = _PATH_DUMPDATES;
        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");
        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");
index b3964a8336512054dc957f16524c27003d928ff1..f4133942dd332a771d667c211c7c6c6a46bdea54 100644 (file)
@@ -40,7 +40,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.12 2000/02/10 09:42:32 stelian Exp $";
+       "$Id: tape.c,v 1.13 2000/02/26 01:35:48 stelian Exp $";
 #endif /* not lint */
 
 #ifdef __linux__
 #endif /* not lint */
 
 #ifdef __linux__
@@ -732,10 +732,11 @@ restore_check_point:
                        msg("Dumping volume %d on %s\n", tapeno, tape);
                }
 #ifdef RDUMP
                        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
 #else
-               while ((tapefd = (pipeout ? 1 :
+               while ((tapefd = (pipeout ? fileno(stdout) :
                                  open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
 #endif
                    {
                                  open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
 #endif
                    {
index 28b4d371861d2b7820e41ebfa3ab0f49d8061306..0bd6aaa6d7bc6f367c20e21a83f182b88de9003e 100644 (file)
@@ -40,7 +40,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: interactive.c,v 1.8 2000/01/21 10:17:41 stelian Exp $";
+       "$Id: interactive.c,v 1.9 2000/02/26 01:35:48 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -79,7 +79,7 @@ extern char * __progname;
 static int runshell;
 static jmp_buf reset;
 static char *nextarg = NULL;
 static int runshell;
 static jmp_buf reset;
 static char *nextarg = NULL;
-
+static int pflag = 0;          /* prompt mode */
 /*
  * Structure and routines associated with listing directories.
  */
 /*
  * Structure and routines associated with listing directories.
  */
@@ -203,7 +203,7 @@ loop:
                if (strncmp(cmd, "help", strlen(cmd)) != 0)
                        goto bad;
        case '?':
                if (strncmp(cmd, "help", strlen(cmd)) != 0)
                        goto bad;
        case '?':
-               fprintf(stderr, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+               fprintf(stderr, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
                        "Available commands are:\n",
                        "\tls [arg] - list directory\n",
                        "\tcd arg - change directory\n",
                        "Available commands are:\n",
                        "\tls [arg] - list directory\n",
                        "\tcd arg - change directory\n",
@@ -218,6 +218,7 @@ loop:
                        "\twhat - list dump header information\n",
                        "\tverbose - toggle verbose flag",
                        " (useful with ``ls'')\n",
                        "\twhat - list dump header information\n",
                        "\tverbose - toggle verbose flag",
                        " (useful with ``ls'')\n",
+                       "\tprompt - toggle the prompt display\n",
                        "\thelp or `?' - print this list\n",
                        "If no `arg' is supplied, the current",
                        " directory is used\n");
                        "\thelp or `?' - print this list\n",
                        "If no `arg' is supplied, the current",
                        " directory is used\n");
@@ -234,12 +235,26 @@ loop:
         * Print current directory.
         */
        case 'p':
         * Print current directory.
         */
        case 'p':
-               if (strncmp(cmd, "pwd", strlen(cmd)) != 0)
-                       goto bad;
-               if (curdir[1] == '\0')
-                       fprintf(stderr, "/\n");
-               else
-                       fprintf(stderr, "%s\n", &curdir[1]);
+               if (strncmp(cmd, "pwd", strlen(cmd)) == 0) {
+                       if (curdir[1] == '\0')
+                               fprintf(stderr, "/\n");
+                       else
+                               fprintf(stderr, "%s\n", &curdir[1]);
+               }
+       /*
+        * Toggle prompt mode.
+        */
+               else if (strncmp(cmd, "prompt", strlen(cmd)) == 0) {
+                       if (pflag) {
+                               fprintf(stderr, "prompt mode off\n");
+                               pflag = 0;
+                               break;
+                       }
+                       fprintf(stderr, "prompt mode on\n");
+                       pflag++;
+                       break;
+               }
+               else goto bad;
                break;
        /*
         * Quit.
                break;
        /*
         * Quit.
@@ -337,7 +352,13 @@ getcmd(char *curdir, char *cmd, char *name, int size, struct arglist *ap)
         * Read a command line and trim off trailing white space.
         */
        do      {
         * Read a command line and trim off trailing white space.
         */
        do      {
-               fprintf(stderr, "%s > ", __progname);
+               if (pflag)
+                       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');
                (void) fflush(stderr);
                (void) fgets(input, BUFSIZ, terminal);
        } while (!feof(terminal) && input[0] == '\n');