Changeset 507 in MondoRescue for trunk/mondo/mondo/mondoarchive


Ignore:
Timestamp:
Apr 30, 2006, 2:04:16 AM (18 years ago)
Author:
bcornec
Message:

merge -r489:506 $SVN_M/branches/stable

Location:
trunk/mondo/mondo/mondoarchive
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/mondoarchive/main.c

    r426 r507  
    138138    char *say_at_end = NULL;
    139139
     140#ifdef ENABLE_NLS
     141    setlocale(LC_ALL, "");
     142    (void) textdomain("mondo");
     143#endif
    140144/* Make sure I'm root; abort if not */
    141145    if (getuid() != 0) {
    142         fprintf(stderr, "Please run as root.\r\n");
     146        fprintf(stderr, _("Please run as root.\n"));
    143147        exit(127);
    144148    }
     
    148152        && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V")
    149153            || !strcmp(argv[argc - 1], "--version"))) {
    150         printf("mondoarchive v%s\nSee man page for help\n", PACKAGE_VERSION);
     154        printf(_("mondoarchive v%s\nSee man page for help\n"), PACKAGE_VERSION);
    151155        exit(0);
    152156    }
     
    157161
    158162    diffs = 0;
    159     printf("Initializing...\n");
     163    printf(_("Initializing...\n"));
    160164    if (!(bkpinfo = malloc(sizeof(struct s_bkpinfo)))) {
    161165        fatal_error("Cannot malloc bkpinfo");
     
    197201        setup_newt_stuff();
    198202        if (!strstr(argv[2], "filelist")) {
    199             printf("Sorry - filelist goes first\n");
     203            printf(_("Sorry - filelist goes first\n"));
    200204            finish(1);
    201205        } else {
     
    226230        setup_newt_stuff();
    227231        if (!strstr(argv[2], "filelist")) {
    228             printf("Sorry - filelist goes first\n");
     232            printf(_("Sorry - filelist goes first\n"));
    229233            finish(1);
    230234        } else {
     
    245249        setup_newt_stuff();
    246250        if ((tmp = find_cdrw_device()) == NULL) {
    247             printf("Failed to find CDR-RW drive\n");
    248         } else {
    249             printf("CD-RW is at %s\n", tmp);
     251            printf(_("Failed to find CDR-RW drive\n"));
     252        } else {
     253            printf(_("CD-RW is at %s\n"), tmp);
    250254        }
    251255        paranoid_free(tmp);
    252256
    253257        if ((tmp = find_cdrom_device(FALSE)) == NULL) {
    254             printf("Failed to find CD-ROM drive\n");
    255         } else {
    256             printf("CD-ROM is at %s\n", tmp);
     258            printf(_("Failed to find CD-ROM drive\n"));
     259        } else {
     260            printf(_("CD-ROM is at %s\n"), tmp);
    257261        }
    258262        paranoid_free(tmp);
     
    265269        setup_newt_stuff();
    266270        if ((tmp = find_dvd_device()) == NULL) {
    267             printf("Failed to find DVD drive\n");
    268         } else {
    269             printf("DVD is at %s\n", tmp);
     271            printf(_("Failed to find DVD drive\n"));
     272        } else {
     273            printf(_("DVD is at %s\n"), tmp);
    270274        }
    271275        paranoid_free(tmp);
     
    279283    if (argc > 2 && !strcmp(argv[1], "test-dev")) {
    280284        if (is_dev_an_NTFS_dev(argv[2])) {
    281             printf("%s is indeed an NTFS dev\n", argv[2]);
    282         } else {
    283             printf("%s is _not_ an NTFS dev\n", argv[2]);
     285            printf(_("%s is indeed an NTFS dev\n"), argv[2]);
     286        } else {
     287            printf(_("%s is _not_ an NTFS dev\n"), argv[2]);
    284288        }
    285289        finish(0);
     
    304308        if (res) {
    305309            printf
    306                 ("Errors were detected in the command line you supplied.\n");
    307             printf("Please review the log file - " MONDO_LOGFILE "\n");
     310                (_("Errors were detected in the command line you supplied.\n"));
     311            printf(_("Please review the log file - %s \n"),MONDO_LOGFILE);
    308312            log_msg(1, "Mondoarchive will now exit.");
    309313            finish(1);
     
    319323
    320324    log_to_screen
    321         ("BusyBox's sources are available from http://www.busybox.net");
     325        (_("BusyBox's sources are available from http://www.busybox.net"));
    322326
    323327    /* If we're meant to backup then backup */
     
    327331        if (res) {
    328332            asprintf(&say_at_end,
    329                    "Data archived. Please check the logs, just as a precaution. ");
    330         } else {
    331             asprintf(&say_at_end, "Data archived OK. ");
     333                   _("Data archived. Please check the logs, just as a precaution. "));
     334        } else {
     335            asprintf(&say_at_end, _("Data archived OK. "));
    332336        }
    333337    }
     
    337341        res = verify_data(bkpinfo);
    338342        if (res < 0) {
    339             asprintf(&say_at_end, "%d difference%c found.", -res,
     343            asprintf(&say_at_end, _("%d difference%c found."), -res,
    340344                    (-res != 1) ? 's' : ' ');
    341345            res = 0;
     
    353357    if (retval == 0) {
    354358        mvaddstr_and_log_it(g_currentY++, 0,
    355                             "Backup and/or verify ran to completion. Everything appears to be fine.");
     359                            _("Backup and/or verify ran to completion. Everything appears to be fine."));
    356360    } else {
    357361        mvaddstr_and_log_it(g_currentY++, 0,
    358                             "Backup and/or verify ran to completion. However, errors did occur.");
     362                            _("Backup and/or verify ran to completion. However, errors did occur."));
    359363    }
    360364
    361365    if (does_file_exist("/root/images/mindi/mondorescue.iso")) {
    362366        log_to_screen
    363             ("/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it.");
     367            (_("/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it."));
    364368    }
    365369
     
    368372        if (g_text_mode) {
    369373            log_to_screen
    370                 ("Type 'less /tmp/changed.files' to see which files don't match the archives");
     374                (_("Type 'less /tmp/changed.files' to see which files don't match the archives"));
    371375        } else {
    372376            log_msg(1,
    373                     "Type 'less /tmp/changed.files' to see which files don't match the archives");
     377                    _("Type 'less /tmp/changed.files' to see which files don't match the archives"));
    374378            log_msg(2, "Calling popup_changelist_from_file()");
    375379            popup_changelist_from_file("/tmp/changed.files");
     
    395399    system("rm -Rf /tmp.mondo.* /mondo.scratch.*");
    396400    if (retval == 0) {
    397         printf("Mondoarchive ran OK.\n");
     401        printf(_("Mondoarchive ran OK.\n"));
    398402    } else {
    399         printf("Errors occurred during backup. Please check logfile.\n");
     403        printf(_("Errors occurred during backup. Please check logfile.\n"));
    400404    }
    401405    distro_specific_kludges_at_end_of_mondoarchive();
     
    414418    if (!g_text_mode) {
    415419        popup_and_OK
    416             ("Mondo Archive has finished its run. Please press ENTER to return to the shell prompt.");
    417         log_to_screen("See %s for details of backup run.", MONDO_LOGFILE);
     420            (_("Mondo Archive has finished its run. Please press ENTER to return to the shell prompt."));
     421        log_to_screen(_("See %s for details of backup run."), MONDO_LOGFILE);
    418422        finish(retval);
    419423    } else {
    420         printf("See %s for details of backup run.\n", MONDO_LOGFILE);
     424        printf(_("See %s for details of backup run.\n"), MONDO_LOGFILE);
    421425        exit(retval);
    422426    }
  • trunk/mondo/mondo/mondoarchive/mondo-cli.c

    r489 r507  
    236236    if (i == 0) {
    237237        retval++;
    238         log_to_screen("You must specify the media type\n");
     238        log_to_screen(_("You must specify the media type\n"));
    239239    }
    240240    if (i > 1) {
    241241        retval++;
    242         log_to_screen("Please specify only one media type\n");
     242        log_to_screen(_("Please specify only one media type\n"));
    243243    }
    244244    if (flag_set['K']) {
     
    250250    if (flag_set['L'] && flag_set['0']) {
    251251        retval++;
    252         log_to_screen("You cannot have 'no compression' _and_ LZOP.\n");
     252        log_to_screen(_("You cannot have 'no compression' _and_ LZOP.\n"));
    253253    }
    254254    bkpinfo->backup_data = flag_set['O'];
    255255    bkpinfo->verify_data = flag_set['V'];
    256256    if (flag_set['I'] && !bkpinfo->backup_data) {
    257         log_to_screen("-I switch is ignored if just verifying");
     257        log_to_screen(_("-I switch is ignored if just verifying"));
    258258    }
    259259    if (flag_set['E'] && !bkpinfo->backup_data) {
    260         log_to_screen("-E switch is ignored if just verifying");
     260        log_to_screen(_("-E switch is ignored if just verifying"));
    261261    }
    262262
     
    286286        if (flag_set['f'] || flag_set['l']) {
    287287            log_to_screen
    288                 ("You don't need to specify bootloader or bootdevice");
     288                (_("You don't need to specify bootloader or bootdevice"));
    289289        }
    290290    }
     
    331331        if (bkpinfo->include_paths[0] == '-') {
    332332            retval++;
    333             log_to_screen("Please supply a sensible value with '-I'\n");
     333            log_to_screen(_("Please supply a sensible value with '-I'\n"));
    334334        }
    335335    }
     
    346346            retval++;
    347347            log_to_screen
    348                 ("Please do not use -J in combination with -I. If you want to make a list of files to backup, that's fine, use -J <filename> but please don't muddy the waters by combining -J with -I. Thanks. :-)");
     348                (_("Please do not use -J in combination with -I. If you want to make a list of files to backup, that's fine, use -J <filename> but please don't combine -J with -I. Thanks. :-)"));
    349349        }
    350350        bkpinfo->make_filelist = FALSE;
     
    364364        if (g_kernel_version >= 2.6 && !strstr(flag_val['d'], "/dev/")) {
    365365            log_to_screen
    366                 ("Linus says 2.6 has a broken ide-scsi module. Proceed at your own risk...");
     366                (_("Linus says 2.6 has a broken ide-scsi module. Proceed at your own risk..."));
    367367        }
    368368
     
    380380            if (!flag_set['L']) {
    381381                log_to_screen
    382                     ("You must use -L with -C. Therefore I am setting it for you.");
     382                    (_("You must use -L with -C. Therefore I am setting it for you."));
    383383                flag_set['L'] = 1;
    384384                flag_val['L'] = NULL;
     
    411411
    412412        asprintf(&tmp,
    413                 "You didn't specify a tape streamer device. I'm assuming %s",
     413                _("You didn't specify a tape streamer device. I'm assuming %s"),
    414414                flag_val['d']);
    415415        log_to_screen(tmp);
     
    427427            if ((flag_val['d'] = find_dvd_device()) != NULL) {
    428428                flag_set['d'] = TRUE;
    429                 log_to_screen("I guess DVD drive is at %s", flag_val['d']);
     429                log_to_screen(_("I guess DVD drive is at %s"), flag_val['d']);
    430430            }
    431431        }
     
    445445            asprintf(&flag_val['s'], "%dm", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB
    446446            log_to_screen
    447                 ("You did not specify a size (-s) for DVD. I'm guessing %s.",
     447                (_("You did not specify a size (-s) for DVD. I'm guessing %s."),
    448448                 flag_val['s']);
    449449            flag_set['s'] = 1;
     
    499499        if (strlen(bkpinfo->isodir) < 3) {
    500500            retval++;
    501             log_to_screen("NFS share is not mounted. Please mount it.\n");
     501            log_to_screen(_("NFS share is not mounted. Please mount it.\n"));
    502502        }
    503503        log_msg(3, "mount = %s", bkpinfo->nfs_mount);
     
    627627                retval++;
    628628                asprintf(&tmp,
    629                     "You specified kernel '%s', which does not exist\n",
     629                    _("You specified kernel '%s', which does not exist\n"),
    630630                    bkpinfo->kernel_path);
    631631                log_to_screen(tmp);
     
    669669            paranoid_free(tmp);
    670670            asprintf(&tmp,
    671                     "Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n",
     671                    _("Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n"),
    672672                    bkpinfo->nfs_remote_dir, bkpinfo->nfs_mount);
    673673            log_to_screen(tmp);
     
    680680        if (g_kernel_version >= 2.6) {
    681681            if (popup_and_get_string
    682                 ("Device", "Please specify the device",
     682                (_("Device"), _("Please specify the device"),
    683683                 bkpinfo->media_device, MAX_STR_LEN / 4)) {
    684684                retval++;
    685                 log_to_screen("User opted to cancel.");
     685                log_to_screen(_("User opted to cancel."));
    686686            }
    687687        } else if ((tmp = find_cdrw_device()) ==  NULL) {
     
    690690            retval++;
    691691            log_to_screen
    692                 ("Tried and failed to find CD-R[W] drive automatically.\n");
     692                (_("Tried and failed to find CD-R[W] drive automatically.\n"));
    693693        } else {
    694694            flag_set['d'] = TRUE;
     
    699699    if (!flag_set['d'] && !flag_set['n'] && !flag_set['C']) {
    700700        retval++;
    701         log_to_screen("Please specify the backup device/directory.\n");
     701        log_to_screen(_("Please specify the backup device/directory.\n"));
    702702        fatal_error
    703703            ("You didn't use -d to specify the backup device/directory.");
     
    722722            retval++;
    723723            log_to_screen
    724                 ("Please specify a tempdir which I can write to. :)");
     724                (_("Please specify a tempdir which I can write to. :)"));
    725725            fatal_error("I cannot write to the tempdir you specified.");
    726726        }
     
    732732            retval++;
    733733            log_to_screen
    734                 ("Please don't specify a SAMBA or VFAT or NFS tmpdir.");
     734                (_("Please don't specify a SAMBA or VFAT or NFS tmpdir."));
    735735            fatal_error("I cannot write to the tempdir you specified.");
    736736        }
     
    782782        i = which_boot_loader(tmp);
    783783        log_msg(3, "boot loader is %c, residing at %s", i, tmp);
    784         printf("boot loader is %c, residing at %s\n", i, tmp);
     784        printf(_("boot loader is %c, residing at %s\n"), i, tmp);
    785785        finish(0);
    786786    }
     
    796796            retval++;
    797797            log_to_screen
    798                 ("Please install LZOP. You can't use '-L' until you do.\n");
     798                (_("Please install LZOP. You can't use '-L' until you do.\n"));
    799799        }
    800800    }
     
    806806        bkpinfo->make_cd_use_lilo = TRUE;
    807807        log_to_screen
    808             ("Forcing you to use LILO. SuSE 9.0 (64-bit) has a broken mkfs.vfat binary.");
     808            (_("Forcing you to use LILO. SuSE 9.0 (64-bit) has a broken mkfs.vfat binary."));
    809809    }
    810810    if (flag_set['o']) {
     
    816816            bkpinfo->make_cd_use_lilo = TRUE;
    817817            log_to_screen
    818                 ("Your kernel appears not to support vfat filesystems. I am therefore");
    819             log_to_screen
    820                 ("using LILO instead of SYSLINUX as the CD/floppy's boot loader.");
     818                (_("Your kernel appears not to support vfat filesystems. I am therefore"));
     819            log_to_screen
     820                (_("using LILO instead of SYSLINUX as the CD/floppy's boot loader."));
    821821        }
    822822        if (run_program_and_log_output("which mkfs.vfat", FALSE)) {
     
    824824#ifdef __IA32__
    825825            log_to_screen
    826                 ("Your filesystem is missing 'mkfs.vfat', so I cannot use SYSLINUX as");
    827             log_to_screen
    828                 ("your boot loader. I shall therefore use LILO instead.");
     826                (_("Your filesystem is missing 'mkfs.vfat', so I cannot use SYSLINUX as"));
     827            log_to_screen
     828                (_("your boot loader. I shall therefore use LILO instead."));
    829829#endif
    830830#ifdef __IA64__
    831831            log_to_screen
    832                 ("Your filesystem is missing 'mkfs.vfat', so I cannot prepare the EFI");
    833             log_to_screen("environment correctly. Please install it.");
     832                (_("Your filesystem is missing 'mkfs.vfat', so I cannot prepare the EFI"));
     833            log_to_screen(_("environment correctly. Please install it."));
    834834            fatal_error("Aborting");
    835835#endif
     
    849849    if (i == 0) {
    850850        retval++;
    851         log_to_screen("Specify backup (-O), verify (-V) or both (-OV).\n");
     851        log_to_screen(_("Specify backup (-O), verify (-V) or both (-OV).\n"));
    852852    }
    853853
     
    901901            if (flag_set[optopt]) {
    902902                bad_switches = TRUE;
    903                 asprintf(&tmp, "Switch -%c previously defined as %s\n", opt,
     903                asprintf(&tmp, _("Switch -%c previously defined as %s\n"), opt,
    904904                        flag_val[i]);
    905905                log_to_screen(tmp);
     
    912912                        optarg[--len] = '\0';
    913913                        log_to_screen
    914                             ("Warning - param '%s' should not have trailing slash!",
     914                            (_("Warning - param '%s' should not have trailing slash!"),
    915915                             optarg);
    916916                    }
     
    919919                            && flag_val[opt][0] != '/') {
    920920                            asprintf(&tmp,
    921                                     "-%c flag --- must be absolute path --- '%s' isn't absolute",
     921                                    _("-%c flag --- must be absolute path --- '%s' isn't absolute"),
    922922                                    opt, flag_val[opt]);
    923923                            log_to_screen(tmp);
     
    933933    for (i = optind; i < argc; i++) {
    934934        bad_switches = TRUE;
    935         asprintf(&tmp, "Invalid arg -- %s\n", argv[i]);
     935        asprintf(&tmp, _("Invalid arg -- %s\n"), argv[i]);
    936936        log_to_screen(tmp);
    937937        paranoid_free(tmp);
     
    964964    switch (sig) {
    965965    case SIGINT:
    966         asprintf(&tmp, "SIGINT signal received from OS");
    967         asprintf(&tmp2, "You interrupted me :-)");
     966        asprintf(&tmp, _("SIGINT signal received from OS"));
     967        asprintf(&tmp2, _("You interrupted me :-)"));
    968968        break;
    969969    case SIGKILL:
    970         asprintf(&tmp, "SIGKILL signal received from OS");
     970        asprintf(&tmp, _("SIGKILL signal received from OS"));
    971971        asprintf(&tmp2,
    972                "I seriously have no clue how this signal even got to me. Something's wrong with your system.");
     972               _("I seriously have no clue how this signal even got to me. Something's wrong with your system."));
    973973        break;
    974974    case SIGTERM:
    975         asprintf(&tmp, "SIGTERM signal received from OS");
    976         asprintf(&tmp2, "Got terminate signal");
     975        asprintf(&tmp, _("SIGTERM signal received from OS"));
     976        asprintf(&tmp2, _("Got terminate signal"));
    977977        break;
    978978    case SIGHUP:
    979         asprintf(&tmp, "SIGHUP signal received from OS");
    980         asprintf(&tmp2, "Hangup on line");
     979        asprintf(&tmp, _("SIGHUP signal received from OS"));
     980        asprintf(&tmp2, _("Hangup on line"));
    981981        break;
    982982    case SIGSEGV:
    983         asprintf(&tmp, "SIGSEGV signal received from OS");
     983        asprintf(&tmp, _("SIGSEGV signal received from OS"));
    984984        asprintf(&tmp2,
    985                "Internal programming error. Please send a backtrace as well as your log.");
     985               _("Internal programming error. Please send a backtrace as well as your log."));
    986986        break;
    987987    case SIGPIPE:
    988         asprintf(&tmp, "SIGPIPE signal received from OS");
    989         asprintf(&tmp2, "Pipe was broken");
     988        asprintf(&tmp, _("SIGPIPE signal received from OS"));
     989        asprintf(&tmp2, _("Pipe was broken"));
    990990        break;
    991991    case SIGABRT:
    992         asprintf(&tmp, "SIGABRT signal received from OS");
     992        asprintf(&tmp, _("SIGABRT signal received from OS"));
    993993        asprintf(&tmp2,
    994                 "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message.");
     994                _("Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message."));
    995995        break;
    996996    default:
    997         asprintf(&tmp, "(Unknown)");
    998         asprintf(&tmp2, "(Unknown)");
     997        asprintf(&tmp, _("(Unknown)"));
     998        asprintf(&tmp2, _("(Unknown)"));
    999999    }
    10001000
Note: See TracChangeset for help on using the changeset viewer.