Changeset 1043 in MondoRescue for trunk/mondo/src


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
Files:
13 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  /**
  • trunk/mondo/src/mondoarchive/mondo-cli.c

    r956 r1043  
    799799    }
    800800
     801    if (flag_set['G']) {
     802        bkpinfo->use_gzip = TRUE;
     803        if (run_program_and_log_output("which gzip", FALSE)) {
     804            retval++;
     805            log_to_screen
     806                ("Please install gzip. You can't use '-G' until you do.\n");
     807        }
     808    }
     809
    801810    if (!flag_set['o']
    802811        &&
     
    893902    while ((opt =
    894903            getopt(argc, argv,
    895                    "0123456789A:B:C:DE:FHI:J:K:LNOP:QRS:T:VWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"))
     904                   "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:VWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"))
    896905           != -1) {
    897906        if (opt == '?') {
  • trunk/mondo/src/mondorestore/mondo-restore.c

    r973 r1043  
    10021002    char *outfile_fname = NULL;
    10031003    char *tmp = NULL;
     1004    char *tmp0 = NULL;
    10041005    char *tmp1 = NULL;
    10051006    char *tmp2 = NULL;
     
    11571158    for (sliceno = 1, finished = FALSE; !finished;) {
    11581159        tmp = slice_fname(bigfileno, sliceno, ARCHIVES_PATH, "");
     1160        tmp0 = slice_fname(bigfileno, sliceno, ARCHIVES_PATH, "gz");
    11591161        tmp1 = slice_fname(bigfileno, sliceno, ARCHIVES_PATH, "lzo");
    11601162        tmp2 = slice_fname(bigfileno, sliceno, ARCHIVES_PATH, "bz2");
    1161         if (!does_file_exist(tmp) && !does_file_exist(tmp1) &&
     1163        if (!does_file_exist(tmp) &&
     1164            !does_file_exist(tmp0) &&
     1165            !does_file_exist(tmp1) &&
    11621166            !does_file_exist(tmp2)) {
    11631167            log_msg(3,
     
    11901194                if (does_file_exist(tmp1)) {
    11911195                    mr_asprintf(&bzip2_command, "lzop -dc %s 2>> %s",tmp1, MONDO_LOGFILE);
     1196                } else if (does_file_exist(tmp0)) {
     1197                    mr_asprintf(&bzip2_command, "gzip -dc %s 2>> %s",tmp0, MONDO_LOGFILE);
    11921198                } else if (does_file_exist(tmp2)) {
    11931199                        mr_asprintf(&bzip2_command, "bzip2 -dc %s 2>> %s",tmp2, MONDO_LOGFILE);
     
    16161622        if (strstr(tarball_fname, ".bz2")) {
    16171623            mr_asprintf(&executable, "bzip2");
     1624        } else if (strstr(tarball_fname, ".gz")) {
     1625            strcpy(executable, "gzip");
     1626        } else if (strstr(tarball_fname, ".gz")) {
     1627            strcpy(executable, "gzip");
    16181628        } else if (strstr(tarball_fname, ".lzo")) {
    16191629            mr_asprintf(&executable, "lzop");
  • trunk/mondo/src/mondorestore/mondo-rstr-compare.c

    r900 r1043  
    241241    if (strstr(tarball_fname, ".bz2")) {
    242242        mr_asprintf(&compressor_exe, "bzip2");
     243    } else if (strstr(tarball_fname, ".gz")) {
     244        strcpy(compressor_exe, "gzip");
     245    } else if (strstr(tarball_fname, ".gz")) {
     246        strcpy(compressor_exe, "gzip");
    243247    } else if (strstr(tarball_fname, ".lzo")) {
    244248        mr_asprintf(&compressor_exe, "lzop");
  • trunk/mondo/src/mondorestore/mondo-rstr-tools.c

    r972 r1043  
    952952        mr_allocstr(bkpinfo->zip_exe, "lzop");
    953953        mr_allocstr(bkpinfo->zip_suffix, "lzo");
     954        bkpinfo->use_gzip = FALSE;
    954955    } else {
    955956        mr_free(value);
    956         read_cfg_var(cfg_file, "use-comp", value);
     957        read_cfg_var(cfg_file, "use-gzip", value);
    957958        if (strstr(value, "yes")) {
    958959            bkpinfo->use_lzo = FALSE;
    959             mr_allocstr(bkpinfo->zip_exe, "bzip2");
    960             mr_allocstr(bkpinfo->zip_suffix, "bz2");
     960            bkpinfo->use_gzip = TRUE;
     961            mr_allocstr(bkpinfo->zip_exe, "gzip");
     962            mr_allocstr(bkpinfo->zip_suffix, "gz");
    961963        } else {
    962             // Just to be sure
    963             bkpinfo->zip_exe = NULL;
    964             bkpinfo->zip_suffix = NULL;
     964            read_cfg_var(cfg_file, "use-comp", value);
     965            if (strstr(value, "yes")) {
     966                bkpinfo->use_lzo = FALSE;
     967                bkpinfo->use_gzip = FALSE;
     968                mr_allocstr(bkpinfo->zip_exe, "bzip2");
     969                mr_allocstr(bkpinfo->zip_suffix, "bz2");
     970            } else {
     971                // Just to be sure
     972                bkpinfo->zip_exe = NULL;
     973                bkpinfo->zip_suffix = NULL;
     974            }
    965975        }
    966976    }
  • trunk/mondo/src/restore-scripts/mondo/hack-fstab

    r588 r1043  
    11#!/bin/sh
    22#
     3# $Id$
    34#
    4 #
    5 #
    6 #
    7 # 2003/08/04
    8 # - added some logging
    9 #
    10 # mid-2002 --- created
    11 ################################################
    12 
    135
    146LogIt() {
    157    echo "$1" >> /dev/stderr
    168}
    17 
    18 
    199
    2010
     
    3323#    echo "original_fstab_line = $original_fstab_line" >> /dev/stderr
    3424    if [ "`grep "LABEL=" $old_fstab`" != "" ] ; then
    35     if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] ; then
    36         device="LABEL=$mountpoint"
    37     fi
     25        if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] ; then
     26            device="LABEL=$mountpoint"
     27        fi
    3828    fi
    3929
     
    4434    if [ "$original_fstab_line" != "" ] ; then
    4535#   echo $original_fstab_line | gawk '{i=index($0,$4); print substr($0,i);}'
    46     echo "$original_fstab_line" | cut -d' ' -f4-19 | tr -s ' ' ' '
     36        echo "$original_fstab_line" | cut -d' ' -f4-19 | tr -s ' ' ' '
    4737    else
    48     echo -e "defaults 0 0"
     38        echo -e "defaults 0 0"
    4939    fi
    5040}
    51 
    5241
    5342
  • trunk/mondo/src/restore-scripts/mondo/restore-bigfiles-from-iso

    r588 r1043  
    6363            if echo "$slicename" | grep "bz2" > /dev/null ; then
    6464                bzip2 -dc $slicename >> "$OUTFNAME" || Die "Failed to decompress slice $slicename"
     65            elif echo "$slicename" | grep "gz" > /dev/null ; then
     66                gzip -dc $slicename >> "$OUTFNAME" || Die "Failed to decompress slice $slicename"
    6567            elif echo "$slicename" | grep "lzo" > /dev/null ; then
    6668                lzop -dc $slicename >> "$OUTFNAME" || Die "Failed to decompress slice $slicename"
  • trunk/mondo/src/restore-scripts/mondo/stabgrub-me

    r839 r1043  
    3232        LogIt "No need for fstab search." 2
    3333#        fstab_list=/mnt/RESTORING/etc/fstab
    34     old_fstab=/mnt/RESTORING/etc/fstab
    35     old_grubconf=/mnt/RESTORING/etc/grub.conf
     34        old_fstab=/mnt/RESTORING/etc/fstab
     35        old_grubconf=/mnt/RESTORING/etc/grub.conf
    3636        # For some distros, e.g. Debian, /etc/grub.conf is a symbolic link
    37     # which we need to resolve and prepend with /mnt/RESTORING because
    38     # we run this outside the chroot.
    39     if [ -L "$old_grubconf" ] ; then
    40         old_grubconf=/mnt/RESTORING`readlink "$old_grubconf"`
    41     fi 
    42     return 0
     37        # which we need to resolve and prepend with /mnt/RESTORING because
     38        # we run this outside the chroot.
     39        if [ -L "$old_grubconf" ] ; then
     40            old_grubconf=/mnt/RESTORING/etc/`readlink "$old_grubconf"`
     41        fi 
     42        return 0
    4343    elif [ -f "/mnt/cdrom/archives/CUCKOO" ] ; then
    4444        LogIt "Because I'm cuckoo, I'll stop searching." 2
Note: See TracChangeset for help on using the changeset viewer.