Changeset 3880 in MondoRescue


Ignore:
Timestamp:
Mar 9, 2024, 3:05:43 PM (3 months ago)
Author:
Bruno Cornec
Message:

Change semantic of -w option for mondoarchive by using it to indicate that we want to wipe media before writing

Location:
branches/3.3/mondo/src/common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mondo/src/common/libmondo-cli.c

    r3879 r3880  
    205205    i = flag_set['c'] + flag_set['i'] + flag_set['n'] +
    206206        flag_set['t'] + flag_set['u'] + flag_set['r'] +
    207         flag_set['w'] + flag_set['C'] + flag_set['U'];
     207        flag_set['C'] + flag_set['U'];
    208208    if ((i == 0) && (! bkpinfo->restore_data)) {
    209209        retval++;
     
    311311    }
    312312
    313     if (g_kernel_version >= 2.6 && !flag_set['d'] && (flag_set['c'] || flag_set['w']) && (! bkpinfo->restore_data)) {
     313    if (g_kernel_version >= 2.6 && !flag_set['d'] && flag_set['c'] && (! bkpinfo->restore_data)) {
    314314        fatal_error("If you are using the 2.6.x kernel, please specify the CD-R(W) device.");
    315315    }
     
    325325    }
    326326
    327     if ((flag_set['c'] || flag_set['w'] || flag_set['C'] || flag_set['r']) && (! bkpinfo->restore_data)) {
     327    if ((flag_set['c'] || flag_set['C'] || flag_set['r']) && (! bkpinfo->restore_data)) {
    328328        if (system("which cdrecord > /dev/null 2> /dev/null") && system("which dvdrecord > /dev/null 2> /dev/null")) {
    329329            fatal_error("Please install dvdrecord/cdrecord and try again.");
     
    341341        } else {
    342342            log_msg(3, "flag_val['c'] = %s", flag_val['c']);
    343             log_msg(3, "flag_val['w'] = %s", flag_val['w']);
    344343            if (flag_set['c']) {
    345344                bkpinfo->cdrw_speed = atoi(flag_val['c']);
    346             } else if (flag_set['w']) {
    347                 bkpinfo->cdrw_speed = atoi(flag_val['w']);
    348345            } else if (flag_set['r']) {
    349346                bkpinfo->cdrw_speed = 1;    /*atoi(flag_val['r']); */
     
    426423        if (flag_set['w']) {
    427424            bkpinfo->wipe_media_first = TRUE;
    428         }                       /* CD-RW */
     425        }                       /* DVD/CD-RW */
    429426    }
    430427
     
    740737    }
    741738
    742     if (!flag_set['d'] && (flag_set['c'] || flag_set['w'] || flag_set['C'])) {
     739    if (!flag_set['d'] && (flag_set['c'] || flag_set['C'])) {
    743740            tmp1 = mr_popup_and_get_string("Device", "Please specify the device", bkpinfo->media_device);
    744741            if (tmp1 == NULL) {
  • branches/3.3/mondo/src/common/libmondo-tools.c

    r3879 r3880  
    488488            mr_asprintf(extra_cdrom_params, "-waiti ");
    489489        }
    490         mr_asprintf(extra_cdrom_params, "%s", "blank=fast ");
     490        if (bkpinfo->wipe_media_first) {
     491            mr_asprintf(extra_cdrom_params, "%s", "blank=fast ");
     492        }
    491493        if ((cdr_exe = find_home_of_exe("cdrecord")) == NULL) {
    492494            if ((cdr_exe = find_home_of_exe("wodim")) == NULL) {
  • branches/3.3/mondo/src/common/mondostructures.h

    r3875 r3880  
    598598
    599599  /**
    600    * If TRUE, then pass cdrecord the argument "blank=fast" to wipe the CDs before
    601    * writing to them. This has no effect for DVDs.
     600   * If TRUE, then pass cdrecord the argument "blank=fast" to wipe the media before
     601   * writing to them.
    602602   */
    603603    bool wipe_media_first;
Note: See TracChangeset for help on using the changeset viewer.