Changeset 1638 in MondoRescue for branches/stable/mondo/src/mondorestore


Ignore:
Timestamp:
Sep 19, 2007, 9:32:00 AM (18 years ago)
Author:
Bruno Cornec
Message:

Continue to use configuration file data (may not compile)

Location:
branches/stable/mondo/src/mondorestore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondorestore/mondo-rstr-compare.c

    r1633 r1638  
    230230    char *archiver_exe = NULL;
    231231    char *compressor_exe = NULL;
     232#ifdef __FreeBSD__
     233    long BUFSIZE=512L;
     234#else
     235    long BUFSIZE=(1024L*1024L)/mr_conf->external_tape_blexternal_tape_blocksize;
     236#endif
     237
    232238
    233239    use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE;
     
    271277    }
    272278
    273 #ifdef __FreeBSD__
    274 #define BUFSIZE 512L
    275 #else
    276 #define BUFSIZE (1024L*1024L)/TAPE_BLOCK_SIZE
    277 #endif
    278 
    279279    mr_asprintf(&logfile, "/tmp/afio.log.%d", current_tarball_number);
    280280    if (use_star)               // doesn't use compressor_exe
     
    287287                "%s -r -b %ld -M 16m -c %ld %s %s >> %s 2>> %s",
    288288                archiver_exe,
    289                 TAPE_BLOCK_SIZE,
     289                mr_conf->external_tape_blocksize,
    290290                BUFSIZE, compressor_exe, tarball_fname, logfile, logfile);
    291291    }
    292 #undef BUFSIZE
    293292    mr_free(archiver_exe);
    294293    mr_free(compressor_exe);
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r1629 r1638  
    886886                bkpinfo->internal_tape_block_size);
    887887    } else {
    888         bkpinfo->internal_tape_block_size =
    889             DEFAULT_INTERNAL_TAPE_BLOCK_SIZE;
    890         mr_msg(1, "Internal tape block size = default (%ld)",
    891                 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE);
     888        bkpinfo->internal_tape_block_size = mr_conf->internal_tape_blocksize;
     889        mr_msg(1, "Internal tape block size = default (%ld)", mr_conf->internal_tape_blocksize);
    892890    }
    893891
  • branches/stable/mondo/src/mondorestore/mondorestore.c

    r1628 r1638  
    438438    read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo);
    439439    iamhere("Done loading config file; resizing ML");
     440    mr_asprintf(&tmp,bkpinfo->prefix);
    440441    if (popup_and_get_string
    441         ("Prefix", "Prefix of your ISO images ?", bkpinfo->prefix, MAX_STR_LEN / 4)) {
     442        ("Prefix", "Prefix of your ISO images ?", tmp, MAX_STR_LEN / 4)) {
     443        mr_free(bkpinfo->prefix);
     444        bkpinfo->prefix = tmp;
    442445        mr_msg(1, "Prefix set to %s",bkpinfo->prefix);
    443446    }
     
    10381041
    10391042    pathname_of_last_file_restored[0] = '\0';
    1040     bigblk = mr_malloc(TAPE_BLOCK_SIZE);
     1043    bigblk = mr_malloc(mr_conf->external_tape_blocksize);
    10411044
    10421045    if (!(fin = fopen(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""), "r"))) {
     
    12491252
    12501253            while (!feof(fbzip2)) {
    1251                 siz = fread(bigblk, 1, TAPE_BLOCK_SIZE, fbzip2);
     1254                siz = fread(bigblk, 1, mr_conf->external_tape_blocksize, fbzip2);
    12521255                if (siz > 0) {
    12531256                    siz = fwrite(bigblk, 1, siz, fout);
     
    15671570    char *xattr_fname = NULL;
    15681571    char *acl_fname = NULL;
     1572#ifdef __FreeBSD__
     1573    long BUFSIZE=512L;
     1574#else
     1575    long BUFSIZE=(1024L*1024L)/mr_conf->external_tape_blocksize;
     1576#endif
     1577
    15691578
    15701579    assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
     
    16511660            mr_free(tmp);
    16521661        }
    1653 #ifdef __FreeBSD__
    1654 #define BUFSIZE 512
    1655 #else
    1656 #define BUFSIZE (1024L*1024L)/TAPE_BLOCK_SIZE
    1657 #endif
    1658 
    16591662        if (use_star) {
    16601663            mr_asprintf(&command,
     
    16681671                mr_asprintf(&command,
    16691672                        "afio -i -M 8m -b %ld -c %ld %s -w '%s' %s",
    1670                         TAPE_BLOCK_SIZE,
     1673                        mr_conf->external_tape_blocksize,
    16711674                        BUFSIZE, executable, filelist_subset_fname,
    16721675                        tarball_fname);
     
    16741677                mr_asprintf(&command,
    16751678                        "afio -i -b %ld -c %ld -M 8m %s %s",
    1676                         TAPE_BLOCK_SIZE,
     1679                        mr_conf->external_tape_blocksize,
    16771680                        BUFSIZE, executable, tarball_fname);
    16781681            }
     
    16801683        mr_free(executable);
    16811684
    1682 #undef BUFSIZE
    16831685        mr_asprintf(&temp_log, "/tmp/%d.%d", (int) (random() % 32768),
    16841686            (int) (random() % 32768));
     
    18411843        } else {
    18421844            use_star = FALSE;
    1843             mr_asprintf(&command, "afio -t -M 8m -b %ld %s %s", TAPE_BLOCK_SIZE,
     1845            mr_asprintf(&command, "afio -t -M 8m -b %ld %s %s", mr_conf->external_tape_blocksize,
    18441846                    executable, afio_fname);
    18451847        }
     
    18831885        // afio
    18841886        if (filelist) {
    1885             mr_asprintf(&command, "afio -i -M 8m -b %ld %s -w %s %s 2>> %s", TAPE_BLOCK_SIZE, executable, filelist_subset_fname, afio_fname, MONDO_LOGFILE);
     1887            mr_asprintf(&command, "afio -i -M 8m -b %ld %s -w %s %s 2>> %s", mr_conf->external_tape_blocksize, executable, filelist_subset_fname, afio_fname, MONDO_LOGFILE);
    18861888        } else {
    1887             mr_asprintf(&command, "afio -i -M 8m -b %ld %s %s 2>> %s", TAPE_BLOCK_SIZE, executable, afio_fname, MONDO_LOGFILE);
     1889            mr_asprintf(&command, "afio -i -M 8m -b %ld %s %s 2>> %s", mr_conf->external_tape_blocksize, executable, afio_fname, MONDO_LOGFILE);
    18881890        }
    18891891    }
Note: See TracChangeset for help on using the changeset viewer.