Imported Debian patch 2.5.2p1-1
[debian/amanda] / client-src / sendbackup-dump.c
index 84a9d1091751bdbc02d66063666a75c5896750bf..cb87624565257f5556764a132546e1a4c7e69a9c 100644 (file)
@@ -41,40 +41,44 @@ static amregex_t re_table[] = {
   /* the various encodings of dump size */
   /* this should also match BSDI pre-3.0's buggy dump program, that
      produced doubled DUMP: DUMP: messages */
-  AM_SIZE_RE("DUMP: [0-9][0-9]* tape blocks", 1024),
-  AM_SIZE_RE("dump: Actual: [0-9][0-9]* tape blocks", 1024),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* tape blocks", 1024, 1),
+  AM_SIZE_RE("dump: Actual: [0-9][0-9]* tape blocks", 1024, 1),
   AM_SIZE_RE("backup: There are [0-9][0-9]* tape blocks on [0-9][0-9]* tapes",
-            1024),
+            1024, 1),
   AM_SIZE_RE("backup: [0-9][0-9]* tape blocks on [0-9][0-9]* tape\\(s\\)",
-            1024),
+            1024, 1),
   AM_SIZE_RE("backup: [0-9][0-9]* 1k blocks on [0-9][0-9]* volume\\(s\\)",
-            1024),
+            1024, 1),
   AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*KB\\) on [0-9][0-9]* volume",
-            512),
+            512, 1),
   AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*\\.[0-9][0-9]*MB\\) on [0-9][0-9]* volume",
-            512),
-  AM_SIZE_RE("DUMP: [0-9][0-9]* blocks", 1024),
-  AM_SIZE_RE("DUMP: [0-9][0-9]* bytes were dumped", 1),
+            512, 1),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*KB\\)",
+            1024, 2),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*\\.[0-9][0-9]*MB\\)",
+            1048576, 2),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* blocks", 512, 1),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* bytes were dumped", 1, 1),
   /* OSF's vdump */
-  AM_SIZE_RE("vdump: Dumped  [0-9][0-9]* of [0-9][0-9]* bytes", 1),
+  AM_SIZE_RE("vdump: Dumped  [0-9][0-9]* of [0-9][0-9]* bytes", 1, 1),
   /* DU 4.0a dump */
-  AM_SIZE_RE("dump: Actual: [0-9][0-9]* blocks output to pipe", 1024),
+  AM_SIZE_RE("dump: Actual: [0-9][0-9]* blocks output to pipe", 1024, 1),
   /* DU 4.0 vdump */
-  AM_SIZE_RE("dump: Dumped  [0-9][0-9]* of [0-9][0-9]* bytes", 1),
+  AM_SIZE_RE("dump: Dumped  [0-9][0-9]* of [0-9][0-9]* bytes", 1, 1),
   /* HPUX dump */
-  AM_SIZE_RE("DUMP: [0-9][0-9]* KB actual output", 1024),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* KB actual output", 1024, 1),
   /* HPUX 10.20 and above vxdump */
-  AM_SIZE_RE("vxdump: [0-9][0-9]* tape blocks", 1024),
+  AM_SIZE_RE("vxdump: [0-9][0-9]* tape blocks", 1024, 1),
   /* UnixWare vxdump */
-  AM_SIZE_RE("vxdump: [0-9][0-9]* blocks", 1024),
+  AM_SIZE_RE("vxdump: [0-9][0-9]* blocks", 1024, 1),
   /* SINIX vxdump */
-  AM_SIZE_RE("   VXDUMP: [0-9][0-9]* blocks", 512),
+  AM_SIZE_RE("   VXDUMP: [0-9][0-9]* blocks", 512, 1),
   /* SINIX ufsdump */
-  AM_SIZE_RE("   UFSDUMP: [0-9][0-9]* blocks", 512),
+  AM_SIZE_RE("   UFSDUMP: [0-9][0-9]* blocks", 512, 1),
   /* Irix 6.2 xfs dump */
-  AM_SIZE_RE("xfsdump: media file size [0-9][0-9]* bytes", 1),
+  AM_SIZE_RE("xfsdump: media file size [0-9][0-9]* bytes", 1, 1),
   /* NetApp dump */
-  AM_SIZE_RE("DUMP: [0-9][0-9]* KB", 1024),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* KB", 1024, 1),
 
   /* strange dump lines */
   AM_STRANGE_RE("should not happen"),
