Changeset 3827 in MondoRescue


Ignore:
Timestamp:
Mar 4, 2024, 1:33:29 PM (4 months ago)
Author:
Bruno Cornec
Message:

manages call_make|burn|after_iso dynamically

Location:
branches/3.3/mondo/src
Files:
6 edited

Legend:

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

    r3826 r3827  
    16051605    }
    16061606
    1607     if (bkpinfo->call_make_iso[0] != '\0') {
     1607    if (bkpinfo->call_make_iso != NULL) {
    16081608        log_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso);
    16091609        mds = media_descriptor_string(bkpinfo->backup_media_type);
     
    17791779    }
    17801780
    1781     if (bkpinfo->call_burn_iso[0] != '\0') {
     1781    if (bkpinfo->call_burn_iso != NULL) {
    17821782        log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso);
    17831783        mds = media_descriptor_string(bkpinfo->backup_media_type);
     
    17971797    }
    17981798
    1799     if (bkpinfo->call_after_iso[0] != '\0') {
     1799    if (bkpinfo->call_after_iso != NULL) {
    18001800        mds = media_descriptor_string(bkpinfo->backup_media_type);
    18011801        mr_asprintf(message_to_screen, "Running post-ISO call (%s #%d)", mds, g_current_media_number);
  • branches/3.3/mondo/src/common/libmondo-cli.c

    r3826 r3827  
    792792
    793793    if ((flag_set['A']) && (! bkpinfo->restore_data)) {
    794         strncpy(bkpinfo->call_after_iso, flag_val['A'], MAX_STR_LEN);
     794        mr_asprintf(bkpinfo->call_after_iso, "%s", flag_val['A']);
    795795    }
    796796
  • branches/3.3/mondo/src/common/libmondo-tools.c

    r3826 r3827  
    470470            // -m isn't supported by growisofs, BTW...
    471471        } else {
    472             sprintf(bkpinfo->call_make_iso, "%s %s -Z %s . 2>> _ERR_", mondo_mkisofs_sz, "", bkpinfo->media_device);
     472            mr_asprintf(bkpinfo->call_make_iso, "%s %s -Z %s . 2>> _ERR_", mondo_mkisofs_sz, "", bkpinfo->media_device);
    473473        }
    474474        mr_free(mondo_mkisofs_sz);
     
    546546            }
    547547            log_it("bkpinfo->call_before_iso = %s", bkpinfo->call_before_iso);
    548             sprintf(bkpinfo->call_make_iso, "%s %s -v %s fs=4m dev=%s speed=%d %s/"MONDO_TMPISOS, cdr_exe, (bkpinfo->please_dont_eject) ? " " : "-eject", extra_cdrom_params, bkpinfo->media_device, bkpinfo->cdrw_speed, bkpinfo->tmpdir);
     548            mr_asprintf(bkpinfo->call_make_iso, "%s %s -v %s fs=4m dev=%s speed=%d %s/"MONDO_TMPISOS, cdr_exe, (bkpinfo->please_dont_eject) ? " " : "-eject", extra_cdrom_params, bkpinfo->media_device, bkpinfo->cdrw_speed, bkpinfo->tmpdir);
    549549        } else {
    550             sprintf(bkpinfo->call_make_iso, "%s . 2>> _ERR_ | %s %s %s fs=4m dev=%s speed=%d -", mondo_mkisofs_sz, cdr_exe, (bkpinfo->please_dont_eject) ? " " : "-eject", extra_cdrom_params, bkpinfo->media_device, bkpinfo->cdrw_speed);
     550            mr_asprintf(bkpinfo->call_make_iso, "%s . 2>> _ERR_ | %s %s %s fs=4m dev=%s speed=%d -", mondo_mkisofs_sz, cdr_exe, (bkpinfo->please_dont_eject) ? " " : "-eject", extra_cdrom_params, bkpinfo->media_device, bkpinfo->cdrw_speed);
    551551        }
    552552        mr_free(cdr_exe);
     
    852852    bkpinfo->restore_path[0] = '\0';
    853853    bkpinfo->call_before_iso = NULL;
    854     bkpinfo->call_make_iso[0] = '\0';
    855     bkpinfo->call_burn_iso[0] = '\0';
    856     bkpinfo->call_after_iso[0] = '\0';
     854    bkpinfo->call_make_iso = NULL;
     855    bkpinfo->call_burn_iso = NULL;
     856    bkpinfo->call_after_iso = NULL;
    857857    bkpinfo->kernel_path[0] = '\0';
    858858    bkpinfo->netfs_mount = NULL;
  • branches/3.3/mondo/src/common/mondostructures.h

    r3826 r3827  
    545545   * A command to call to make an ISO image.
    546546   */
    547     char call_make_iso[MAX_STR_LEN];
     547    char *call_make_iso;
    548548
    549549  /**
    550550   * A command to call to burn the ISO image.
    551551   */
    552     char call_burn_iso[MAX_STR_LEN];
     552    char *call_burn_iso;
    553553
    554554  /**
    555555   * A command to call AFTER making an ISO image.
    556556   */
    557     char call_after_iso[MAX_STR_LEN];
     557    char *call_after_iso;
    558558
    559559  /**
  • branches/3.3/mondo/src/common/newt-specific.c

    r3826 r3827  
    431431        mr_free(bkpinfo->media_device);
    432432        mr_free(bkpinfo->postnuke_tarball);
     433        mr_free(bkpinfo->call_burn_iso);
     434        mr_free(bkpinfo->call_make_iso);
     435        mr_free(bkpinfo->call_after_iso);
     436        mr_free(bkpinfo->call_before_iso);
    433437        /* Then free the structure */
    434438        paranoid_free(bkpinfo);
  • branches/3.3/mondo/src/mondoarchive/mondoarchive.c

    r3790 r3827  
    188188        exit(-1);
    189189    }
    190     /*  Now on we can use finish to exit as bkpingo has been initialized */
     190    /*  Now on we can use finish to exit as bkpinfo has been initialized */
    191191    log_msg(9, "reset_bkpinfo");
    192192    reset_bkpinfo();
Note: See TracChangeset for help on using the changeset viewer.