Changeset 1769


Ignore:
Timestamp:
Nov 6, 2007, 1:37:38 AM (12 years ago)
Author:
bruno
Message:

Continue on configuration file items (compression)

Location:
branches/stable
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo-web/mondo-web.pl

    r1671 r1769  
    7373);
    7474my @speed = sort {$a <=> $b} keys %speed;
     75my %suffix = (
     76        GZIP => 'gz',
     77        BZIP2 => 'bz2',
     78        LZO => 'lzo',
     79);
     80my @suffix = sort keys %suffix;
    7581my %comp = (
    7682        GZIP => 'gzip (average)',
     
    148154            -default=>$config->get("mondo_compression_level"),
    149155            -labels=>\%ratio);
     156    print "</TD><TD WIDTH=300>\n";
     157    print "Compression suffix: ",$cgi->popup_menu(-name=>'compsuffix',
     158            -values=>\@suffix,
     159            -default=>$config->get("mondo_compression_suffix"),
     160            -labels=>\%suffix);
    150161    print "</TD></TR></TABLE>\n";
    151162    print $cgi->hr;
  • branches/stable/mondo/distributions/conf/mondo.conf.dist

    r1680 r1769  
    8585mondo_differential=no
    8686
    87 # DONE
    88 
    8987#
    9088# Kernel to use (NATIVE|FAILSAFE|PATH TO THE KERNEL)
     
    102100#
    103101# Default compression tool
     102# It should support compression level with -# (# from 0 to 9)
     103# and option -d to uncompress and -c to use stdout as output file
    104104#
    105105mondo_compression_tool="/bin/gzip"
     106
     107#
     108# Default compression tool
     109#
     110mondo_compression_suffix="gz"
    106111
    107112#
     
    109114#
    110115mondo_compression_level=6
     116
     117# IN PROGRESS
    111118
    112119#
  • branches/stable/mondo/src/common/libmondo-archive.c

    r1693 r1769  
    230230    mr_asprintf(&command, "star H=star list=%s -c " STAR_ACL_SZ " file=%s",
    231231             filelist, fname);
    232     if (bkpinfo->use_lzo) {
    233         fatal_error("Can't use lzop");
    234     }
     232
    235233    if (bkpinfo->compression_level > 0) {
    236234        mr_asprintf(&tmp, "%s -bz", command);
     
    289287 * - @c scratchdir (only verifies existence)
    290288 * - @c tmpdir (only verifies existence)
    291  * - @c zip_exe
    292  * - @c zip_suffix
     289 * - @c compression_tool
     290 * - @c compression_suffix
    293291 * @param filelist The path to a file containing a list of files to be archived
    294292 * in this fileset.
     
    339337
    340338    if (bkpinfo->compression_level > 0) {
    341         mr_asprintf(&zipparams, "-Z -P %s -G %d -T 3k", bkpinfo->zip_exe,
     339        mr_asprintf(&zipparams, "-Z -P %s -G %d -T 3k", bkpinfo->compression_tool,
    342340                 bkpinfo->compression_level);
    343341        mr_asprintf(&tmp, "%s/do-not-compress-these", MONDO_SHARE);
     
    365363    }
    366364    mr_asprintf(&command, "rm -f %s %s. %s.gz %s.%s", fname, fname, fname,
    367              fname, bkpinfo->zip_suffix);
     365             fname, bkpinfo->compression_suffix);
    368366    paranoid_system(command);
    369367    mr_free(command);
     
    521519 * - @c nonbootable_backup
    522520 * - @c tmpdir
    523  * - @c use_lzo
    524521 *
    525522 * @return The number of errors encountered (0 for success)
     
    829826        mr_fprintf(fd1, "use-comp=no\n");
    830827    }
    831     if (bkpinfo->use_gzip) {
    832         mr_fprintf(fd1, "use-gzip=yes\n");
    833     } else {
    834         mr_fprintf(fd1, "use-gzip=no\n");
    835     }
    836     if (bkpinfo->use_lzo) {
    837         mr_fprintf(fd1, "use-lzo=yes\n");
    838     } else {
    839         mr_fprintf(fd1, "use-lzo=no\n");
     828    if (bkpinfo->compression_tool) {
     829        mr_fprintf(fd1, "compression_tool=%s\n",bkpinfo->compression_tool);
     830    }
     831    if (bkpinfo->compression_suffix) {
     832        mr_fprintf(fd1, "compression_suffix=%s\n",bkpinfo->compression_suffix);
     833    }
     834    if (bkpinfo->compression_type != none) {
     835        mr_fprintf(fd1, "compression_type=%d\n",bkpinfo->compression_type);
    840836    }
    841837    if (bkpinfo->use_star) {
     
    998994 *   structure. Fields used:
    999995 *   - @c tmpdir
    1000  *   - @c zip_suffix
     996 *   - @c compression_suffix
    1001997 *
    1002998 * Any of the above may be modified by the caller at any time.
     
    10591055        /* backup this set of files */
    10601056        sprintf(archiving_afioball_fname, AFIOBALL_FNAME_RAW_SZ,
    1061                 bkpinfo->tmpdir, archiving_set_no, bkpinfo->zip_suffix);
     1057                bkpinfo->tmpdir, archiving_set_no, bkpinfo->compression_suffix);
    10621058        sprintf(archiving_filelist_fname, FILELIST_FNAME_RAW_SZ,
    10631059                bkpinfo->tmpdir, archiving_set_no);
     
    10711067
    10721068        mr_asprintf(&tmp, AFIOBALL_FNAME_RAW_SZ, bkpinfo->tmpdir,
    1073                  archiving_set_no - ARCH_BUFFER_NUM, bkpinfo->zip_suffix);
     1069                 archiving_set_no - ARCH_BUFFER_NUM, bkpinfo->compression_suffix);
    10741070        if (does_file_exist(tmp)) {
    10751071            mr_msg(4, "[%d:%d] - waiting for storer",
     
    13171313 * - @c scratchdir
    13181314 * - @c tmpdir
    1319  * - @c zip_suffix
     1315 * - @c compression_suffix
    13201316 *
    13211317 * @return The number of errors encountered (0 for success)
     
    14271423                    bkpinfo->tmpdir, storing_set_no);
    14281424            sprintf(storing_afioball_fname, AFIOBALL_FNAME_RAW_SZ,
    1429                     bkpinfo->tmpdir, storing_set_no, bkpinfo->zip_suffix);
     1425                    bkpinfo->tmpdir, storing_set_no, bkpinfo->compression_suffix);
    14301426            if (g_getfattr) {
    14311427                sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     
    20932089        /* backup this set of files */
    20942090        mr_asprintf(&curr_afioball_fname, AFIOBALL_FNAME_RAW_SZ,
    2095                  bkpinfo->tmpdir, curr_set_no, bkpinfo->zip_suffix);
     2091                 bkpinfo->tmpdir, curr_set_no, bkpinfo->compression_suffix);
    20962092
    20972093        mr_msg(1, "EXAT'g set %ld", curr_set_no);
     
    27582754 * - @c tmpdir
    27592755 * - @c use_lzo
    2760  * - @c zip_exe
    2761  * - @c zip_suffix
     2756 * - @c compression_tool
     2757 * - @c compression_suffix
    27622758 *
    27632759 * @param biggie_filename The file to chop up.
     
    29092905        should_I_compress_slices = FALSE;
    29102906    } else {
    2911         mr_asprintf(&suffix, bkpinfo->zip_suffix);
     2907        mr_asprintf(&suffix, bkpinfo->compression_suffix);
    29122908        should_I_compress_slices = TRUE;
    29132909    }
     
    29572953            }
    29582954            if (should_I_compress_slices && bkpinfo->compression_level > 0) {
    2959                 mr_asprintf(&command, "%s -%d %s", bkpinfo->zip_exe,
     2955                mr_asprintf(&command, "%s -%d %s", bkpinfo->compression_tool,
    29602956                         bkpinfo->compression_level,
    29612957                         curr_slice_fname_uncompressed);
     
    29792975                mr_msg(2, "Failed to compress the slice");
    29802976            }
    2981             if (bkpinfo->use_lzo
     2977            if ((bkpinfo->compression_type == lzo)
    29822978                && strcmp(curr_slice_fname_compressed,
    29832979                          curr_slice_fname_uncompressed)) {
  • branches/stable/mondo/src/common/libmondo-devices.c

    r1669 r1769  
    14721472    bkpinfo->compression_level =
    14731473        (bkpinfo->backup_media_type == cdstream) ? 1 : 5;
    1474     bkpinfo->use_lzo =
    1475         (bkpinfo->backup_media_type == cdstream) ? TRUE : FALSE;
    14761474    mvaddstr_and_log_it(2, 0, " ");
    14771475
     
    20192017    log_it("media type = %s", bkpinfo->backup_media_string);
    20202018    log_it("prefix = %s", bkpinfo->prefix);
    2021     log_it("compression = %ld", bkpinfo->compression_level);
     2019    log_it("compression tool = %ld", bkpinfo->compression_tool);
     2020    log_it("compression suffix = %ld", bkpinfo->compression_suffix);
     2021    log_it("compression level = %ld", bkpinfo->compression_level);
    20222022    log_it("include_paths = '%s'", bkpinfo->include_paths);
    20232023    log_it("exclude_paths = '%s'", bkpinfo->exclude_paths);
  • branches/stable/mondo/src/common/libmondo-files.c

    r1669 r1769  
    11541154 * - @c bkpinfo->media_size
    11551155 * - @c bkpinfo->optimal_set_size
    1156  * - @c bkpinfo->use_lzo
    11571156 * @param noof_sets The number of filesets created.
    11581157 * @ingroup archiveGroup
     
    11781177    scratchLL = (scratchLL / 1024) / bkpinfo->media_size;
    11791178    scratchLL++;
    1180     if (bkpinfo->use_lzo) {
    1181         scratchLL = (scratchLL * 2) / 3;
    1182     } else if (bkpinfo->use_gzip) {
    1183         scratchLL = (scratchLL * 2) / 3;
    1184     } else {
    1185         scratchLL = scratchLL / 2;
    1186     }
     1179    scratchLL = (scratchLL * 2) / 3;
    11871180    if (!scratchLL) {
    11881181        scratchLL++;
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1671 r1769  
    329329 * - Used: @c bkpinfo->backup_media_type
    330330 * - Used: @c bkpinfo->writer_speed
    331  * - Used: @c bkpinfo->compression_level
    332331 * - Used: @c bkpinfo->include_paths
    333332 * - Used: @c bkpinfo->prefix
     
    340339 * - Used: @c bkpinfo->scratchdir
    341340 * - Used: @c bkpinfo->tmpdir
    342  * - Used: @c bkpinfo->use_lzo
    343341 * - Modified: @c bkpinfo->call_before_iso
    344342 * - Modified: @c bkpinfo->call_make_iso
    345343 * - Modified: @c bkpinfo->optimal_set_size
    346  * - Modified: @c bkpinfo->zip_exe
    347  * - Modified: @c bkpinfo->zip_suffix
    348344 *
    349345 * @return number of errors, or 0 for success.
     
    436432    }
    437433    mr_free(command);
    438 
    439     if (bkpinfo->use_lzo) {
    440         strcpy(bkpinfo->zip_exe, "lzop");
    441         strcpy(bkpinfo->zip_suffix, "lzo");
    442     } else if (bkpinfo->use_gzip) {
    443         strcpy(bkpinfo->zip_exe, "gzip");
    444         strcpy(bkpinfo->zip_suffix, "gz");
    445     } else if (bkpinfo->compression_level != 0) {
    446         strcpy(bkpinfo->zip_exe, "bzip2");
    447         strcpy(bkpinfo->zip_suffix, "bz2");
    448     } else {
    449         bkpinfo->zip_exe[0] = bkpinfo->zip_suffix[0] = '\0';
    450     }
    451434
    452435// CD-R or CD-RW or DVD
     
    734717    bkpinfo->manual_tray = mr_conf->manual_tray;
    735718    bkpinfo->internal_tape_block_size = mr_conf->internal_tape_blocksize;
     719    bkpinfo->compression_level = mr_conf->compression_level;
     720    mr_asprintf(&tmp,mr_conf->compression_suffix);
     721    bkpinfo->compression_suffix = tmp;
     722    mr_asprintf(&tmp,mr_conf->compression_tool);
     723    bkpinfo->compression_tool = tmp;
    736724    mr_asprintf(&tmp,mr_conf->media_device);
    737725    bkpinfo->media_device = tmp;
     
    762750    }
    763751    bkpinfo->boot_device[0] = '\0';
    764     bkpinfo->zip_exe[0] = '\0';
    765     bkpinfo->zip_suffix[0] = '\0';
    766752    bkpinfo->restore_path[0] = '\0';
    767     bkpinfo->use_lzo = FALSE;
    768     bkpinfo->use_gzip = FALSE;
    769753    bkpinfo->do_not_compress_these[0] = '\0';
    770754    bkpinfo->verify_data = FALSE;
     
    798782    bkpinfo->differential = FALSE;
    799783    bkpinfo->writer_speed = mr_conf->iso_burning_speed;
    800     bkpinfo->compression_level = 3;
    801784}
    802785
     
    913896    retval += whine_if_not_found(mr_conf->iso_burning_cmd);
    914897    retval += whine_if_not_found(MKE2FS_OR_NEWFS);
    915     retval += whine_if_not_found("bzip2");
     898    retval += whine_if_not_found(mr_conf->compresstion_tool);
    916899    retval += whine_if_not_found("gzip");
    917900    retval += whine_if_not_found("awk");
  • branches/stable/mondo/src/common/libmondo-verify.c

    r1663 r1769  
    4141/**
    4242 * Generate the filename of a tarball to verify.
    43  * @param bkpinfo The backup information structure. @c bkpinfo->zip_suffix is the only field used.
     43 * @param bkpinfo The backup information structure. @c bkpinfo->compression_suffix is the only field used.
    4444 * @param mountpoint The directory where the CD/DVD/ISO is mounted.
    4545 * @param setno The afioball number to get the location of.
     
    5656    assert_string_is_neither_NULL_nor_zerolength(mountpoint);
    5757    sprintf(output, "%s/archives/%d.star.%s", mountpoint, setno,
    58             bkpinfo->zip_suffix);
     58            bkpinfo->compression_suffix);
    5959    if (!does_file_exist(output)) {
    6060        sprintf(output, "%s/archives/%d.afio.%s", mountpoint, setno,
    61                 bkpinfo->zip_suffix);
     61                bkpinfo->compression_suffix);
    6262    }
    6363    return (output);
     
    211211 * - @c compression_level
    212212 * - @c restore_path
    213  * - @c use_lzo
    214  * - @c zip_suffix
     213 * - @c compression_suffix
    215214 * @param mtpt The mountpoint the CD/DVD/ISO is mounted on.
    216215 * @return The number of differences (0 for perfect biggiefiles).
     
    224223    char *mountpoint = NULL;
    225224    char *command = NULL;
    226     char *sz_exe = NULL;
    227225    static char *bufblkA = NULL;
    228226    static char *bufblkB = NULL;
     
    252250    assert(bkpinfo != NULL);
    253251    assert_string_is_neither_NULL_nor_zerolength(mtpt);
    254 
    255     if (bkpinfo->compression_level > 0) {
    256         if (bkpinfo->use_lzo) {
    257             mr_asprintf(&sz_exe, "lzop");
    258         } else if (bkpinfo->use_gzip) {
    259             mr_asprintf(&sz_exe, "gzip");
    260         } else {
    261             mr_asprintf(&sz_exe, "bzip2");
    262         }
    263     } else {
    264         mr_asprintf(&sz_exe, "");
    265     }
    266252
    267253    iamhere("before vsbf");
     
    286272    while (does_file_exist
    287273           (slice_fname
    288             (bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix))
     274            (bigfile_num, slice_num, mountpoint, bkpinfo->compression_suffix))
    289275           ||
    290276           does_file_exist(slice_fname
     
    340326                    g_current_media_number, bigfile_num, slice_num);
    341327            if (!does_file_exist(slice_fname(bigfile_num, slice_num, mountpoint, ""))) {
    342                 mr_asprintf(&command, "%s -dc %s 2>> %s", sz_exe,
    343                         slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix),
     328                mr_asprintf(&command, "%s -dc %s 2>> %s", bkpinfi->compression_tool,
     329                        slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->compression_suffix),
    344330                        MONDO_LOGFILE);
    345331            } else {
     
    392378    mr_free(tmp);
    393379    mr_free(mountpoint);
    394     mr_free(sz_exe);
    395380
    396381    last_bigfile_num = bigfile_num;
     
    414399 * You should be changed to the root directory (/) for this to work.
    415400 * @param bkpinfo The backup information structure. Fields used:
    416  * - @c bkpinfo->use_lzo
    417401 * - @c bkpinfo->tmpdir
    418  * - @c bkpinfo->zip_exe
    419  * - @c bkpinfo->zip_suffix
     402 * - @c bkpinfo->compression_tool
     403 * - @c bkpinfo->compression_suffix
    420404 * @param tarball_fname The filename of the afioball to verify.
    421405 * @return 0, always.
     
    442426
    443427    mr_asprintf(&outlog, "%s/afio.log", bkpinfo->tmpdir);
    444 
    445     /* if programmer forgot to say which compression thingy to use then find out */
    446     if (strstr(tarball_fname, ".lzo")
    447         && strcmp(bkpinfo->zip_suffix, "lzo")) {
    448         mr_msg(2, "OK, I'm going to start using lzop.");
    449         strcpy(bkpinfo->zip_exe, "lzop");
    450         strcpy(bkpinfo->zip_suffix, "lzo");
    451         bkpinfo->use_lzo = TRUE;
    452         bkpinfo->use_gzip = FALSE;
    453     }
    454     if (strstr(tarball_fname, ".gz")
    455         && strcmp(bkpinfo->zip_suffix, "gz")) {
    456         mr_msg(2, "OK, I'm going to start using gzip.");
    457         strcpy(bkpinfo->zip_exe, "gzip");
    458         strcpy(bkpinfo->zip_suffix, "gz");
    459         bkpinfo->use_lzo = FALSE;
    460         bkpinfo->use_gzip = TRUE;
    461     }
    462     if (strstr(tarball_fname, ".bz2")
    463         && strcmp(bkpinfo->zip_suffix, "bz2")) {
    464         mr_msg(2, "OK, I'm going to start using bzip2.");
    465         strcpy(bkpinfo->zip_exe, "bzip2");
    466         strcpy(bkpinfo->zip_suffix, "bz2");
    467         bkpinfo->use_lzo = FALSE;
    468         bkpinfo->use_gzip = FALSE;
    469     }
    470428    unlink(outlog);
     429
    471430    if (strstr(tarball_fname, ".star")) {
    472431        bkpinfo->use_star = TRUE;
     
    483442        bkpinfo->use_star = FALSE;
    484443        mr_asprintf(&command, "afio -r -P %s -Z %s >> %s 2>> %s",
    485                  bkpinfo->zip_exe, tarball_fname, outlog, outlog);
     444                 bkpinfo->compression_tool, tarball_fname, outlog, outlog);
    486445    }
    487446    mr_msg(6, "command=%s", command);
  • branches/stable/mondo/src/common/mondostructures.h

    r1669 r1769  
    168168    udev                        ///< Back up to another unsupported device; just send a stream of bytes.
    169169} t_bkptype;
     170
     171/*
     172 * Type of compression algorithm we're using
     173 */
     174typedef enum {
     175    none = 0,                   //< No compression
     176    gzip,                       //< Compression with gzip
     177    bzip2,                      //< Compression with bzip2
     178    lzo,                        //< Compression with lzo
     179    lzma                        //< Compression with lzma
     180} t_mr_comp;
    170181
    171182/**
     
    344355  /**
    345356   * The compression program to use. Currently supported
    346    * choices are lzop and bzip2; gzip may also work. This is ignored if
     357   * choices are lzop, bzip2, and gzip. This is ignored if
    347358   * compression_level is 0.
    348359   */
    349     char zip_exe[MAX_STR_LEN / 4];
     360    char *compression_tool;
    350361
    351362  /**
     
    353364   * bz2, gzip uses gz, etc. Do not include the dot.
    354365   */
    355     char zip_suffix[MAX_STR_LEN / 4];
     366    char *compression_suffix;
     367
     368  /**
     369   * The compression level (1-9) to use. 0 disables compression.
     370   */
     371    int compression_level;
     372
     373  /**
     374   * The type of compression
     375   */
     376    t_mr_comp compression_type;
    356377
    357378  /**
     
    369390   */
    370391    char image_devs[MAX_STR_LEN / 4];
    371 
    372   /**
    373    * The compression level (1-9) to use. 0 disables compression.
    374    */
    375     int compression_level;
    376 
    377   /**
    378    * If TRUE, then use @c lzop to compress data.
    379    * This is used mainly in estimates. The backup/restore may or may
    380    * not work if you do not set this. You should also set @p zip_exe
    381    * and @p zip_suffix.
    382    */
    383     bool use_lzo;
    384 
    385   /**
    386    * If TRUE, then use @c gzip to compress data.
    387    * This is used mainly in estimates. The backup/restore may or may
    388    * not work if you do not set this. You should also set @p zip_exe
    389    * and @p zip_suffix.
    390    */
    391     bool use_gzip;
    392392
    393393  /**
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r1680 r1769  
    663663            ("You didn't use -d to specify the backup device/directory.");
    664664    }
    665 /* optional, obscure */
     665
     666    /* optional, obscure */
    666667    for (i = '0'; i <= '9'; i++) {
    667668        if (flag_set[i]) {
     
    743744    if (flag_set['P']) {
    744745        strncpy(bkpinfo->postnuke_tarball, flag_val['P'], MAX_STR_LEN);
    745     }
    746 
    747     if (flag_set['L']) {
    748         bkpinfo->use_lzo = TRUE;
    749         if (run_program_and_log_output("which lzop", FALSE)) {
    750             retval++;
    751             log_to_screen
    752                 (_("Please install LZOP. You can't use '-L' until you do.\n"));
    753         }
    754     }
    755 
    756     if (flag_set['G']) {
    757         bkpinfo->use_gzip = TRUE;
    758         if (run_program_and_log_output("which gzip", FALSE)) {
    759             retval++;
    760             log_to_screen
    761                 ("Please install gzip. You can't use '-G' until you do.\n");
    762         }
    763746    }
    764747
  • branches/stable/mondo/src/mondoarchive/mondoarchive.c

    r1680 r1769  
    283283    }
    284284
     285    p = mr_conf_sread("mondo_compression_suffix");
     286    if (p != NULL) {
     287        mr_cnf->compression_suffix = p;
     288    }
     289
    285290    p = mr_conf_iread("mondo_compression_level");
    286291    if (p != NULL) {
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r1663 r1769  
    891891    }
    892892
    893     read_cfg_var(cfg_file, "use-lzo", value);
     893    /* BERLIOS: This has now to be re-written with conf file */
     894    read_cfg_var(cfg_file, "use-comp", value);
    894895    if (strstr(value, "yes")) {
    895         bkpinfo->use_lzo = TRUE;
    896         bkpinfo->use_gzip = FALSE;
    897         strcpy(bkpinfo->zip_exe, "lzop");
    898         strcpy(bkpinfo->zip_suffix, "lzo");
    899     } else {
    900         read_cfg_var(cfg_file, "use-gzip", value);
    901         if (strstr(value, "yes")) {
    902             bkpinfo->use_lzo = FALSE;
    903             bkpinfo->use_gzip = TRUE;
    904             strcpy(bkpinfo->zip_exe, "gzip");
    905             strcpy(bkpinfo->zip_suffix, "gz");
    906         } else {
    907             read_cfg_var(cfg_file, "use-comp", value);
    908             if (strstr(value, "yes")) {
    909                 bkpinfo->use_lzo = FALSE;
    910                 bkpinfo->use_gzip = FALSE;
    911                 strcpy(bkpinfo->zip_exe, "bzip2");
    912                 strcpy(bkpinfo->zip_suffix, "bz2");
    913             } else {
    914                 bkpinfo->zip_exe[0] = bkpinfo->zip_suffix[0] = '\0';
    915             }
    916         }
     896        read_cfg_var(cfg_file, "compression_tool", value);
     897        mr_asprintf(&(bkpinfo->compression_tool), value);
     898        read_cfg_var(cfg_file, "compression_suffix", value);
     899        mr_asprintf(&(bkpinfo->compression_suffix), "bz2");
     900    } else {
     901        bkpinfo->compression_tool = NULL;
     902        bkpinfo->compression_suffix = NULL;
    917903    }
    918904
  • branches/stable/mondo/src/mondorestore/mondorestore.c

    r1663 r1769  
    12941294 * @param bkpinfo The backup information structure. Fields used:
    12951295 * - @c bkpinfo->restore_path
    1296  * - @c bkpinfo->zip_exe
     1296 * - @c bkpinfo->compression_tool
    12971297 * @param orig_bf_fname The original filename of the biggiefile.
    12981298 * @param biggiefile_number The number of the biggiefile (starting from 0).
     
    14331433    }
    14341434
    1435     if (!bkpinfo->zip_exe[0]) {
     1435    if (!bkpinfo->compression_tool) {
    14361436        mr_asprintf(&command, "cat > \"%s\"", file_to_openout);
    14371437    } else {
    1438         mr_asprintf(&command, "%s -dc > \"%s\" 2>> %s", bkpinfo->zip_exe,
     1438        mr_asprintf(&command, "%s -dc > \"%s\" 2>> %s", bkpinfo->compression_tool,
    14391439                file_to_openout, MONDO_LOGFILE);
    14401440    }
     
    17581758 * - @c bkpinfo->backup_media_type
    17591759 * - @c bkpinfo->media_device
    1760  * - @c bkpinfo->zip_exe
     1760 * - @c bkpinfo->compression_tool
    17611761 * @param tarball_fname The filename of the afioball to restore.
    17621762 * @param current_tarball_number The number (starting from 0) of the fileset
     
    18201820            mr_asprintf(&executable, " -bz");
    18211821        } else {
    1822             mr_asprintf(&executable, "-P %s -Z", bkpinfo->zip_exe);
     1822            mr_asprintf(&executable, "-P %s -Z", bkpinfo->compression_tool);
    18231823        }
    18241824    }
     
    29402940    }
    29412941
    2942     if (argc >= 2 && strcmp(argv[1], "--pih") == 0) {
    2943         if (system("mount | grep cdrom 2> /dev/null > /dev/null")) {
    2944             system("mount " MNT_CDROM);
    2945         }
    2946         bkpinfo->compression_level = 1;
    2947         g_current_media_number = 2;
    2948         strcpy(bkpinfo->restore_path, "/tmp/TESTING");
    2949         bkpinfo->backup_media_type = dvd;
    2950         open_progress_form(_("Reassembling /dev/hda1"),
    2951                            _("Shark is a bit of a silly person."),
    2952                            _("Please wait. This may take some time."),
    2953                            "", 1999);
    2954         system("rm -Rf /tmp/*pih*");
    2955 
    2956         malloc_string(tmp);
    2957         restore_a_biggiefile_from_CD(42, NULL, tmp);
    2958         mr_free(tmp);
    2959     }
    2960 
    29612942    if (argc == 5 && strcmp(argv[1], "--common") == 0) {
    29622943        mr_conf->log_level = 6;
Note: See TracChangeset for help on using the changeset viewer.