Changeset 998 in MondoRescue for branches/stable/mondo/src/common


Ignore:
Timestamp:
Dec 7, 2006, 2:01:34 AM (17 years ago)
Author:
Bruno Cornec
Message:

Attempt to solve #113

Location:
branches/stable/mondo/src/common
Files:
5 edited

Legend:

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

    r949 r998  
    697697    char *command;
    698698    char *use_lzo_sz;
     699    char *use_gzip_sz;
    699700    char *use_comp_sz;
    700701    char *use_star_sz;
     
    727728    malloc_string(scratchdir);
    728729    malloc_string(use_lzo_sz);
     730    malloc_string(use_gzip_sz);
    729731    malloc_string(use_star_sz);
    730732    malloc_string(use_comp_sz);
     
    771773    } else {
    772774        strcpy(use_lzo_sz, "no");
     775    }
     776    if (bkpinfo->use_gzip) {
     777        strcpy(use_gzip_sz, "yes");
     778    } else {
     779        strcpy(use_gzip_sz, "no");
    773780    }
    774781    if (bkpinfo->use_star) {
     
    10031010            "mindi --custom %s %s/images '%s' '%s' \
    10041011'%s' %ld '%s' '%s' '%s' \
    1005 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d", bkpinfo->tmpdir,   // parameter #2
     1012'%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", bkpinfo->tmpdir,  // parameter #2
    10061013            bkpinfo->scratchdir,    // parameter #3
    10071014            bkpinfo->kernel_path,   // parameter #4
     
    10201027            use_star_sz,        // parameter #17
    10211028            bkpinfo->internal_tape_block_size,  // parameter #18 (LONG)
    1022             bkpinfo->differential); // parameter #19 (INT)
     1029            bkpinfo->differential,  // parameter #19 (INT)
     1030            use_gzip_sz);       // parameter #20 (STRING)
    10231031
    10241032// Watch it! This next line adds a parameter...
     
    10751083    paranoid_free(tmp);
    10761084    paranoid_free(use_lzo_sz);
     1085    paranoid_free(use_gzip_sz);
    10771086    paranoid_free(scratchdir);
    10781087    paranoid_free(use_comp_sz);
  • branches/stable/mondo/src/common/libmondo-files.c

    r888 r998  
    13581358    if (bkpinfo->use_lzo) {
    13591359        scratchLL = (scratchLL * 2) / 3;
     1360    else if (bkpinfo->use_gzip) {
     1361        scratchLL = (scratchLL * 2) / 3;
    13601362    } else {
    13611363        scratchLL = scratchLL / 2;
  • branches/stable/mondo/src/common/libmondo-tools.c

    r911 r998  
    649649        strcpy(bkpinfo->zip_exe, "lzop");
    650650        strcpy(bkpinfo->zip_suffix, "lzo");
     651    } else if (bkpinfo->use_gzip) {
     652        strcpy(bkpinfo->zip_exe, "gzip");
     653        strcpy(bkpinfo->zip_suffix, "gz");
    651654    } else if (bkpinfo->compression_level != 0) {
    652655        strcpy(bkpinfo->zip_exe, "bzip2");
     
    967970    bkpinfo->restore_path[0] = '\0';
    968971    bkpinfo->use_lzo = FALSE;
     972    bkpinfo->use_gzip = FALSE;
    969973    bkpinfo->do_not_compress_these[0] = '\0';
    970974    bkpinfo->verify_data = FALSE;
     
    11221126    }
    11231127    retval += whine_if_not_found("bzip2");
     1128    retval += whine_if_not_found("gzip");
    11241129    retval += whine_if_not_found("awk");
    11251130    retval += whine_if_not_found("md5sum");
  • branches/stable/mondo/src/common/libmondo-verify.c

    r948 r998  
    337337        if (bkpinfo->use_lzo) {
    338338            strcpy(sz_exe, "lzop");
     339        else if (bkpinfo->use_gzip) {
     340            strcpy(sz_exe, "gzip");
    339341        } else {
    340342            strcpy(sz_exe, "bzip2");
     
    519521        strcpy(bkpinfo->zip_suffix, "lzo");
    520522        bkpinfo->use_lzo = TRUE;
     523        bkpinfo->use_gzip = FALSE;
     524    }
     525    if (strstr(tarball_fname, ".gz")
     526        && strcmp(bkpinfo->zip_suffix, "gz")) {
     527        log_msg(2, "OK, I'm going to start using gzip.");
     528        strcpy(bkpinfo->zip_exe, "gzip");
     529        strcpy(bkpinfo->zip_suffix, "gz");
     530        bkpinfo->use_lzo = FALSE;
     531        bkpinfo->use_gzip = TRUE;
    521532    }
    522533    if (strstr(tarball_fname, ".bz2")
     
    526537        strcpy(bkpinfo->zip_suffix, "bz2");
    527538        bkpinfo->use_lzo = FALSE;
     539        bkpinfo->use_gzip = FALSE;
    528540    }
    529541    unlink(outlog);
  • branches/stable/mondo/src/common/mondostructures.h

    r558 r998  
    398398   */
    399399    bool use_lzo;
     400
     401  /**
     402   * If TRUE, then use @c gzip to compress data.
     403   * This is used mainly in estimates. The backup/restore may or may
     404   * not work if you do not set this. You should also set @p zip_exe
     405   * and @p zip_suffix.
     406   */
     407    bool use_gzip;
    400408
    401409  /**
Note: See TracChangeset for help on using the changeset viewer.