Ignore:
Timestamp:
Jul 23, 2009, 2:53:30 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Replace sprintf by mr_asprintf in mondo-rstr-compare.c
  • All mr_asprintf call should be on one line (for quality script) and use a string as second param
  • Improve quality script
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-verify.c

    r2276 r2296  
    107107
    108108    log_msg(1, "Now scanning log file for 'star: ' stuff");
    109     mr_asprintf(&command,
    110             "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s",
    111             stderr_fname, afio_found_changes);
     109    mr_asprintf(&command, "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s", stderr_fname, afio_found_changes);
    112110    log_msg(2, command);
    113111    res = system(command);
     
    118116    }
    119117    afio_diffs = count_lines_in_file(afio_found_changes);
    120     mr_asprintf(&command,
    121             "sort %s %s %s | uniq -c | awk '{ if ($1==\"2\") {print $2;};}' | grep -v \"incheckentry xwait()\" > %s",
    122             ignorefiles_fname, afio_found_changes, afio_found_changes,
    123             changedfiles_fname);
     118    mr_asprintf(&command, "sort %s %s %s | uniq -c | awk '{ if ($1==\"2\") {print $2;};}' | grep -v \"incheckentry xwait()\" > %s", ignorefiles_fname, afio_found_changes, afio_found_changes, changedfiles_fname);
    124119    mr_free(afio_found_changes);
    125120    log_msg(2, command);
     
    172167        } else {
    173168            retval++;
    174             mr_asprintf(&tmp, "Warning - missing set(s) between %d and %d\n",
    175                     g_last_afioball_number, set_number - 1);
     169            mr_asprintf(&tmp, "Warning - missing set(s) between %d and %d\n", g_last_afioball_number, set_number - 1);
    176170            log_to_screen(tmp);
    177171            mr_free(tmp);
     
    342336                    g_current_media_number, bigfile_num, slice_num);
    343337            if (!does_file_exist(slice_fname(bigfile_num, slice_num, mountpoint, ""))) {
    344                 mr_asprintf(&command, "%s -dc %s 2>> %s",
    345                         sz_exe,
    346                         slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix),
    347                         MONDO_LOGFILE);
     338                mr_asprintf(&command, "%s -dc %s 2>> %s", sz_exe, slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix), MONDO_LOGFILE);
    348339            } else {
    349340                mr_asprintf(&command, "cat %s 2>> %s", slice_fname(bigfile_num, slice_num, mountpoint, ""), MONDO_LOGFILE);
     
    474465        bkpinfo->use_star = TRUE;
    475466        if (strstr(tarball_fname, ".bz2"))
    476             mr_asprintf(&command,
    477                     "star -diff diffopts=mode,size,data file=%s %s >> %s 2>> %s",
    478                     tarball_fname,
    479                     (strstr(tarball_fname, ".bz2")) ? "-bz" : " ", outlog,
    480                     outlog);
     467            mr_asprintf(&command, "star -diff diffopts=mode,size,data file=%s -bz >> %s 2>> %s", tarball_fname, outlog, outlog);
    481468    } else {
    482469        bkpinfo->use_star = FALSE;
    483         mr_asprintf(&command, "afio -r -P %s -Z %s >> %s 2>> %s",
    484                 bkpinfo->zip_exe, tarball_fname, outlog, outlog);
     470        mr_asprintf(&command, "afio -r -P %s -Z %s >> %s 2>> %s", bkpinfo->zip_exe, tarball_fname, outlog, outlog);
    485471    }
    486472    log_msg(6, "command=%s", command);
     
    491477        mr_asprintf(&command, "cat %s >> %s", outlog, MONDO_LOGFILE);
    492478    } else {
    493         mr_asprintf(&command, "cut -d: -f%d %s | sort -u",
    494                 (bkpinfo->use_star) ? 1 : 2, outlog);
     479        mr_asprintf(&command, "cut -d: -f%d %s | sort -u", (bkpinfo->use_star) ? 1 : 2, outlog);
    495480        pin = popen(command, "r");
    496481        if (pin) {
     
    794779        res = verify_an_afioball_from_stream(fname, size);
    795780        if (res) {
    796             mr_asprintf(&tmp, "Afioball %ld differs from live filesystem",
    797                     current_afioball_number);
     781            mr_asprintf(&tmp, "Afioball %ld differs from live filesystem", current_afioball_number);
    798782            log_to_screen(tmp);
    799783            mr_free(tmp);
     
    897881            p++;
    898882        }
    899         mr_asprintf(&comment, "Verifying bigfile #%ld (%ld K)",
    900                 current_biggiefile_number, (long) size >> 10);
     883        mr_asprintf(&comment, "Verifying bigfile #%ld (%ld K)", current_biggiefile_number, (long) size >> 10);
    901884        update_progress_form(comment);
    902885        mr_free(comment);
     
    12081191    diffs = count_lines_in_file(changed_files_fname);
    12091192    if (diffs > 0) {
    1210         mr_asprintf(&tmp, "cp -f %s %s/changed.files", changed_files_fname,
    1211                 MONDO_CACHE);
     1193        mr_asprintf(&tmp, "cp -f %s %s/changed.files", changed_files_fname, MONDO_CACHE);
    12121194        run_program_and_log_output(tmp, FALSE);
    12131195        mr_free(tmp);
Note: See TracChangeset for help on using the changeset viewer.