Changeset 1043 in MondoRescue for trunk/mondo/src/common


Ignore:
Timestamp:
Jan 8, 2007, 11:31:22 PM (17 years ago)
Author:
Bruno Cornec
Message:

merge -r978:1042 $SVN_M/branches/stable

Location:
trunk/mondo/src/common
Files:
6 edited

Legend:

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

    r962 r1043  
    546546    char *command = NULL;
    547547    char *use_lzo_sz = NULL;
     548    char *use_gzip_sz = NULL;
    548549    char *use_comp_sz = NULL;
    549550    char *use_star_sz = NULL;
     
    607608    } else {
    608609        mr_asprintf(&use_lzo_sz, "no");
     610    }
     611    if (bkpinfo->use_gzip) {
     612        mr_asprintf(&use_gzip_sz, "yes");
     613    } else {
     614        mr_asprintf(&use_gzip_sz, "no");
    609615    }
    610616    if (bkpinfo->use_star) {
     
    861867             "mindi --custom %s %s/images '%s' '%s' \
    862868'%s' %ld '%s' '%s' '%s' \
    863 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d %s", bkpinfo->tmpdir,    // parameter #2
     869'%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", bkpinfo->tmpdir,  // parameter #2
    864870             bkpinfo->scratchdir,   // parameter #3
    865871             bkpinfo->kernel_path,  // parameter #4
     
    879885             bkpinfo->internal_tape_block_size, // parameter #18 (LONG)
    880886             bkpinfo->differential, // parameter #19 (INT)
     887             use_gzip_sz,       // parameter #20 (STRING)
    881888             tmp);
    882889    mr_free(tmp);
     
    891898    mr_free(devs_to_exclude);
    892899    mr_free(use_lilo_sz);
     900    mr_free(use_gzip_sz);
    893901
    894902    log_msg(2, command);
  • trunk/mondo/src/common/libmondo-filelist.c

    r991 r1043  
    428428    char *syscall;
    429429    char *file_to_analyze = NULL;
     430    char *strtmp = NULL;
    430431    int i;
    431432    size_t n = 0;
     
    452453        log_msg(8, "Analyzing %s", file_to_analyze);
    453454        /* BERLIOS : to be checked */
    454         mr_asprintf(&syscall, "%s %s 2>> /dev/null", syscall_sprintf,mr_stresc(file_to_analyze, "`$\\\"", '\\'));
     455        mr_asprintf(&strtmp, syscall_sprintf, mr_stresc(file_to_analyze, "`$\\\"", '\\'));
     456        mr_asprintf(&syscall, "%s 2>> /dev/null", strtmp);
     457        paranoid_free(strtmp);
    455458        call_exe_and_pipe_output_to_fd(syscall, pout);
    456459        mr_free(syscall);
  • trunk/mondo/src/common/libmondo-files.c

    r903 r1043  
    12051205    if (bkpinfo->use_lzo) {
    12061206        scratchLL = (scratchLL * 2) / 3;
     1207    } else if (bkpinfo->use_gzip) {
     1208        scratchLL = (scratchLL * 2) / 3;
    12071209    } else {
    12081210        scratchLL = scratchLL / 2;
  • trunk/mondo/src/common/libmondo-tools.c

    r1000 r1043  
    431431        mr_allocstr(bkpinfo->zip_exe, "lzop");
    432432        mr_allocstr(bkpinfo->zip_suffix, "lzo");
     433    } else if (bkpinfo->use_gzip) {
     434        strcpy(bkpinfo->zip_exe, "gzip");
     435        strcpy(bkpinfo->zip_suffix, "gz");
     436    } else if (bkpinfo->use_gzip) {
     437        strcpy(bkpinfo->zip_exe, "gzip");
     438        strcpy(bkpinfo->zip_suffix, "gz");
    433439    } else if (bkpinfo->compression_level != 0) {
    434440        mr_allocstr(bkpinfo->zip_exe, "bzip2");
     
    753759    mr_free(bkpinfo->restore_path);
    754760    bkpinfo->use_lzo = FALSE;
     761    bkpinfo->use_gzip = FALSE;
     762    bkpinfo->do_not_compress_these[0] = '\0';
    755763    bkpinfo->verify_data = FALSE;
    756764    bkpinfo->backup_data = FALSE;
     
    909917    }
    910918    retval += whine_if_not_found("bzip2");
     919    retval += whine_if_not_found("gzip");
    911920    retval += whine_if_not_found("awk");
    912921    retval += whine_if_not_found("md5sum");
  • trunk/mondo/src/common/libmondo-verify.c

    r956 r1043  
    238238        if (bkpinfo->use_lzo) {
    239239            mr_asprintf(&sz_exe, "lzop");
     240        else if (bkpinfo->use_gzip) {
     241            strcpy(sz_exe, "gzip");
     242        } else if (bkpinfo->use_gzip) {
     243            strcpy(sz_exe, "gzip");
    240244        } else {
    241245            mr_asprintf(&sz_exe, "bzip2");
     
    409413        mr_allocstr(bkpinfo->zip_suffix, "lzo");
    410414        bkpinfo->use_lzo = TRUE;
     415        bkpinfo->use_gzip = FALSE;
     416    }
     417    if (strstr(tarball_fname, ".gz")
     418        && strcmp(bkpinfo->zip_suffix, "gz")) {
     419        log_msg(2, "OK, I'm going to start using gzip.");
     420        strcpy(bkpinfo->zip_exe, "gzip");
     421        strcpy(bkpinfo->zip_suffix, "gz");
     422        bkpinfo->use_lzo = FALSE;
     423        bkpinfo->use_gzip = TRUE;
    411424    }
    412425    if (strstr(tarball_fname, ".bz2")
     
    416429        mr_allocstr(bkpinfo->zip_suffix, "bz2");
    417430        bkpinfo->use_lzo = FALSE;
     431        bkpinfo->use_gzip = FALSE;
    418432    }
    419433    unlink(outlog);
  • trunk/mondo/src/common/mondostructures.h

    r900 r1043  
    387387   */
    388388    bool use_lzo;
     389
     390  /**
     391   * If TRUE, then use @c gzip to compress data.
     392   * This is used mainly in estimates. The backup/restore may or may
     393   * not work if you do not set this. You should also set @p zip_exe
     394   * and @p zip_suffix.
     395   */
     396    bool use_gzip;
     397
     398  /**
     399   * A filename containing a list of extensions, one per line, to not
     400   * compress. If this is set to "", afio will still exclude a set of well-known
     401   * compressed files from compression, but biggiefiles that are compressed
     402   * will be recompressed again.
     403   */
     404    char do_not_compress_these[MAX_STR_LEN / 2];
    389405
    390406  /**
Note: See TracChangeset for help on using the changeset viewer.