Changeset 2933 in MondoRescue


Ignore:
Timestamp:
Jan 24, 2012, 7:09:40 PM (12 years ago)
Author:
Bruno Cornec
Message:
  • Fix #578 by improving the regexp used for CD/DVD detection with -scanbus option
  • Adds more verbosity when LVM creation fails.
Location:
branches/3.0/mondo/src
Files:
2 edited

Legend:

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

    r2931 r2933  
    559559    if (find_home_of_exe(cdr_exe)) {
    560560        sprintf(command,
    561                 "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep CD | cut -d' ' -f2 | head -n1",
     561                "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep '[D|C][V|D]' | cut -d' ' -f2 | head -n1",
    562562                cdr_exe);
    563563        mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output(command));
     
    916916
    917917    sprintf(tmp, "%s", call_program_and_get_last_line_of_output
    918             ("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1")
     918            ("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep -E '[D|C][V|D]' | cut -d':' -f1")
    919919        );
    920920    log_msg(5, "tmp = '%s'", tmp);
    921921    if (!tmp[0])
    922922        sprintf(tmp, "%s", call_program_and_get_last_line_of_output
    923                 ("cdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1")
     923                ("cdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep -E '[D|C][V|D]' | cut -d':' -f1")
    924924            );
    925925    if (tmp[0]) {
  • branches/3.0/mondo/src/mondorestore/mondo-prep.c

    r2932 r2933  
    320320        res = run_program_and_log_output(command, 5);
    321321        if (res > 0 && (p = strstr(command, "lvm "))) {
     322            log_msg(0, "%s --> %d failed so removing lvm just in case", command, res);
    322323            *p = *(p + 1) = *(p + 2) = ' ';
    323324            res = run_program_and_log_output(command, 5);
Note: See TracChangeset for help on using the changeset viewer.