Changeset 2937 in MondoRescue for branches/3.1/mondo/src/common/libmondo-devices.c
- Timestamp:
- Jan 28, 2012, 1:51:28 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mondo/src/common/libmondo-devices.c
r2850 r2937 94 94 { 95 95 // log_it("rctada: Retracting all CD trays", __LINE__); 96 if (strlen(g_cdrom_drive_is_here) > 0) { 97 inject_device(g_cdrom_drive_is_here); 98 } 99 if (strlen(g_dvd_drive_is_here) > 0) { 100 inject_device(g_dvd_drive_is_here); 101 } 102 if (strlen(g_cdrw_drive_is_here) > 0) { 103 inject_device(g_cdrw_drive_is_here); 96 if (!bkpinfo->please_dont_eject) { 97 if (strlen(g_cdrom_drive_is_here) > 0) { 98 inject_device(g_cdrom_drive_is_here); 99 } 100 if (strlen(g_dvd_drive_is_here) > 0) { 101 inject_device(g_dvd_drive_is_here); 102 } 103 if (strlen(g_cdrw_drive_is_here) > 0) { 104 inject_device(g_cdrw_drive_is_here); 105 } 104 106 } 105 107 // log_it("rctada: killing autorun"); … … 537 539 tmp1 = find_home_of_exe(cdr_exe); 538 540 if (tmp1) { 539 mr_asprintf(command, "%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", cdr_exe);541 mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -E '[D|C][V|D]' | cut -d' ' -f2 | head -n1", cdr_exe); 540 542 tmp = call_program_and_get_last_line_of_output(command,TRUE); 541 543 mr_free(command); … … 846 848 } 847 849 848 tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD| cut -d':' -f1",TRUE);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); 849 851 log_msg(5, "tmp = '%s'", tmp); 850 852 if (!tmp[0]) 851 853 mr_free(tmp); 852 tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD| cut -d':' -f1",TRUE);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); 853 855 if (tmp[0]) { 854 856 devno = atoi(tmp) - 1; … … 1448 1450 if ((res = what_number_cd_is_this()) != cd_number_i_want) { 1449 1451 log_msg(3, "Currently, we hold %d but we want %d", res, cd_number_i_want); 1452 1453 /* Now we need to umount the current media to have the next mounted after */ 1454 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 1455 log_msg(3, "Mounting next media %d",cd_number_i_want); 1456 g_current_media_number = cd_number_i_want; 1457 mount_media(); 1458 1450 1459 mds = media_descriptor_string(bkpinfo->backup_media_type); 1451 1460 log_msg(3, "Insisting on %s #%d", mds, cd_number_i_want); … … 1457 1466 if (is_this_device_mounted(MNT_CDROM)) { 1458 1467 res = 1459 run_program_and_log_output("umount " MNT_CDROM, FALSE);1468 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 1460 1469 } else { 1461 1470 res = 0; … … 1995 2004 char *tmp = NULL; 1996 2005 char *tmp1 = NULL; 2006 char *tmp2 = NULL; 1997 2007 1998 2008 if (pathlist == NULL) { … … 2052 2062 /* Adds a | to ensure correct detection even at both ends */ 2053 2063 mr_asprintf(tmp1,"|%s",token); 2064 mr_asprintf(&tmp2,"|%s|",token); 2054 2065 if (mode == 'E') { 2055 2066 /* Add the token if not already in the list */ 2056 2067 mr_asprintf(tmp,"|%s|",bkpinfo->exclude_paths); 2057 if (strstr(tmp,tmp 1) == NULL) {2068 if (strstr(tmp,tmp2) == NULL) { 2058 2069 if (bkpinfo->exclude_paths) { 2059 2070 mr_strcat(bkpinfo->exclude_paths,tmp1); … … 2066 2077 /* Add the token if not already in the list */ 2067 2078 mr_asprintf(tmp,"|%s|",bkpinfo->include_paths); 2068 if (strstr(tmp,tmp 1) == NULL) {2079 if (strstr(tmp,tmp2) == NULL) { 2069 2080 mr_strcat(bkpinfo->include_paths, "%s", tmp1); 2070 2081 } … … 2072 2083 } 2073 2084 mr_free(tmp); 2085 mr_free(tmp2); 2074 2086 break; 2075 2087 }
Note:
See TracChangeset
for help on using the changeset viewer.