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

Continue on configuration file items (compression)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)) {
Note: See TracChangeset for help on using the changeset viewer.