Ignore:
Timestamp:
Feb 2, 2011, 1:18:23 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Document in man page and HOWTO the previous syntax modifications for -E/-I options and '|' separator
  • Fix #444. mondoarchive now supports inclusion/exclusion of dirs with spaces in their name. this required a syntax change for the -E/-I options where the list of dirs needs to be separated by '|' now instead of ' '.
  • Fix issus with mindi when launched from a dir containing spaces
  • Fix a but when no -E option is give on CLI (null) string generated
  • Fix #459 by correcting an old README containing info on the edit-mountlist binary which doesn't exist.

svn merge -r 2709:2714 svn+ssh://bruno@svn.mondorescue.org/mondo/svn/mondorescue/branches/2.2.9 .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-filelist.c

    r2704 r2715  
    12831283    mr_asprintf(sz_res, "%s", incoming);
    12841284    p = sz_res;
    1285     while ((*p != ' ' || in_quotes) && *p != '\0') {
     1285    while ((*p != '|' || in_quotes) && *p != '\0') {
    12861286        if (*p == '\"') {
    12871287            in_quotes = !in_quotes;
     
    13111311int open_and_list_dir(char *dir1, char *sth, FILE * fout, time_t time_of_last_full_backup) {
    13121312
    1313     const char delims[] = " ";
     1313    const char delims[] = "|";
    13141314
    13151315    DIR *dip;
     
    13221322    static int percentage = 0;
    13231323    char *skip_these = NULL;
    1324     char *new_with_spaces = NULL;
     1324    char *new_with_pipe;
    13251325    char *strtmp;
    13261326    char *token;
     
    13471347        }
    13481348    }
     1349    mr_asprintf(&find_excludes, "|");
    13491350
    13501351    if (!depth) {
    1351         mr_asprintf(find_excludes, " ");
     1352        mr_asprintf(find_excludes, "|");
    13521353        if (sth != NULL) {
    13531354            while((token = mr_strtok(sth, delims, &lastpos))) {
     
    14171418
    14181419//  log_msg(0, "Cataloguing %s", dir);
    1419     if (sth[0] == ' ') {
    1420         mr_asprintf(skip_these, "%s", sth);
    1421     } else {
    1422         mr_asprintf(skip_these, " %s ", sth);
    1423     }
    1424     mr_asprintf(new_with_spaces, " %s ", dir1);
     1420    mr_asprintf(skip_these, "|%s|", sth);
     1421    mr_asprintf(new_with_pipe, "|%s|", dir1);
    14251422    if ((dip = opendir(dir1)) == NULL) {
    14261423        mr_asprintf(tmp,"opendir %s", dir1);
    14271424        log_OS_error(tmp);
    14281425        mr_free(tmp);
    1429     } else if (strstr(skip_these, new_with_spaces)) {
     1426    } else if (strstr(skip_these, new_with_pipe)) {
    14301427        log_msg(10, "Found dir ***%s**** excluded", dir1);
    14311428        fprintf(fout, "%s\n", dir1);    // if excluded dir then print dir ONLY
     
    14401437                mr_asprintf(new,"%s%s",dir1,dit->d_name);
    14411438            }
    1442             mr_free(new_with_spaces);
    1443             mr_asprintf(new_with_spaces, " %s ", new);
    1444             if (strstr(skip_these, new_with_spaces)) {
     1439            mr_free(new_with_pipe);
     1440            mr_asprintf(new_with_spaces, "|%s|", new);
     1441            if (strstr(skip_these, new_with_pipe)) {
    14451442                fprintf(fout, "%s\n", new);
    14461443                log_msg(10, "Found child dir ***%s**** excluded", new);
    1447                 mr_free(new_with_spaces);
     1444                mr_free(new_with_pipe);
    14481445            } else {
    1449                 mr_free(new_with_spaces);
     1446                mr_free(new_with_pipe);
    14501447                if (!lstat(new, &statbuf)) {
    14511448                    if (!S_ISLNK(statbuf.st_mode)
     
    14741471        }
    14751472    }
    1476     mr_free(new_with_spaces);
     1473    mr_free(new_with_pipe);
    14771474    mr_free(skip_these);
    14781475    mr_free(dir);
     
    15841581        mr_free(tmp1);
    15851582
    1586         mr_asprintf(exclude_paths, " %s %s %s %s %s . ..  " MNT_CDROM " " MNT_FLOPPY " /media /tmp  /proc /sys /dev/shm " MINDI_CACHE, MONDO_CACHE, (excp == NULL) ? "" : excp, tmp2, (bkpinfo->tmpdir[0] == '/' && bkpinfo->tmpdir[1] == '/') ? (bkpinfo->tmpdir + 1) : bkpinfo->tmpdir, (bkpinfo->scratchdir[0] == '/' && bkpinfo->scratchdir[1] == '/') ? (bkpinfo->scratchdir + 1) : bkpinfo->scratchdir);
    1587         mr_free(tmp2);
     1583        mr_asprintf(exclude_paths, MONDO_CACHE"|%s|%s|%s|%s|.|..|"MNT_CDROM"|"MNT_FLOPPY"|/media|/tmp|/proc|/sys|/dev/shm|"MINDI_CACHE,(excp == NULL) ? "" : excp, tmp2, (bkpinfo->tmpdir[0] == '/' && bkpinfo->tmpdir[1] == '/') ? (bkpinfo->tmpdir + 1) : bkpinfo->tmpdir, (bkpinfo->scratchdir[0] == '/' && bkpinfo->scratchdir[1] == '/') ? (bkpinfo->scratchdir + 1) : bkpinfo->scratchdir);
    15881584
    15891585        log_msg(2, "Excluding paths = '%s'", exclude_paths);
     
    16101606                p += strlen(q);
    16111607                paranoid_free(q);
    1612                 while (*p == ' ') {
     1608                while (*p == '|') {
    16131609                    p++;
    16141610                }
Note: See TracChangeset for help on using the changeset viewer.