Ignore:
Timestamp:
Feb 8, 2007, 12:09:34 AM (17 years ago)
Author:
Bruno Cornec
Message:

log_msg => mr_msg for common files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-archive.c

    r1093 r1107  
    1010 * This is the main file (at least the longest one) in libmondo.
    1111 */
     12#include <sys/sem.h>
     13#include <sys/types.h>
     14#include <sys/ipc.h>
     15#include <stdarg.h>
     16#include <unistd.h>
    1217
    1318#include "my-stuff.h"
    1419#include "../common/mondostructures.h"
     20#include "mr_conf.h"
     21#include "mr_mem.h"
     22#include "mr_err.h"
     23#include "mr_str.h"
     24#include "mr_file.h"
     25
    1526#include "libmondo-string-EXT.h"
    1627#include "libmondo-stream-EXT.h"
     
    2637#include "lib-common-externs.h"
    2738
    28 #include "mr_mem.h"
    29 #include "mr_str.h"
    30 #include "mr_file.h"
    31 
    32 #include <sys/sem.h>
    33 #include <sys/types.h>
    34 #include <sys/ipc.h>
    35 #include <stdarg.h>
    3639#define DVDRWFORMAT 1
    3740
     
    9194 */
    9295t_bkptype g_backup_media_type = none;
     96char *g_backup_media_string = NULL;
    9397
    9498/**
     
    142146
    143147    if (semctl(g_sem_id, 0, IPC_RMID, sem_union) == -1) {
    144         log_msg(3, "Failed to delete semaphore");
     148        mr_msg(3, "Failed to delete semaphore");
    145149    }
    146150}
     
    159163    sem_b.sem_flg = SEM_UNDO;
    160164    if (semop(g_sem_id, &sem_b, 1) == -1) {
    161         log_msg(3, "semaphore_p failed");
     165        mr_msg(3, "semaphore_p failed");
    162166        return (0);
    163167    }
     
    177181    sem_b.sem_flg = SEM_UNDO;
    178182    if (semop(g_sem_id, &sem_b, 1) == -1) {
    179         log_msg(3, "semaphore_v failed");
     183        mr_msg(3, "semaphore_v failed");
    180184        return (0);
    181185    }
     
    235239    }
    236240    sprintf(command + strlen(command), " 2>> %s", MONDO_LOGFILE);
    237     log_msg(4, "command = '%s'", command);
     241    mr_msg(4, "command = '%s'", command);
    238242
    239243    for (res = 99, tries = 0; tries < 3 && res != 0; tries++) {
    240         log_msg(5, "command='%s'", command);
     244        mr_msg(5, "command='%s'", command);
    241245        res = system(command);
    242246        strcpy(tmp, last_line_of_file(MONDO_LOGFILE));
    243         log_msg(1, "res=%d; tmp='%s'", res, tmp);
     247        mr_msg(1, "res=%d; tmp='%s'", res, tmp);
    244248        if (bkpinfo->use_star && (res == 254 || res == 65024)
    245249            && strstr(tmp, "star: Processed all possible files")
    246250            && tries > 0) {
    247             log_msg(1, "Star returned nonfatal error");
     251            mr_msg(1, "Star returned nonfatal error");
    248252            res = 0;
    249253        }
     
    253257            if (p) {
    254258                p[0] = p[1] = p[2] = p[3] = ' ';
    255                 log_msg(1, "new command = '%s'", command);
     259                mr_msg(1, "new command = '%s'", command);
    256260            } else {
    257                 log_msg(3,
     261                mr_msg(3,
    258262                        "Attempt #%d failed. Pausing 3 seconds and retrying...",
    259263                        tries + 1);
     
    264268    retval += res;
    265269    if (retval) {
    266         log_msg(3, "Failed to write set %d", setno);
     270        mr_msg(3, "Failed to write set %d", setno);
    267271    } else if (tries > 1) {
    268         log_msg(3, "Succeeded in writing set %d, on try #%d", setno,
     272        mr_msg(3, "Succeeded in writing set %d, on try #%d", setno,
    269273                tries);
    270274    }
     
    344348            strcat(zipparams, tmp);
    345349        } else {
    346             log_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp);
     350            mr_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp);
    347351        }
    348352    } else {
     
    373377
    374378    for (res = 99, tries = 0; tries < 3 && res != 0; tries++) {
    375         log_msg(5, "command='%s'", command);
     379        mr_msg(5, "command='%s'", command);
    376380        res = system(command);
    377381        if (res) {
    378382            log_OS_error(command);
    379             log_msg(3,
     383            mr_msg(3,
    380384                    "Attempt #%d failed. Pausing 3 seconds and retrying...",
    381385                    tries + 1);
     
    385389    retval += res;
    386390    if (retval) {
    387         log_msg(3, "Failed to write set %d", setno);
     391        mr_msg(3, "Failed to write set %d", setno);
    388392    } else if (tries > 1) {
    389         log_msg(3, "Succeeded in writing set %d, on try #%d", setno,
     393        mr_msg(3, "Succeeded in writing set %d, on try #%d", setno,
    390394                tries);
    391395    }
     
    397401            if (free_ramdisk_space > i) {
    398402                free_ramdisk_space = i;
    399                 log_msg(2, "min(free_ramdisk_space) is now %d",
     403                mr_msg(2, "min(free_ramdisk_space) is now %d",
    400404                        free_ramdisk_space);
    401405                if (free_ramdisk_space < 10) {
     
    495499    retval += make_those_slices_phase(bkpinfo); // backup BIG files
    496500    retval += do_that_final_phase(bkpinfo); // clean up
    497     log_msg(1, "Creation of archives... complete.");
     501    mr_msg(1, "Creation of archives... complete.");
    498502    if (bkpinfo->verify_data) {
    499503        sleep(2);
     
    574578            bkpinfo->exclude_paths);
    575579    strcpy(devs_to_exclude, call_program_and_get_last_line_of_output(tmp));
    576     log_msg(2, tmp);
     580    mr_msg(2, tmp);
    577581    mvaddstr_and_log_it(g_currentY, 0,
    578582                        "Calling MINDI to create boot+data disks");
     
    622626            sprintf(tmp, "User specified boot loader. It is '%c'.",
    623627                    bkpinfo->boot_loader);
    624             log_msg(2, tmp);
     628            mr_msg(2, tmp);
    625629        } else {
    626630            bkpinfo->boot_loader = ch;
     
    629633            sprintf(tmp, "User specified boot device. It is '%s'.",
    630634                    bkpinfo->boot_device);
    631             log_msg(2, tmp);
     635            mr_msg(2, tmp);
    632636        } else {
    633637            strcpy(bkpinfo->boot_device, bootdev);
     
    857861            //use_gzip_sz);         // parameter #20 (STRING)
    858862
    859     log_msg(2, command);
     863    mr_msg(2, command);
    860864
    861865    res = run_program_and_log_to_screen(command, "Generating boot+data disks");
     
    866870        log_to_screen("Boot+data disks were created OK");
    867871        sprintf(command, "mkdir -p /var/cache/mindi/");
    868         log_msg(2, command);
     872        mr_msg(2, command);
    869873        run_program_and_log_output(command, FALSE);
    870874        sprintf(command,
    871875                "cp -f %s/images/mindi.iso /var/cache/mindi/mondorescue.iso",
    872876                bkpinfo->scratchdir);
    873         log_msg(2, command);
     877        mr_msg(2, command);
    874878        run_program_and_log_output(command, FALSE);
    875879        if (bkpinfo->nonbootable_backup) {
     
    991995        }
    992996        if (!semaphore_p()) {
    993             log_msg(3, "P sem failed (pid=%d)", (int) getpid());
     997            mr_msg(3, "P sem failed (pid=%d)", (int) getpid());
    994998            fatal_error("Cannot get semaphore P");
    995999        }
     
    10081012                bkpinfo->tmpdir, archiving_set_no);
    10091013        if (!does_file_exist(archiving_filelist_fname)) {
    1010             log_msg(3,
     1014            mr_msg(3,
    10111015                    "%s[%d:%d] - well, I would archive %d, except that it doesn't exist. I'll stop now.",
    10121016                    FORTY_SPACES, getpid(), this_thread_no,
     
    10181022                archiving_set_no - ARCH_BUFFER_NUM, bkpinfo->zip_suffix);
    10191023        if (does_file_exist(tmp)) {
    1020             log_msg(4, "%s[%d:%d] - waiting for storer", FORTY_SPACES,
     1024            mr_msg(4, "%s[%d:%d] - waiting for storer", FORTY_SPACES,
    10211025                    getpid(), this_thread_no);
    10221026            while (does_file_exist(tmp)) {
    10231027                sleep(1);
    10241028            }
    1025             log_msg(4, "[%d] - continuing", getpid());
    1026         }
    1027 
    1028         log_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),
     1029            mr_msg(4, "[%d] - continuing", getpid());
     1030        }
     1031
     1032        mr_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),
    10291033                this_thread_no, archiving_set_no);
    10301034        if (g_getfattr) {
     
    10391043        }
    10401044
    1041         log_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),
     1045        mr_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),
    10421046                this_thread_no, archiving_set_no);
    10431047        res =
     
    10661070            fatal_error("Cannot get semaphore V");
    10671071        }
    1068         log_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(),
     1072        mr_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(),
    10691073                this_thread_no, archiving_set_no);
    10701074        archiving_set_no++;
     
    10771081        fatal_error("Cannot get semaphore V");
    10781082    }
    1079     log_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(),
     1083    mr_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(),
    10801084            this_thread_no);
    10811085    mr_free(archiving_filelist_fname);
     
    11131117                        "Writing any remaining data to media         ");
    11141118
    1115     log_msg(1, "Closing tape/CD ... ");
     1119    mr_msg(1, "Closing tape/CD ... ");
    11161120    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type))
    11171121        /* write tape/cdstream */
     
    11241128        retval += res;
    11251129        if (res) {
    1126             log_msg(1, "write_final_iso_if_necessary returned an error");
    1127         }
    1128     }
    1129     log_msg(2, "Fork is exiting ... ");
     1130            mr_msg(1, "write_final_iso_if_necessary returned an error");
     1131        }
     1132    }
     1133    mr_msg(2, "Fork is exiting ... ");
    11301134
    11311135    mvaddstr_and_log_it(g_currentY++, 74, "Done.");
     
    11811185    strip_spaces(g_serial_string);
    11821186    strcat(g_serial_string, "...word.");
    1183     log_msg(2, "g_serial_string = '%s'", g_serial_string);
     1187    mr_msg(2, "g_serial_string = '%s'", g_serial_string);
    11841188    assert(strlen(g_serial_string) < MAX_STR_LEN);
    11851189
    11861190    sprintf(tmpfile, "%s/archives/SERIAL-STRING", bkpinfo->scratchdir);
    11871191    if (write_one_liner_data_file(tmpfile, g_serial_string)) {
    1188         log_msg(1, "%ld: Failed to write serial string", __LINE__);
     1192        mr_msg(1, "%ld: Failed to write serial string", __LINE__);
    11891193    }
    11901194
     
    11991203            fatal_error("Cannot open backup (streaming) device");
    12001204        }
    1201         log_msg(1, "Backup (stream) opened OK");
     1205        mr_msg(1, "Backup (stream) opened OK");
    12021206        write_data_disks_to_stream(data_disks_file);
    12031207    } else {
    1204         log_msg(1, "Backing up to CD's");
     1208        mr_msg(1, "Backing up to CD's");
    12051209    }
    12061210
     
    12751279    sprintf(command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile,
    12761280            tempfile);
    1277     log_msg(3, command);
     1281    mr_msg(3, command);
    12781282    open_evalcall_form(title);
    12791283    if (!(pin = popen(command, "r"))) {
     
    12891293        trackno = get_trackno_from_logfile(tempfile);
    12901294        if (trackno < 0 || trackno > 80) {
    1291             log_msg(1, "Weird track#");
     1295            mr_msg(1, "Weird track#");
    12921296            continue;
    12931297        }
     
    14401444    int misc_counter_that_is_not_important = 0;
    14411445
    1442     log_msg(8, "here");
     1446    mr_msg(8, "here");
    14431447    assert(bkpinfo != NULL);
    14441448    tmp = mr_malloc(MAX_STR_LEN * 2);
     
    14661470    sprintf(tmp, "%s/archives/filelist.full", bkpinfo->scratchdir);
    14671471    log_to_screen("Archiving regular files");
    1468     log_msg(5, "Go, Shorty. It's your birthday.");
     1472    mr_msg(5, "Go, Shorty. It's your birthday.");
    14691473    open_progress_form("Backing up filesystem",
    14701474                       "I am backing up your live filesystem now.",
     
    14731477                       get_last_filelist_number(bkpinfo) + 1);
    14741478
    1475     log_msg(5, "We're gonna party like it's your birthday.");
     1479    mr_msg(5, "We're gonna party like it's your birthday.");
    14761480
    14771481    srand((unsigned int) getpid());
     
    14861490    }                           // initialize semaphore
    14871491    for (noof_threads = 0; noof_threads < ARCH_THREADS; noof_threads++) {
    1488         log_msg(8, "Creating thread #%d", noof_threads);
     1492        mr_msg(8, "Creating thread #%d", noof_threads);
    14891493        (*p_archival_threads_running)++;
    14901494        if ((res =
     
    14961500    }
    14971501
    1498     log_msg(8, "About to enter while() loop");
     1502    mr_msg(8, "About to enter while() loop");
    14991503    while (!done_storing) {
    15001504        if (g_exiting) {
     
    15031507        if (*p_archival_threads_running == 0
    15041508            && *p_last_set_archived == storing_set_no - 1) {
    1505             log_msg(2,
     1509            mr_msg(2,
    15061510                    "No archival threads are running. The last stored set was %d and I'm looking for %d. Take off your make-up; the party's over... :-)",
    15071511                    *p_last_set_archived, storing_set_no);
     
    15321536            }
    15331537
    1534             log_msg(2, "Storing set %d", storing_set_no);
     1538            mr_msg(2, "Storing set %d", storing_set_no);
    15351539            while (!does_file_exist(storing_filelist_fname)
    15361540                   || !does_file_exist(storing_afioball_fname)) {
    1537                 log_msg(2,
     1541                mr_msg(2,
    15381542                        "Warning - either %s or %s doesn't exist yet. I'll pause 5 secs.",
    15391543                        storing_filelist_fname, storing_afioball_fname);
     
    15981602
    15991603    sprintf(tmp, "Your regular files have been archived ");
    1600     log_msg(2, "Joining background threads to foreground thread");
     1604    mr_msg(2, "Joining background threads to foreground thread");
    16011605    for (i = 0; i < noof_threads; i++) {
    16021606        pthread_join(archival_thread[i], pvp);
    1603         log_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads);
     1607        mr_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads);
    16041608    }
    16051609    del_semvalue();
    1606     log_msg(2, "Done.");
     1610    mr_msg(2, "Done.");
    16071611    if (retval) {
    16081612        strcat(tmp, "(with errors).");
     
    16941698       if (!does_file_exist(tmp))
    16951699       {
    1696        log_msg (2, "Silly bug in Mindi.pl; workaround in progress...");
     1700       mr_msg (2, "Silly bug in Mindi.pl; workaround in progress...");
    16971701       strcpy(fnam, call_program_and_get_last_line_of_output("locate isolinux.bin | tail -n1"));
    16981702       if (strlen(fnam)>0 && does_file_exist(fnam))
     
    17071711       if (res)
    17081712       {
    1709        log_msg (2, "Could not work around silly bug in Mindi.pl - sorry! Isolinux.bin missing");
     1713       mr_msg (2, "Could not work around silly bug in Mindi.pl - sorry! Isolinux.bin missing");
    17101714       }
    17111715       }
     
    17171721    }
    17181722
    1719     log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s",
     1723    mr_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s",
    17201724            bkpinfo->scratchdir, destfile);
    17211725    (void) getcwd(old_pwd, MAX_STR_LEN - 1);
     
    17411745
    17421746    if (bkpinfo->call_make_iso[0] != '\0') {
    1743         log_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso);
     1747        mr_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso);
    17441748        sprintf(tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir);
    17451749        sprintf(message_to_screen, "Making an ISO (%s #%d)",
     
    17901794                sprintf(sz_blank_disk, "dvd+rw-format -force %s",
    17911795                        bkpinfo->media_device);
    1792                 log_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);
     1796                mr_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);
    17931797                res =
    17941798                    run_external_binary_with_percentage_indicator_NEW
     
    18431847                media_descriptor_string(bkpinfo->backup_media_type),
    18441848                g_current_media_number);
    1845         log_msg(1, message_to_screen);
     1849        mr_msg(1, message_to_screen);
    18461850        sprintf(result_sz, "Call to mkisofs to make ISO (%s #%d) ",
    18471851                media_descriptor_string(bkpinfo->backup_media_type),
    18481852                g_current_media_number);
    18491853        if (bkpinfo->nonbootable_backup) {
    1850             log_msg(1, "Making nonbootable backup");
     1854            mr_msg(1, "Making nonbootable backup");
    18511855            res =
    18521856                eval_call_to_make_ISO(bkpinfo,
     
    18551859                                      MONDO_LOGFILE, message_to_screen);
    18561860        } else {
    1857             log_msg(1, "Making bootable backup");
     1861            mr_msg(1, "Making bootable backup");
    18581862
    18591863#ifdef __FreeBSD__
     
    18621866
    18631867
    1864             log_msg(1, "make_cd_use_lilo is actually %d",
     1868            mr_msg(1, "make_cd_use_lilo is actually %d",
    18651869                    bkpinfo->make_cd_use_lilo);
    18661870            if (bkpinfo->make_cd_use_lilo) {
    1867                 log_msg(1, "make_cd_use_lilo = TRUE");
     1871                mr_msg(1, "make_cd_use_lilo = TRUE");
    18681872// FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo
    18691873// and add ' .' at end
    18701874#ifdef __IA64__
    1871                 log_msg(1, "IA64 --> elilo");
     1875                mr_msg(1, "IA64 --> elilo");
    18721876                res = eval_call_to_make_ISO(bkpinfo,
    18731877                                            //-b images/mindi-boot.2880.img
     
    18821886// FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo
    18831887// and add ' .' at end
    1884                 log_msg(1, "Non-ia64 --> lilo");
     1888                mr_msg(1, "Non-ia64 --> lilo");
    18851889                res =
    18861890                    eval_call_to_make_ISO(bkpinfo,
     
    18911895#endif
    18921896            } else {
    1893                 log_msg(1, "make_cd_use_lilo = FALSE");
    1894                 log_msg(1, "Isolinux");
     1897                mr_msg(1, "make_cd_use_lilo = FALSE");
     1898                mr_msg(1, "Isolinux");
    18951899                res =
    18961900                    eval_call_to_make_ISO(bkpinfo,
     
    19131917        || bkpinfo->backup_media_type == cdrw) {
    19141918        if (is_this_device_mounted(bkpinfo->media_device)) {
    1915             log_msg(2,
     1919            mr_msg(2,
    19161920                    "Warning - %s mounted. I'm unmounting it before I burn to it.",
    19171921                    bkpinfo->media_device);
     
    19221926
    19231927    if (bkpinfo->call_burn_iso[0] != '\0') {
    1924         log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso);
     1928        mr_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso);
    19251929        sprintf(message_to_screen, "Burning %s #%d",
    19261930                media_descriptor_string(bkpinfo->backup_media_type),
     
    19591963    chdir(old_pwd);
    19601964    if (retval) {
    1961         log_msg(1, "WARNING - make_iso_fs returned an error");
     1965        mr_msg(1, "WARNING - make_iso_fs returned an error");
    19621966    }
    19631967    mr_free(old_pwd);
     
    19871991            "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1",
    19881992            bigfile_fname);
    1989     log_msg(1, "command = '%s'", command);
     1993    mr_msg(1, "command = '%s'", command);
    19901994    strcpy(tmp, call_program_and_get_last_line_of_output(command));
    1991     log_msg(1, "--> tmp = '%s'", tmp);
     1995    mr_msg(1, "--> tmp = '%s'", tmp);
    19921996    if (strstr(tmp, "NTFS")) {
    19931997        iamhere("TRUE");
     
    20502054        size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1;
    20512055
    2052     log_msg(1, "size of all biggiefiles = %ld",
     2056    mr_msg(1, "size of all biggiefiles = %ld",
    20532057            size_of_all_biggiefiles_K(bkpinfo));
    2054     log_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld",
     2058    mr_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld",
    20552059            size_of_all_biggiefiles_K(bkpinfo), bkpinfo->optimal_set_size,
    20562060            estimated_total_noof_slices);
    20572061
    20582062    if (length_of_file(biggielist_fname) < 6) {
    2059         log_msg(1, "No biggiefiles; fair enough...");
     2063        mr_msg(1, "No biggiefiles; fair enough...");
    20602064        return (0);
    20612065    }
     
    20882092            // Call ntfsclone (formerly partimagehack) if it's a /dev entry
    20892093            // (i.e. a partition to be imaged)
    2090             log_msg(2, "bigfile_fname = %s", bigfile_fname);
     2094            mr_msg(2, "bigfile_fname = %s", bigfile_fname);
    20912095            use_ntfsprog = FALSE;
    20922096            if (!strncmp(bigfile_fname, "/dev/", 5)
    20932097                && is_dev_an_NTFS_dev(bigfile_fname)) {
    20942098                use_ntfsprog = TRUE;
    2095                 log_msg(2,
     2099                mr_msg(2,
    20962100                        "Calling ntfsclone in background because %s is an NTFS partition",
    20972101                        bigfile_fname);
     
    21062110                    fatal_error("Fork failure");
    21072111                case 0:
    2108                     log_msg(2,
     2112                    mr_msg(2,
    21092113                            "CHILD - fip - calling feed_into_ntfsprog(%s, %s)",
    21102114                            bigfile_fname, sz_devfile);
     
    21132117                    break;
    21142118                default:
    2115                     log_msg(2,
     2119                    mr_msg(2,
    21162120                            "feed_into_ntfsprog() called in background --- pid=%ld",
    21172121                            (long int) (pid));
     
    21692173#endif
    21702174    }
    2171     log_msg(1, "Finished backing up bigfiles");
    2172     log_msg(1, "estimated slices = %ld; actual slices = %ld",
     2175    mr_msg(1, "Finished backing up bigfiles");
     2176    mr_msg(1, "estimated slices = %ld; actual slices = %ld",
    21732177            estimated_total_noof_slices, g_current_progress);
    21742178    close_progress_form();
     
    22332237                bkpinfo->tmpdir, curr_set_no, bkpinfo->zip_suffix);
    22342238
    2235         log_msg(1, "EXAT'g set %ld", curr_set_no);
     2239        mr_msg(1, "EXAT'g set %ld", curr_set_no);
    22362240        if (g_getfattr) {
    22372241            sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     
    22452249        }
    22462250
    2247         log_msg(1, "Archiving set %ld", curr_set_no);
     2251        mr_msg(1, "Archiving set %ld", curr_set_no);
    22482252        res =
    22492253            archive_this_fileset(bkpinfo, curr_filelist_fname,
     
    23492353                                     BLK_START_AFIOBALLS);
    23502354#if __FreeBSD__ == 5
    2351         log_msg(1,
     2355        mr_msg(1,
    23522356                "Using single-threaded make_afioballs_and_images() to suit b0rken FreeBSD 5.0");
    23532357        res = make_afioballs_and_images_OLD(bkpinfo);
     
    23642368    if (res) {
    23652369        mvaddstr_and_log_it(g_currentY++, 74, "Errors.");
    2366         log_msg(1, "make_afioballs_and_images returned an error");
     2370        mr_msg(1, "make_afioballs_and_images returned an error");
    23672371    } else {
    23682372        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
     
    24152419    paranoid_system(command);
    24162420    sprintf(blah, "biggielist = %s", biggielist);
    2417     log_msg(2, blah);
     2421    mr_msg(2, blah);
    24182422
    24192423    if (!does_file_exist(biggielist)) {
    2420         log_msg(1, "BTW, the biggielist does not exist");
     2424        mr_msg(1, "BTW, the biggielist does not exist");
    24212425    }
    24222426
     
    24452449    retval += res;
    24462450    if (res) {
    2447         log_msg(1, "make_slices_and_images returned an error");
     2451        mr_msg(1, "make_slices_and_images returned an error");
    24482452        mvaddstr_and_log_it(g_currentY++, 74, "Errors.");
    24492453    } else {
     
    25152519        strcpy(curr_file, cf);
    25162520        if (!does_file_exist(curr_file)) {
    2517             log_msg(1,
     2521            mr_msg(1,
    25182522                    "Warning - you're trying to add a non-existent file - '%s' to the CD",
    25192523                    curr_file);
    25202524        } else {
    2521             log_msg(8, "Trying to add file %s to CD", curr_file);
     2525            mr_msg(8, "Trying to add file %s to CD", curr_file);
    25222526            would_occupy += length_of_file(curr_file) / 1024;
    25232527        }
     
    25322536        retval += res;
    25332537        if (res) {
    2534             log_msg(1, "WARNING - write_iso_and_go_on returned an error");
     2538            mr_msg(1, "WARNING - write_iso_and_go_on returned an error");
    25352539        }
    25362540    }
     
    25482552        retval += res;
    25492553        if (res) {
    2550             log_msg(1, "(move_files_to_cd) '%s' failed", tmp);
     2554            mr_msg(1, "(move_files_to_cd) '%s' failed", tmp);
    25512555        } else {
    2552             log_msg(8, "Moved %s to CD OK", tmp);
     2556            mr_msg(8, "Moved %s to CD OK", tmp);
    25532557        }
    25542558        //      unlink (curr_file);
     
    25572561
    25582562    if (retval) {
    2559         log_msg(1,
     2563        mr_msg(1,
    25602564                "Warning - errors occurred while I was adding files to CD dir");
    25612565    }
     
    26272631        sprintf(bootdisk_dev, "/dev/fd0H1722");
    26282632    } else {
    2629         log_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*");
     2633        mr_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*");
    26302634        strcpy(bootdisk_dev, DEFAULT_1722MB_DISK);
    26312635//      return (1);
     
    26332637    strcpy(datadisk_dev, "/dev/fd0");
    26342638    if (!does_device_exist(datadisk_dev)) {
    2635         log_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*");
     2639        mr_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*");
    26362640        strcpy(datadisk_dev, "/dev/fd0");
    26372641//      return (1);
     
    26912695                }
    26922696                sprintf(tmp, "cat %s > %s", rootdisk_file, datadisk_dev);
    2693                 log_msg(1, "tmp = '%s'", tmp);
     2697                mr_msg(1, "tmp = '%s'", tmp);
    26942698                res +=
    26952699                    run_external_binary_with_percentage_indicator_NEW
     
    27072711    for (i = 1; i < 99; i++) {
    27082712        sprintf(tmp, "%s/mindi-data-%d.img", imagesdir, i);
    2709         log_msg(3, tmp);
     2713        mr_msg(3, tmp);
    27102714        if (!does_file_exist(tmp)) {
    2711             log_msg(3, "...not found");
     2715            mr_msg(3, "...not found");
    27122716            break;
    27132717        }
     
    28372841        strcpy(curr_file, cf);
    28382842        if (!does_file_exist(curr_file)) {
    2839             log_msg(1,
     2843            mr_msg(1,
    28402844                    "Warning - you're trying to add a non-existent file - '%s' to the tape",
    28412845                    curr_file);
     
    28642868
    28652869    if (retval) {
    2866         log_msg(1,
     2870        mr_msg(1,
    28672871                "Warning - errors occurred while I was adding file to tape");
    28682872    }
     
    29072911        } else {
    29082912            cdrecord[0] = '\0';
    2909             log_msg(2, "Oh well. I guess I'll just pray then.");
     2913            mr_msg(2, "Oh well. I guess I'll just pray then.");
    29102914        }
    29112915        if (cdrecord[0]) {
     
    29192923                        ("Unable to examine CD. Are you sure this is a valid CD-R(W) CD?"))
    29202924                    {
    2921                         log_msg(1, "Well, he insisted...");
     2925                        mr_msg(1, "Well, he insisted...");
    29222926                        break;
    29232927                    }
     
    29902994    if (!find_cdrom_device(cdrom_dev, FALSE)) {
    29912995/* When enabled, it made CD eject-and-retract when wrong CD inserted.. Weird
    2992       log_msg(2, "paafcd: Retracting CD-ROM drive if possible" );
     2996      mr_msg(2, "paafcd: Retracting CD-ROM drive if possible" );
    29932997      retract_CD_tray_and_defeat_autorun();
    29942998*/
     
    30033007        if ((attempt_to_mount_returned_this =
    30043008             run_program_and_log_output(tmp, 1))) {
    3005             log_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt);
     3009            mr_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt);
    30063010            log_to_screen("If there's a CD/DVD in the drive, it's blank.");
    30073011            /*
     
    30313035        }
    30323036        run_program_and_log_output(szunmount, 1);
    3033         log_msg(2, "paafcd: cd_number = %d", cd_number);
    3034         log_msg(2, "our serial str = %s; g_serial_string = %s",
     3037        mr_msg(2, "paafcd: cd_number = %d", cd_number);
     3038        mr_msg(2, "our serial str = %s; g_serial_string = %s",
    30353039                our_serial_str, g_serial_string);
    30363040        if (cd_number > 0 && !strcmp(our_serial_str, g_serial_string)) {
    3037             log_msg(2, "This %s is part of this backup set!",
     3041            mr_msg(2, "This %s is part of this backup set!",
    30383042                    media_descriptor_string(g_backup_media_type));
    30393043            ok_go_ahead_burn_it = FALSE;
     
    30513055        }
    30523056    } else {
    3053         log_msg(2,
     3057        mr_msg(2,
    30543058                "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?",
    30553059                media_descriptor_string(g_backup_media_type));
     
    30793083        goto gotos_make_me_puke;
    30803084    } else {
    3081         log_msg(2, "paafcd: OK, going ahead and burning it.");
    3082     }
    3083 
    3084     log_msg(2,
     3085        mr_msg(2, "paafcd: OK, going ahead and burning it.");
     3086    }
     3087
     3088    mr_msg(2,
    30853089            "paafcd: OK, I assume I have a blank/reusable %s in the drive...",
    30863090            media_descriptor_string(g_backup_media_type));
     
    32413245        file_to_openin = ntfsprog_fifo;
    32423246        strcpy(checksum_line, "IGNORE");
    3243         log_msg(2,
     3247        mr_msg(2,
    32443248                "Not calculating checksum for %s: it would take too long",
    32453249                biggie_filename);
     
    32833287    paranoid_fclose(fout);
    32843288    length = totallength / optimal_set_size / 1024;
    3285     log_msg(1, "Opening in %s; slicing it and writing to CD/tape",
     3289    mr_msg(1, "Opening in %s; slicing it and writing to CD/tape",
    32863290            file_to_openin);
    32873291    if (!(fin = fopen(file_to_openin, "r"))) {
     
    33403344        {
    33413345            if (!does_file_exist(curr_slice_fname_uncompressed)) {
    3342                 log_msg(2,
     3346                mr_msg(2,
    33433347                        "Warning - '%s' doesn't exist. How can I compress slice?",
    33443348                        curr_slice_fname_uncompressed);
     
    33483352                        bkpinfo->compression_level,
    33493353                        curr_slice_fname_uncompressed);
    3350                 log_msg(2, command);
     3354                mr_msg(2, command);
    33513355                if ((res = system(command))) {
    33523356                    log_OS_error(command);
     
    33623366            retval += res;
    33633367            if (res) {
    3364                 log_msg(2, "Failed to compress the slice");
     3368                mr_msg(2, "Failed to compress the slice");
    33653369            }
    33663370            if (bkpinfo->use_lzo
     
    33823386                newtRefresh();
    33833387            } else {
    3384                 log_msg(2, tmp);
     3388                mr_msg(2, tmp);
    33853389            }
    33863390#else
    3387             log_msg(2, tmp);
     3391            mr_msg(2, tmp);
    33883392#endif
    33893393            strcpy(file_to_archive, curr_slice_fname_compressed);
     
    34243428        strcat(tmp, "...OK!");
    34253429    }
    3426     log_msg(1, tmp);
     3430    mr_msg(1, tmp);
    34273431    mr_free(tempblock);
    34283432    mr_free(tmp);
     
    34743478    sprintf(tmp, "rm -f %s/zero", dir);
    34753479    run_program_and_log_output(tmp, FALSE);
    3476     log_msg(1, "Wiped %s's archives", dir);
     3480    mr_msg(1, "Wiped %s's archives", dir);
    34773481    sprintf(tmp, "ls -l %s", dir);
    34783482    run_program_and_log_output(tmp, FALSE);
     
    35113515
    35123516    sprintf(tmp, "Writing the final ISO");
    3513     log_msg(2, tmp);
     3517    mr_msg(2, tmp);
    35143518    center_string(tmp, 80);
    35153519#ifndef _XWIN
     
    35243528    }
    35253529#endif
    3526     log_msg(2, "Returning from writing final ISO (res=%d)", res);
     3530    mr_msg(2, "Returning from writing final ISO (res=%d)", res);
    35273531    mr_free(tmp);
    35283532    return (res);
     
    35823586        using_nfs = FALSE;
    35833587    }
    3584     log_msg(1, "OK, time to make %s #%d",
     3588    mr_msg(1, "OK, time to make %s #%d",
    35853589            media_descriptor_string(bkpinfo->backup_media_type),
    35863590            g_current_media_number);
     
    35963600            bkpinfo->scratchdir);
    35973601    if (run_program_and_log_output(tmp, FALSE)) {
    3598         log_msg(2, "Warning - unable to copy autorun to scratchdir");
     3602        mr_msg(2, "Warning - unable to copy autorun to scratchdir");
    35993603    }
    36003604
     
    36033607    if (last_cd) {
    36043608        unlink(lastcd_fname);
    3605         log_msg(2,
     3609        mr_msg(2,
    36063610                "OK, you're telling me this is the last CD. Fair enough.");
    36073611    } else {
     
    36363640            if (find_cdrom_device(tmp, FALSE))  // make sure find_cdrom_device() finds, records CD-R's loc
    36373641            {
    3638                 log_msg(3, "*Sigh* Mike, I hate your computer.");
     3642                mr_msg(3, "*Sigh* Mike, I hate your computer.");
    36393643                bkpinfo->manual_cd_tray = TRUE;
    36403644            }                   // if it can't be found then force pausing
    36413645            else {
    3642                 log_msg(3, "Great. Found Mike's CD-ROM drive.");
     3646                mr_msg(3, "Great. Found Mike's CD-ROM drive.");
    36433647            }
    36443648        }
     
    36663670                }
    36673671            } else {
    3668                 log_msg(2, "Retrying, at user's request...");
     3672                mr_msg(2, "Retrying, at user's request...");
    36693673                res = 0;
    36703674            }
     
    36873691            bkpinfo->scratchdir, bkpinfo->scratchdir);
    36883692    if (system(tmp)) {
    3689         log_msg
     3693        mr_msg
    36903694            (2,
    36913695             "Error occurred when I tried to delete the redundant IMGs and GZs");
     
    36933697
    36943698    if (last_cd) {
    3695         log_msg(2, "This was your last CD.");
     3699        mr_msg(2, "This was your last CD.");
    36963700    } else {
    3697         log_msg(2, "Continuing to backup your data...");
     3701        mr_msg(2, "Continuing to backup your data...");
    36983702    }
    36993703
     
    37423746        //bkpinfo->backup_media_type == cdrw || bkpinfo->backup_media_type == cdr))
    37433747    {
    3744         log_msg(2,
     3748        mr_msg(2,
    37453749                "Not verifying again. Per-CD/ISO verification already carried out.");
    37463750        paranoid_system
     
    37543758        for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) {
    37553759            if (cdno != g_current_media_number) {
    3756                 log_msg(2,
     3760                mr_msg(2,
    37573761                        "Warning - had to change g_current_media_number from %d to %d",
    37583762                        g_current_media_number, cdno);
     
    38573861    }
    38583862    sprintf(tmp, "maxblocks = %d; p=%s", maxblocks, p);
    3859     log_msg(2, tmp);
     3863    mr_msg(2, tmp);
    38603864    /* copy data from image to floppy */
    38613865    if (!(fin = fopen(datafile, "r"))) {
     
    38713875        if (fread(blk, 1, 1024, fin) != 1024) {
    38723876            if (feof(fin)) {
    3873                 log_msg(1,
     3877                mr_msg(1,
    38743878                        "img read err - img ended prematurely - non-fatal error");
    38753879                sleep(3);
Note: See TracChangeset for help on using the changeset viewer.