Changeset 1086 in MondoRescue for trunk/mondo/src/common/libmondo-verify.c


Ignore:
Timestamp:
Feb 2, 2007, 11:21:27 PM (17 years ago)
Author:
Bruno Cornec
Message:

log_msg => mr_msg in trunk

File:
1 edited

Legend:

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

    r1081 r1086  
    7171*/
    7272
    73     log_msg(1, "Now scanning log file for 'afio: ' stuff");
     73    mr_msg(1, "Now scanning log file for 'afio: ' stuff");
    7474    mr_asprintf(&command,
    7575             "grep \"afio: \" %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s",
    7676             stderr_fname, afio_found_changes);
    77     log_msg(2, command);
     77    mr_msg(2, command);
    7878    res = system(command);
    7979    mr_free(command);
    8080    if (res) {
    81         log_msg(2, "Warning - failed to think");
    82     }
    83 
    84     log_msg(1, "Now scanning log file for 'star: ' stuff");
     81        mr_msg(2, "Warning - failed to think");
     82    }
     83
     84    mr_msg(1, "Now scanning log file for 'star: ' stuff");
    8585    mr_asprintf(&command,
    8686             "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s",
    8787             stderr_fname, afio_found_changes);
    88     log_msg(2, command);
     88    mr_msg(2, command);
    8989    res = system(command);
    9090    mr_free(command);
    9191    if (res) {
    92         log_msg(2, "Warning - failed to think");
     92        mr_msg(2, "Warning - failed to think");
    9393    }
    9494//  exclude_nonexistent_files (afio_found_changes);
     
    9898             ignorefiles_fname, afio_found_changes, afio_found_changes,
    9999             changedfiles_fname);
    100     log_msg(2, command);
     100    mr_msg(2, command);
    101101    paranoid_system(command);
    102102    mr_free(command);
     
    144144    if (g_last_afioball_number != set_number - 1) {
    145145        if (set_number == 0) {
    146             log_msg(1,
     146            mr_msg(1,
    147147                    "Weird error in verify_afioballs_on_CD() but it's really a cosmetic error, nothing more");
    148148        } else {
     
    163163         does_file_exist(vfy_tball_fname(bkpinfo, mountpoint, total_sets));
    164164         total_sets++) {
    165         log_msg(1, "total_sets = %d", total_sets);
     165        mr_msg(1, "total_sets = %d", total_sets);
    166166    }
    167167    for (;
     
    172172                                                           g_last_afioball_number);
    173173        update_evalcall_form(percentage);
    174         log_msg(1, "set = %d", set_number);
     174        mr_msg(1, "set = %d", set_number);
    175175        retval +=
    176176            verify_an_afioball_from_CD(bkpinfo,
     
    270270        // handle slices until end of CD
    271271        if (slice_num == 0) {
    272             log_msg(2, "ISO=%d  bigfile=%ld --START--",
     272            mr_msg(2, "ISO=%d  bigfile=%ld --START--",
    273273                    g_current_media_number, bigfile_num);
    274274            if (!(fin = fopen(tmp1,"r"))) {
    275                 log_msg(2, "Cannot open bigfile's info file");
     275                mr_msg(2, "Cannot open bigfile's info file");
    276276            } else {
    277277                if (fread
    278278                    ((void *) &biggiestruct, 1, sizeof(biggiestruct),
    279279                     fin) < sizeof(biggiestruct)) {
    280                     log_msg(2, "Unable to get biggiestruct");
     280                    mr_msg(2, "Unable to get biggiestruct");
    281281                }
    282282                paranoid_fclose(fin);
     
    284284            mr_asprintf(&tmp2, "%s/%s", bkpinfo->restore_path,
    285285                     biggiestruct.filename);
    286             log_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp2);
     286            mr_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp2);
    287287            if (!(forig = fopen(tmp2, "r"))) {
    288                 log_msg(2, "Failed to open bigfile. Darn.");
     288                mr_msg(2, "Failed to open bigfile. Darn.");
    289289                retval++;
    290290            }
     
    293293            slice_num++;
    294294        } else if (does_file_exist(tmp1)) {
    295             log_msg(2, "ISO=%d  bigfile=%ld ---END---",
     295            mr_msg(2, "ISO=%d  bigfile=%ld ---END---",
    296296                    g_current_media_number, bigfile_num);
    297297            bigfile_num++;
     
    299299            slice_num = 0;
    300300        } else {
    301             log_msg(2, "ISO=%d  bigfile=%ld  slice=%ld  \r",
     301            mr_msg(2, "ISO=%d  bigfile=%ld  slice=%ld  \r",
    302302                    g_current_media_number, bigfile_num, slice_num);
    303303            if (bkpinfo->compression_level > 0) {
     
    327327                paranoid_pclose(pin);
    328328                if (res && !strncmp(biggiestruct.filename, " /dev/", 5)) {
    329                     log_msg(3,
     329                    mr_msg(3,
    330330                            "Ignoring differences between %s and live filesystem because it's a device and therefore the archives are stored via ntfsclone, not dd.",
    331331                            biggiestruct.filename);
    332                     log_msg(3,
     332                    mr_msg(3,
    333333                            "If you really want verification for %s, please contact the devteam and offer an incentive.",
    334334                            biggiestruct.filename);
     
    336336                }
    337337                if (res) {
    338                     log_msg(0,
     338                    mr_msg(0,
    339339                            "afio: \"%s\": Corrupt biggie file, says libmondo-archive.c",
    340340                            biggiestruct.filename);
     
    405405    if (strstr(tarball_fname, ".lzo")
    406406        && strcmp(bkpinfo->zip_suffix, "lzo")) {
    407         log_msg(2, "OK, I'm going to start using lzop.");
     407        mr_msg(2, "OK, I'm going to start using lzop.");
    408408        mr_allocstr(bkpinfo->zip_exe, "lzop");
    409409        mr_allocstr(bkpinfo->zip_suffix, "lzo");
     
    413413    if (strstr(tarball_fname, ".gz")
    414414        && strcmp(bkpinfo->zip_suffix, "gz")) {
    415         log_msg(2, "OK, I'm going to start using gzip.");
     415        mr_msg(2, "OK, I'm going to start using gzip.");
    416416        strcpy(bkpinfo->zip_exe, "gzip");
    417417        strcpy(bkpinfo->zip_suffix, "gz");
     
    421421    if (strstr(tarball_fname, ".bz2")
    422422        && strcmp(bkpinfo->zip_suffix, "bz2")) {
    423         log_msg(2, "OK, I'm going to start using bzip2.");
     423        mr_msg(2, "OK, I'm going to start using bzip2.");
    424424        mr_allocstr(bkpinfo->zip_exe, "bzip2");
    425425        mr_allocstr(bkpinfo->zip_suffix, "bz2");
     
    441441                 bkpinfo->zip_exe, tarball_fname, outlog, outlog);
    442442    }
    443     log_msg(6, "command=%s", command);
     443    mr_msg(6, "command=%s", command);
    444444    paranoid_system(command);
    445445    mr_free(command);
     
    462462                        if (strchr(tmp, '/')) {
    463463                            if (!diffs) {
    464                                 log_msg(0, "'%s' - differences found",
     464                                mr_msg(0, "'%s' - differences found",
    465465                                        tarball_fname);
    466466                            }
    467                             log_msg(0, "star: /%s",
     467                            mr_msg(0, "star: /%s",
    468468                                    strip_afio_output_line(tmp));
    469469                            diffs++;
     
    472472                } else {
    473473                    if (!diffs) {
    474                         log_msg(0, "'%s' - differences found",
     474                        mr_msg(0, "'%s' - differences found",
    475475                                tarball_fname);
    476476                    }
    477                     log_msg(0, "afio: /%s", strip_afio_output_line(tmp));
     477                    mr_msg(0, "afio: /%s", strip_afio_output_line(tmp));
    478478                    diffs++;
    479479                }
     
    515515    assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
    516516
    517     log_msg(1, "Verifying %s", tarball_fname);
     517    mr_msg(1, "Verifying %s", tarball_fname);
    518518    if (!does_file_exist(tarball_fname)) {
    519519        fatal_error("Cannot verify nonexistent afioball");
     
    575575                 "Afioball '%s' no longer matches your live filesystem",
    576576                 p);
    577         log_msg(0, tmp);
     577        mr_msg(0, tmp);
    578578        mr_free(tmp);
    579579        retval++;
     
    648648                                          &ctrl_chr);
    649649        if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) {
    650             log_msg(2, "test_file = %s", test_file);
     650            mr_msg(2, "test_file = %s", test_file);
    651651            wrong_marker(BLK_STOP_AN_AFIO_OR_SLICE, ctrl_chr);
    652652        }
     
    666666            mr_asprintf(&tmp, "orig cksum=%s; curr cksum=%s", biggie_cksum,
    667667                     orig_cksum);
    668             log_msg(2, tmp);
     668            mr_msg(2, tmp);
    669669            mr_free(tmp);
    670670
     
    795795        fname = (char *) &res;
    796796    }
    797     log_msg(1, "All done with afioballs");
     797    mr_msg(1, "All done with afioballs");
    798798    close_progress_form();
    799799    mr_free(fname);
     
    867867    }
    868868    noof_biggiefiles = (long) size;
    869     log_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles);
     869    mr_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles);
    870870    open_progress_form(_("Verifying big files"), comment,
    871871                       _("Please wait. This may take some time."), "",
     
    956956                 "%s not found; assuming you backed up to CD; verifying CD...",
    957957                 fname);
    958         log_msg(2, tmp);
     958        mr_msg(2, tmp);
    959959        mr_free(tmp);
    960960
     
    995995        mr_free(command);
    996996    }
    997     log_msg(2, "OK, I've mounted the ISO/CD\n");
     997    mr_msg(2, "OK, I've mounted the ISO/CD\n");
    998998    mr_asprintf(&tmp, "%s/archives/NOT-THE-LAST", mountpoint);
    999999    if (!does_file_exist(tmp)) {
    1000         log_msg
     1000        mr_msg
    10011001            (2,
    10021002             "This is the last CD. I am therefore setting bkpinfo->verify_data to FALSE.");
     
    10331033        retval++;
    10341034    } else {
    1035         log_msg(2, "OK, I've unmounted the ISO file\n");
     1035        mr_msg(2, "OK, I've unmounted the ISO file\n");
    10361036    }
    10371037    mr_free(command);
     
    10451045        if (!bkpinfo->please_dont_eject
    10461046            && eject_device(bkpinfo->media_device)) {
    1047             log_msg(2, "Failed to eject CD-ROM drive");
     1047            mr_msg(2, "Failed to eject CD-ROM drive");
    10481048        }
    10491049    }
     
    10751075    assert(bkpinfo != NULL);
    10761076
    1077     log_msg(3, "verify_tape_backups --- starting");
     1077    mr_msg(3, "verify_tape_backups --- starting");
    10781078    log_to_screen(_("Verifying backups"));
    10791079    openin_tape(bkpinfo);
     
    10981098             (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE,
    10991099             changed_files_fname);
    1100     log_msg(2, "Running command to derive list of changed files");
    1101     log_msg(2, tmp);
     1100    mr_msg(2, "Running command to derive list of changed files");
     1101    mr_msg(2, tmp);
    11021102    if (system(tmp)) {
    11031103        if (does_file_exist(changed_files_fname)
     
    11261126                 "%ld files differed from live filesystem; type less %s or less %s to see",
    11271127                 diffs, changed_files_fname, "/tmp/changed.files");
    1128         log_msg(0, tmp);
     1128        mr_msg(0, tmp);
    11291129        mr_free(tmp);
    11301130
Note: See TracChangeset for help on using the changeset viewer.