Ignore:
Timestamp:
Jun 19, 2013, 8:34:46 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • First pass on svn merge -r 2935:3146 ../3.0
File:
1 edited

Legend:

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

    r2937 r3147  
    331331    char *searchstr = NULL;
    332332    char *tmp = NULL;
     333    char *p;
    333334
    334335    /*@ ints ******************************************************* */
     
    816817    }
    817818
    818     mr_asprintf(command, "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", cdr_exe, g_cdrw_drive_is_here);
     819    mr_asprintf(command, "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep -E \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", cdr_exe, g_cdrw_drive_is_here);
    819820    mr_free(cdr_exe);
    820821
     
    848849    }
    849850
    850     tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE);
     851    tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep -E '\)\ \'' | grep -n '' | grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE);
    851852    log_msg(5, "tmp = '%s'", tmp);
    852853    if (!tmp[0])
    853854        mr_free(tmp);
    854         tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE);
     855        tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \)\ \' | grep -n '' | grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE);
    855856    if (tmp[0]) {
    856857        devno = atoi(tmp) - 1;
     
    886887#if linux
    887888    unsigned long long s = 0;
    888     int fileid, cylinders = 0, cylindersleft = 0;
     889    int fileid, cylinders = 0;
    889890    int cylindersize = 0;
    890891    int gotgeo = 0;
     
    935936            if (ioctl(fileid, HDIO_GETGEO, &hdgeo) != -1) {
    936937                if (hdgeo.cylinders && hdgeo.heads && hdgeo.sectors) {
    937                     cylindersleft = cylinders = hdgeo.cylinders;
    938938                    cylindersize = hdgeo.heads * hdgeo.sectors / 2;
    939939                    outvalA = cylindersize * cylinders / 1024;
     
    983983    char *command = NULL;
    984984    char *format_sz = NULL;
     985    char *p;
    985986
    986987    FILE *pin;
     
    18221823
    18231824        /* Check for LVM */
    1824         mr_asprintf(command, "pvdisplay -c %s | grep '%s:' 2> /dev/null", partitions[i], partitions[i]);
     1825        mr_asprintf(command, "pvdisplay -c %s 2> /dev/null", partitions[i]);
    18251826        log_msg(5, "  Running: %s", command);
    18261827        tmp = call_program_and_get_last_line_of_output(command,TRUE);
     
    26382639    char *p = NULL;
    26392640    char *q = NULL;
     2641    char *tmpro = NULL;
     2642    char *tmp1 = NULL;
    26402643    char *mds = NULL;
    26412644    char *sz_size = NULL;
     
    28732876            bkpinfo->media_size[i] = bkpinfo->media_size[0];
    28742877        }
     2878        bkpinfo->use_obdr = ask_me_yes_or_no
     2879            ("Do you want to activate OBDR support for your tapes ?");
     2880        if (bkpinfo->use_obdr) {
     2881            log_msg(4, "obdr mode = TRUE");
     2882        } else {
     2883            log_msg(4, "obdr mode = FALSE");
     2884        }
    28752885        if (archiving_to_media) {
    28762886            if ((compression_type = which_compression_type()) == NULL) {
     
    29682978        if (bkpinfo->disaster_recovery) {
    29692979            mr_asprintf(command ,"umount %s/isodir 2> /dev/null", bkpinfo->tmpdir);
    2970             (void)system(command);
     2980            paranoid_system(command);
    29712981            mr_free(command);
    29722982
    29732983        }
    2974         p = popup_and_get_string("Network protocol", "Which Network protocol should I use?", bkpinfo->netfs_proto);
     2984<<<<<<< .courant
     2985        p = popup_and_get_string("Network protocol", "Which Network protocol should I use (nfs/sshfs/smbfs) ?", bkpinfo->netfs_proto);
    29752986        if (p == NULL) {
    29762987            log_to_screen("User has chosen not to backup the PC");
     
    30163027
    30173028            if (bkpinfo->restore_data) {
     3029                /*  mount th FS read-only in restore mode to avoid any erase of whatever */
     3030                mr_asprintf(tmpro, "-o ro");
     3031            } else {
     3032                mr_asprintf(tmpro, "");
     3033            }
     3034
     3035            /*  Build the mount string */
     3036            if (strstr(bkpinfo->netfs_proto, "smbfs")) {
     3037                mr_asprintf(tmp, "mount -t cifs %s %s %s",bkpinfo->netfs_mount, bkpinfo->isodir,tmpro);
     3038                if (bkpinfo->netfs_user) {
     3039                    mr_strcat(tmp, " -o user=%s", bkpinfo->netfs_user);
     3040                }
     3041            else {
    30183042                if (strstr(bkpinfo->netfs_proto, "sshfs")) {
    3019                     mr_asprintf(tmp, "sshfs -o ro");
     3043                    mr_asprintf(tmp, "sshfs %s ",tmpro);
    30203044                } else {
    3021                     mr_asprintf(tmp, "mount -t %s -o nolock,ro", bkpinfo->netfs_proto);
     3045                    mr_asprintf(tmp, "mount -t %s -o nolock %s ", bkpinfo->netfs_proto,tmpro);
    30223046                }
    3023             } else {
    3024                 if (strstr(bkpinfo->netfs_proto, "sshfs")) {
    3025                     mr_asprintf(tmp, "sshfs");
    3026                 } else {
    3027                     mr_asprintf(tmp, "mount -t %s -o nolock", bkpinfo->netfs_proto);
     3047                if (bkpinfo->netfs_user) {
     3048                    mr_strcat(tmp, "%s@", bkpinfo->netfs_user);
    30283049                }
    3029             }
    3030             if (bkpinfo->netfs_user) {
    3031                 mr_strcat(tmp, "%s@", bkpinfo->netfs_user);
    3032             }
    3033             mr_strcat(tmp, "%s %s", bkpinfo->netfs_mount, bkpinfo->isodir);
     3050                mr_strcat(tmp, "%s %s", bkpinfo->netfs_mount, bkpinfo->isodir);
     3051            }
    30343052            run_program_and_log_output(tmp, 3);
    30353053            mr_free(tmp);
     
    30373055            malloc_string(g_selfmounted_isodir);
    30383056            strcpy(g_selfmounted_isodir, bkpinfo->isodir);
     3057            }
    30393058        }
    30403059        if (!is_this_device_mounted(bkpinfo->netfs_mount)) {
     
    31933212        }
    31943213
    3195 
    31963214        p = popup_and_get_string("Exclude paths", "Please enter paths which you do NOT want to backup. Separate them with '|'. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", bkpinfo->exclude_paths);
    31973215        if (p == NULL) {
Note: See TracChangeset for help on using the changeset viewer.