@@ -136,6 +140,7 @@ start_backup(
     char *device = NULL;
     char *fstype = NULL;
     char *cmd = NULL;
+    char *cmdX = NULL;
     char *indexcmd = NULL;
     char level_str[NUM_STR_SIZE];
     char *compopt  = NULL;
@@ -169,11 +174,11 @@ start_backup(
     /*  now do the client-side compression */
 
 
-    if(options->compress == COMPR_FAST || options->compress == COMPR_BEST) {
+    if(options->compress == COMP_FAST || options->compress == COMP_BEST) {
        compopt = skip_argument;
 
 #if defined(COMPRESS_BEST_OPT) && defined(COMPRESS_FAST_OPT)
-       if(options->compress == COMPR_BEST) {
+       if(options->compress == COMP_BEST) {
            compopt = COMPRESS_BEST_OPT;
        } else {
            compopt = COMPRESS_FAST_OPT;
@@ -188,7 +193,7 @@ start_backup(
            dbprintf((" %s", compopt));
        }
        dbprintf(("\n"));
-     } else if (options->compress == COMPR_CUST) {
+     } else if (options->compress == COMP_CUST) {
         compopt = skip_argument;
        comppid = pipespawn(options->clntcompprog, STDIN_PIPE,
                            &dumpout, &compout, &mesgf,
@@ -213,12 +218,14 @@ start_backup(
 
 #if defined(USE_RUNDUMP) || !defined(DUMP)
     cmd = vstralloc(libexecdir, "/", "rundump", versionsuffix(), NULL);
+    cmdX = cmd;
     if (g_options->config)
        config = g_options->config;
     else
        config = "NOCONFIG";
 #else
     cmd = stralloc(DUMP);
+    cmdX = skip_argument;
     config = skip_argument;
 #endif
 
@@ -233,6 +240,7 @@ start_backup(
     {
         char *progname = cmd = newvstralloc(cmd, libexecdir, "/", "rundump",
                                            versionsuffix(), NULL);
+       cmdX = cmd;
        if (g_options->config)
            config = g_options->config;
        else
@@ -256,7 +264,7 @@ start_backup(
        dumpkeys = stralloc(level_str);
        dumppid = pipespawn(progname, STDIN_PIPE,
                            &dumpin, &dumpout, &mesgf,
-                           config, /* JLM */
+                           cmdX, config,
                            "xfsdump",
                            options->no_record ? "-J" : skip_argument,
                            "-F",
@@ -277,12 +285,14 @@ start_backup(
 #ifdef USE_RUNDUMP
         char *progname = cmd = newvstralloc(cmd, libexecdir, "/", "rundump",
                                            versionsuffix(), NULL);
+       cmdX = cmd;
        if (g_options->config)
            config = g_options->config;
        else
            config = "NOCONFIG";
 #else
        char *progname = cmd = newvstralloc(cmd, VXDUMP, NULL);
+       cmdX = skip_argument;
        config = skip_argument;
 #endif
        program->backup_name  = VXDUMP;
@@ -306,7 +316,7 @@ start_backup(
 
        dumppid = pipespawn(progname, STDIN_PIPE,
                            &dumpin, &dumpout, &mesgf, 
-                           progname, config, /* JLM */
+                           cmdX, config,
                            "vxdump",
                            dumpkeys,
                            "1048576",
@@ -326,6 +336,7 @@ start_backup(
     {
         char *progname = cmd = newvstralloc(cmd, libexecdir, "/", "rundump",
                                            versionsuffix(), NULL);
+       cmdX = cmd;
        if (g_options->config)
            config = g_options->config;
        else
@@ -352,7 +363,7 @@ start_backup(
 
        dumppid = pipespawn(cmd, STDIN_PIPE,
                            &dumpin, &dumpout, &mesgf, 
-                           cmd, config,
+                           cmdX, config,
                            "vdump",
                            dumpkeys,
                            "60",
@@ -368,12 +379,15 @@ start_backup(
 #define RESTORE "restore"
 #endif
 
+#ifdef HAVE_HONOR_NODUMP
+#  define PARAM_HONOR_NODUMP "h"
+#else
+#  define PARAM_HONOR_NODUMP ""
+#endif
        dumpkeys = vstralloc(level_str,
                             options->no_record ? "" : "u",
                             "s",
-#ifdef HAVE_HONOR_NODUMP
-                            "h",
-#endif
+                            PARAM_HONOR_NODUMP,
                             "f",
                             NULL);
 
@@ -390,7 +404,7 @@ start_backup(
 
        dumppid = pipespawn(cmd, STDIN_PIPE,
                            &dumpin, &dumpout, &mesgf, 
-                           cmd, config,
+                           cmdX, config,
                            "dump",
                            dumpkeys,
                            "1048576",
@@ -422,7 +436,7 @@ start_backup(
 
     dumppid = pipespawn(cmd, STDIN_PIPE,
                        &dumpin, &dumpout, &mesgf, 
-                       cmd, config,
+                       cmdX, config,
                        "backup",
                        dumpkeys,
                        "-",