Changeset 489 in MondoRescue for trunk/mondo/mondo/mondoarchive/mondo-cli.c


Ignore:
Timestamp:
Apr 19, 2006, 11:02:43 AM (18 years ago)
Author:
bcornec
Message:

svn merge -r 463:482 $SVN_M/branches/stable
svn merge -r 485:488 $SVN_M/branches/stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/mondoarchive/mondo-cli.c

    r300 r489  
    217217    char *tmp;
    218218    char *tmp2;
     219    char *tmp1;
    219220    char *psz;
    220221
     
    300301            strcat(bkpinfo->include_paths, " ");
    301302        }
    302         if (stat(flag_val['I'], &buf) != 0) {
    303             log_msg("ERROR ! %s doesn't exist", flag_val['I']);
    304             fatal_error("ERROR ! You specified a directory to include which doesn't exist");
    305         }
     303        asprintf(&tmp1, flag_val['I']);
     304        char *p = tmp1;
     305        char *q = tmp1;
     306
     307        /* Cut the flag_val['I'] in parts containing all paths to test them */
     308        while (p != NULL) {
     309            q = strchr(p, ' ');
     310            if (q != NULL) {
     311                *q = '\0';
     312                p = q+1 ;
     313                if (stat(p, &buf) != 0) {
     314                    log_msg(1, "ERROR ! %s doesn't exist", p);
     315                    fatal_error("ERROR ! You specified a directory to include which doesn't exist");
     316                }
     317            } else {
     318                if (stat(p, &buf) != 0) {
     319                    log_msg(1, "ERROR ! %s doesn't exist", p);
     320                    fatal_error("ERROR ! You specified a directory to include which doesn't exist");
     321                }
     322                p = NULL;
     323            }
     324        }
     325        paranoid_free(tmp1);
     326
    306327        strncpy(bkpinfo->include_paths + strlen(bkpinfo->include_paths),
    307328                flag_val['I'],
     
    516537            strcat(bkpinfo->exclude_paths, " ");
    517538        }
    518         if (stat(flag_val['E'], &buf) != 0) {
    519             log_msg(1, "WARNING ! %s doesn't exist", flag_val['E']);
    520         }
     539        asprintf(&tmp1, flag_val['E']);
     540        char *p = tmp1;
     541        char *q = tmp1;
     542
     543        /* Cut the flag_val['E'] in parts containing all paths to test them */
     544        while (p != NULL) {
     545            q = strchr(p, ' ');
     546            if (q != NULL) {
     547                *q = '\0';
     548                p = q+1 ;
     549                if (stat(p, &buf) != 0) {
     550                    log_msg(1, "WARNING ! %s doesn't exist", p);
     551                }
     552            } else {
     553                if (stat(p, &buf) != 0) {
     554                    log_msg(1, "WARNING ! %s doesn't exist", p);
     555                }
     556                p = NULL;
     557            }
     558        }
     559        paranoid_free(tmp1);
     560
    521561        strncpy(bkpinfo->exclude_paths + strlen(bkpinfo->exclude_paths),
    522562                flag_val['E'],
     
    763803        &&
    764804        !run_program_and_log_output
    765         ("grep -i suse /etc/issue.net | grep 64", TRUE)) {
     805        ("egrep -i suse /etc/issue.net | egrep '9.0' | grep 64", TRUE)) {
    766806        bkpinfo->make_cd_use_lilo = TRUE;
    767807        log_to_screen
Note: See TracChangeset for help on using the changeset viewer.