Changeset 839 in MondoRescue for trunk/mondo/src/common/libmondo-filelist.c


Ignore:
Timestamp:
Sep 26, 2006, 9:47:32 AM (18 years ago)
Author:
Bruno Cornec
Message:

merge -r814:838 $SVN_M/branches/stable

File:
1 edited

Legend:

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

    r795 r839  
    1717#include "newt-specific-EXT.h"
    1818#include "libmondo-tools-EXT.h"
    19 
     19#include "mr_string.h"
    2020
    2121#include <time.h>
     
    13181318                      char *skeleton_filelist)
    13191319{
     1320    const char delims[] = " ";
    13201321    DIR *dip = NULL;
    13211322    struct dirent *dit = NULL;
     1323
    13221324    struct stat statbuf;
    13231325    char *new = NULL;
     
    13291331    static char *name_of_evalcall_form = NULL;
    13301332    int i = 0;
     1333    char *strtmp = NULL;
     1334    char *token = NULL;
     1335    char *find_excludes = NULL;
     1336    int lastpos = 0;
    13311337    static int depth = 0;
    13321338    char *p = NULL;
     
    13471353    if (!depth) {
    13481354        malloc_string(find_skeleton_marker);
     1355        asprintf(&find_excludes, " ");
     1356        while((token = mr_strtok (sth, delims, &lastpos))) {
     1357          asprintf(&strtmp,"%s", find_excludes);
     1358          paranoid_free(find_excludes);
     1359          asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token);
     1360          paranoid_free(strtmp);
     1361          paranoid_free(token);
     1362        }
    13491363#if linux
    13501364        // 2.6 has /sys as a proc-type thing -- must be excluded
    1351         asprintf(&tmp,
    1352                 "find %s -maxdepth %d -fstype mvfs -prune -o -fstype afs -prune -o -path /proc -prune -o -path /sys -prune -o -path /dev/shm -prune -o -path /media/floppy -prune -o -type d -a -print > %s 2> /dev/null",
    1353                  dir, MAX_SKEL_DEPTH, skeleton_filelist);
     1365        asprintf(&strtmp,
     1366             "find %s -maxdepth %d -fstype mvfs -prune -o -path /dev/shm -prune -o %s -type d -print > %s 2> /dev/null",
     1367             dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);
    13541368#else
    13551369        // On BSD, for example, /sys is the kernel sources -- don't exclude
    1356         asprintf(&tmp,
    1357                 "find %s -maxdepth %d -fstype mvfs -prune -o -fstype afs -prune -o -path /proc -prune -o -type d -a -print > %s 2> /dev/null",
    1358                  dir, MAX_SKEL_DEPTH, skeleton_filelist);
     1370        asprintf(&strtmp,
     1371             "find %s -maxdepth %d -fstype mvfs -prune -o -path /proc -prune -o %s -type d -print > %s 2> /dev/null",
     1372                dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);
     1373>>>>>>> .merge-right.r838
    13591374#endif
    1360         system(tmp);
     1375        paranoid_free(find_excludes);
     1376        log_msg(5, "find command = %s", strtmp);
     1377        system(strtmp);
     1378        paranoid_free(strtmp);
    13611379        paranoid_free(tmp);
    13621380
Note: See TracChangeset for help on using the changeset viewer.