Ignore:
Timestamp:
Jan 25, 2011, 10:44:33 AM (13 years ago)
Author:
Bruno Cornec
Message:
  • Backport from 2.2.10 the support of a dynamic exclude_path variable. Should help fix #366, #421, #368, #443. To be tested.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/common/libmondo-devices.c

    r2683 r2697  
    20642064                log_to_screen("==> %s", mounted_on_dsf);
    20652065                log_msg (5, "Adding to bkpinfo->exclude_paths due to -E option: %s", mounted_on_dsf);
    2066                 strcat(bkpinfo->exclude_paths, " ");
    2067                 strcat(bkpinfo->exclude_paths, mounted_on_dsf);
    2068                 strcat(bkpinfo->exclude_paths, " ");
     2066                mr_strcat(bkpinfo->exclude_paths, " %s ",mounted_on_dsf);
    20692067                mr_strcat(bkpinfo->exclude_devs, " %s ",token);
    20702068            }
     
    20772075                log_to_screen("Not archiving the following file systems:");
    20782076                log_to_screen("==> %s", not_mounted_on_dsf);
    2079                 strcat(bkpinfo->exclude_paths, " ");
    2080                 strcat(bkpinfo->exclude_paths, not_mounted_on_dsf);
    2081                 strcat(bkpinfo->exclude_paths, " ");
     2077                mr_strcat(bkpinfo->exclude_paths, " %s ", not_mounted_on_dsf);
    20822078            }
    20832079        }
     
    20952091            mr_asprintf(&tmp," %s ",bkpinfo->exclude_paths);
    20962092            if (strstr(tmp,tmp1) == NULL) {
    2097                 strcat(bkpinfo->exclude_paths, tmp1);
     2093                mr_strcat(bkpinfo->exclude_paths, tmp1);
    20982094            }
    20992095        } else {
     
    21412137    char *tmp1 = NULL;
    21422138    char *mds = NULL;
     2139    char p[8*MAX_STR_LEN];
    21432140    char *sz_size;
    21442141    char *command;
     
    26582655        mr_asprintf(&tmp, "%s", list_of_NETFS_mounts_only());
    26592656        if (strlen(tmp) > 2) {
    2660             if (bkpinfo->exclude_paths[0]) {
    2661                 strcat(bkpinfo->exclude_paths, " ");
    2662             }
    2663             strncpy(bkpinfo->exclude_paths, tmp, MAX_STR_LEN);
     2657            mr_strcat(bkpinfo->exclude_paths, " %s",tmp);
    26642658        }
    26652659        mr_free(tmp);
     
    26772671        }
    26782672
    2679 
    2680         if (!popup_and_get_string
    2681             ("Exclude paths",
    2682              "Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.",
    2683              bkpinfo->exclude_paths, (4*MAX_STR_LEN)-1)) {
     2673        strncpy(p,bkpinfo->exclude_paths,(8*MAX_STR_LEN)-1);
     2674        popup_and_get_string("Exclude paths", "Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", p, (8*MAX_STR_LEN)-1);
     2675        if (p == NULL) {
    26842676            log_to_screen("User has chosen not to backup the PC");
    26852677            finish(1);
    26862678        }
    2687         /* Always needs to be finished by a space */
    2688         if (bkpinfo->exclude_paths[0]) {
    2689             strcat(bkpinfo->exclude_paths, " ");
    2690         }
     2679        mr_free(bkpinfo->exclude_paths);
     2680        mr_asprintf(&tmp, "%s", p);
     2681        bkpinfo->exclude_paths = tmp;
     2682
    26912683        if (!popup_and_get_string
    26922684            ("Temporary directory",
Note: See TracChangeset for help on using the changeset viewer.