]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl use RegexWhere instead of where_use_regexp in job conf
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 24 Apr 2007 16:56:21 +0000 (16:56 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 24 Apr 2007 16:56:21 +0000 (16:56 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4619 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/dird_conf.c
bacula/src/dird/dird_conf.h

index f5feb2ba4e84c2642f2fd58964188e40b9772113..c1b81bca152d8901d651181f3c2e8e0bd1f967f0 100644 (file)
@@ -271,7 +271,7 @@ RES_ITEM job_items[] = {
    {"run",       store_alist_str, ITEM(res_job.run_cmds), 0, 0, 0},
    /* Root of where to restore files */
    {"where",    store_dir,      ITEM(res_job.RestoreWhere), 0, 0, 0},
-   {"whereuseregexp", store_bool, ITEM(res_job.where_use_regexp), 0, 0, 0},
+   {"regexwhere",    store_str,   ITEM(res_job.RegexWhere), 0, 0, 0},
    {"stripprefix",    store_str,  ITEM(res_job.strip_prefix), 0, 0, 0},
    {"addprefix",    store_str,  ITEM(res_job.add_prefix), 0, 0, 0},
    {"addsuffix",    store_str,  ITEM(res_job.add_suffix), 0, 0, 0},
@@ -1154,6 +1154,9 @@ void free_resource(RES *sres, int type)
       if (res->res_job.RestoreWhere) {
          free(res->res_job.RestoreWhere);
       }
+      if (res->res_job.RegexWhere) {
+         free(res->res_job.RegexWhere);
+      }
       if (res->res_job.strip_prefix) {
          free(res->res_job.strip_prefix);
       }
@@ -1319,6 +1322,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
          res->res_job.jobdefs    = res_all.res_job.jobdefs;
          res->res_job.run_cmds   = res_all.res_job.run_cmds;
          res->res_job.RunScripts = res_all.res_job.RunScripts;
+
         if (res->res_job.strip_prefix ||
             res->res_job.add_suffix   ||
             res->res_job.add_prefix)
@@ -1338,6 +1342,15 @@ void save_resource(int type, RES_ITEM *items, int pass)
 
            /* TODO: test bregexp */
         }
+
+        if (res->res_job.RegexWhere) {
+           if (res->res_job.RestoreWhere) {
+              free(res->res_job.RestoreWhere);
+           }
+           res->res_job.RestoreWhere = bstrdup(res->res_job.RegexWhere);
+           res->res_job.where_use_regexp = true;
+        }
+
          break;
       case R_COUNTER:
          if ((res = (URES *)GetResWithName(R_COUNTER, res_all.res_counter.hdr.name)) == NULL) {
index 2ba9f5afcc796318e577d70112ee9253401dc1d9..1719b1b5277175aabccfc6e952f7445cf6e48523 100644 (file)
@@ -359,6 +359,7 @@ public:
    int   Priority;                    /* Job priority */
    int   RestoreJobId;                /* What -- JobId to restore */
    char *RestoreWhere;                /* Where on disk to restore -- directory */
+   char *RegexWhere;                  /* RegexWhere option */
    char *strip_prefix;                /* remove prefix from filename  */
    char *add_prefix;                  /* add prefix to filename  */
    char *add_suffix;                  /* add suffix to filename -- .old */