Changeset 507 in MondoRescue for trunk/mondo/mondo/common/libmondo-devices.c


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

merge -r489:506 $SVN_M/branches/stable

File:
1 edited

Legend:

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

    r309 r507  
    1111#include "libmondo-files-EXT.h"
    1212#include "libmondo-devices.h"
    13 #include "lib-common-externs.h"
    1413#include "libmondo-string-EXT.h"
    1514#include "libmondo-tools-EXT.h"
    16 #include "libmondo-gui-EXT.h"
     15#include "newt-specific-EXT.h"
    1716#include "libmondo-fork-EXT.h"
    1817#include "libmondo-stream-EXT.h"
     
    139138            && !does_file_exist("/tmp/mountlist.txt.sample")) {
    140139            log_to_screen
    141                 ("Using /dev/root is stupid of you but I'll forgive you.");
     140                (_("Using /dev/root is stupid of you but I'll forgive you."));
    142141            is_this_a_ramdisk = FALSE;
    143142        }
     
    165164    switch (bt) {
    166165    case none:
    167         asprintf(&output, "none");
     166        asprintf(&output, _("none"));
    168167        break;
    169168    case iso:
    170         asprintf(&output, "iso");
     169        asprintf(&output, _("iso"));
    171170        break;
    172171    case cdr:
    173         asprintf(&output, "cdr");
     172        asprintf(&output, _("cdr"));
    174173        break;
    175174    case cdrw:
    176         asprintf(&output, "cdrw");
     175        asprintf(&output, _("cdrw"));
    177176        break;
    178177    case cdstream:
    179         asprintf(&output, "cdstream");
     178        asprintf(&output, _("cdstream"));
    180179        break;
    181180    case nfs:
    182         asprintf(&output, "nfs");
     181        asprintf(&output, _("nfs"));
    183182        break;
    184183    case tape:
    185         asprintf(&output, "tape");
     184        asprintf(&output, _("tape"));
    186185        break;
    187186    case udev:
    188         asprintf(&output, "udev");
     187        asprintf(&output, _("udev"));
    189188        break;
    190189    default:
    191         asprintf(&output, "default");
     190        asprintf(&output, _("default"));
    192191    }
    193192    return (output);
     
    470469    if ((dev == NULL) || (! mount_CDROM_here(dev, mountpoint))) {
    471470        if (!popup_and_get_string
    472             ("CD-ROM device", "Please enter your CD-ROM's /dev device",
     471            (_("CD-ROM device"), _("Please enter your CD-ROM's /dev device"),
    473472             dev, MAX_STR_LEN / 4)) {
    474473            res = FALSE;
     
    478477    }
    479478    if (res) {
    480         log_msg(1, "mount failed");
    481     } else {
    482         log_msg(1, "mount succeeded with %s", dev);
     479        log_msg(1, _("mount failed"));
     480    } else {
     481        log_msg(1, _("mount succeeded with %s"), dev);
    483482    }
    484483    paranoid_free(dev);
     
    13701369            }
    13711370            if (res) {
    1372                 log_to_screen("WARNING - failed to unmount CD-ROM drive");
     1371                log_to_screen(_("WARNING - failed to unmount CD-ROM drive"));
    13731372            }
    13741373            if (!bkpinfo->please_dont_eject) {
     
    13781377            }
    13791378            if (res) {
    1380                 log_to_screen("WARNING - failed to eject CD-ROM disk");
     1379                log_to_screen(_("WARNING - failed to eject CD-ROM disk"));
    13811380            }
    13821381            popup_and_OK(request);
     
    14281427        which_backup_media_type(bkpinfo->restore_data);
    14291428    if (bkpinfo->backup_media_type == none) {
    1430         log_to_screen("User has chosen not to backup the PC");
     1429        log_to_screen(_("User has chosen not to backup the PC"));
    14311430        finish(1);
    14321431    }
    14331432    if (bkpinfo->backup_media_type == tape && bkpinfo->restore_data) {
    1434         popup_and_OK("Please remove CD/floppy from drive(s)");
     1433        popup_and_OK(_("Please remove CD/floppy from drive(s)"));
    14351434    }
    14361435    log_msg(3, "media type = %s",
     
    14671466        if (archiving_to_media) {
    14681467            if (ask_me_yes_or_no
    1469                 ("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?"))
     1468                (_("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?")))
    14701469            {
    14711470                bkpinfo->manual_cd_tray = TRUE;
     
    14731472            if ((bkpinfo->compression_level =
    14741473                 which_compression_level()) == -1) {
    1475                 log_to_screen("User has chosen not to backup the PC");
     1474                log_to_screen(_("User has chosen not to backup the PC"));
    14761475                finish(1);
    14771476            }
    1478             asprintf(&comment, "What speed is your %s (re)writer?",
     1477            asprintf(&comment, _("What speed is your %s (re)writer?"),
    14791478                    media_descriptor_string(bkpinfo->backup_media_type));
    14801479            if (bkpinfo->backup_media_type == dvd) {
     
    14911490            }
    14921491            if (bkpinfo->backup_media_type != dvd) {
    1493                 if (!popup_and_get_string("Speed", comment, tmp, 4)) {
    1494                     log_to_screen("User has chosen not to backup the PC");
     1492                if (!popup_and_get_string(_("Speed"), comment, tmp, 4)) {
     1493                    log_to_screen(_("User has chosen not to backup the PC"));
    14951494                    finish(1);
    14961495                }
     
    15021501
    15031502            asprintf(&comment,
    1504                     "How much data (in Megabytes) will each %s store?",
     1503                    _("How much data (in Megabytes) will each %s store?"),
    15051504                    media_descriptor_string(bkpinfo->backup_media_type));
    15061505
    15071506            if (!popup_and_get_string("Size", comment, sz_size, 5)) {
    1508                 log_to_screen("User has chosen not to backup the PC");
     1507                log_to_screen(_("User has chosen not to backup the PC"));
    15091508                finish(1);
    15101509            }
     
    15151514            }
    15161515            if (bkpinfo->media_size[0] <= 0) {
    1517                 log_to_screen("User has chosen not to backup the PC");
     1516                log_to_screen(_("User has chosen not to backup the PC"));
    15181517                finish(1);
    15191518            }
     
    15391538                        bkpinfo->media_device);
    15401539                asprintf(&comment,
    1541                         "Please specify your %s drive's /dev entry",
     1540                        _("Please specify your %s drive's /dev entry"),
    15421541                        media_descriptor_string(bkpinfo->
    15431542                                                backup_media_type));
    15441543                if (!popup_and_get_string
    1545                     ("Device?", comment, bkpinfo->media_device,
     1544                    (_("Device?"), comment, bkpinfo->media_device,
    15461545                     MAX_STR_LEN / 4)) {
    1547                     log_to_screen("User has chosen not to backup the PC");
     1546                    log_to_screen(_("User has chosen not to backup the PC"));
    15481547                    finish(1);
    15491548                }
     
    15581557            if (bkpinfo->media_device != NULL) {
    15591558                asprintf(&tmp,
    1560                         "I think I've found your %s burner at SCSI node %s; am I right on the money?",
     1559                        _("I think I've found your %s burner at SCSI node %s; am I right on the money?"),
    15611560                        media_descriptor_string(bkpinfo->
    15621561                                                backup_media_type),
     
    15681567            } else {
    15691568                if (g_kernel_version < 2.6) {
    1570                     i = popup_and_get_string("Device node?",
    1571                                              "What is the SCSI node of your CD (re)writer, please?",
     1569                    i = popup_and_get_string(_("Device node?"),
     1570                                             _("What is the SCSI node of your CD (re)writer, please?"),
    15721571                                             bkpinfo->media_device,
    15731572                                             MAX_STR_LEN / 4);
    15741573                } else {
    1575                     i = popup_and_get_string("/dev entry?",
    1576                                              "What is the /dev entry of your CD (re)writer, please?",
     1574                    i = popup_and_get_string(_("/dev entry?"),
     1575                                             _("What is the /dev entry of your CD (re)writer, please?"),
    15771576                                             bkpinfo->media_device,
    15781577                                             MAX_STR_LEN / 4);
    15791578                }
    15801579                if (!i) {
    1581                     log_to_screen("User has chosen not to backup the PC");
     1580                    log_to_screen(_("User has chosen not to backup the PC"));
    15821581                    finish(1);
    15831582                }
     
    15921591    case udev:
    15931592        if (!ask_me_yes_or_no
    1594             ("This option is for advanced users only. Are you sure?")) {
    1595             log_to_screen("User has chosen not to backup the PC");
     1593            (_("This option is for advanced users only. Are you sure?"))) {
     1594            log_to_screen(_("User has chosen not to backup the PC"));
    15961595            finish(1);
    15971596        }
     
    16001599        paranoid_free(bkpinfo->media_device);
    16011600        if (find_tape_device_and_size(bkpinfo->media_device, sz_size)) {
    1602             log_msg(3, "Ok, using vanilla scsi tape.");
     1601            log_msg(3, _("Ok, using vanilla scsi tape."));
    16031602            paranoid_alloc(bkpinfo->media_device,VANILLA_SCSI_TAPE );
    16041603            if ((fin = fopen(bkpinfo->media_device, "r"))) {
     
    16181617            }
    16191618            asprintf(&tmp,
    1620                     "I think I've found your tape streamer at %s; am I right on the money?",
     1619                    _("I think I've found your tape streamer at %s; am I right on the money?"),
    16211620                    bkpinfo->media_device);
    16221621            if (!ask_me_yes_or_no(tmp)) {
     
    16271626        if (bkpinfo->media_device == NULL) {
    16281627            if (!popup_and_get_string
    1629                 ("Device name?",
    1630                  "What is the /dev entry of your tape streamer?",
     1628                (_("Device name?"),
     1629                 _("What is the /dev entry of your tape streamer?"),
    16311630                 bkpinfo->media_device, MAX_STR_LEN / 4)) {
    1632                 log_to_screen("User has chosen not to backup the PC");
     1631                log_to_screen(_("User has chosen not to backup the PC"));
    16331632                finish(1);
    16341633            }
     
    16361635        asprintf(&tmp, "ls -l %s", bkpinfo->media_device);
    16371636        if (run_program_and_log_output(tmp, FALSE)) {
    1638             log_to_screen("User has not specified a valid /dev entry");
     1637            log_to_screen(_("User has not specified a valid /dev entry"));
    16391638            finish(1);
    16401639        }
     
    16531652            if ((bkpinfo->compression_level =
    16541653                 which_compression_level()) == -1) {
    1655                 log_to_screen("User has chosen not to backup the PC");
     1654                log_to_screen(_("User has chosen not to backup the PC"));
    16561655                finish(1);
    16571656            }
     
    16741673        {
    16751674            if (!popup_and_get_string
    1676                 ("NFS dir.",
    1677                  "Please enter path and directory where archives are stored remotely. (Mondo has taken a guess at the correct value. If it is incorrect, delete it and type the correct one.)",
     1675                (_("NFS dir."),
     1676                 _("Please enter path and directory where archives are stored remotely. (Mondo has taken a guess at the correct value. If it is incorrect, delete it and type the correct one.)"),
    16781677                 bkpinfo->nfs_mount, MAX_STR_LEN / 4)) {
    1679                 log_to_screen("User has chosen not to backup the PC");
     1678                log_to_screen(_("User has chosen not to backup the PC"));
    16801679                finish(1);
    16811680            }
     
    16831682                if ((bkpinfo->compression_level =
    16841683                     which_compression_level()) == -1) {
    1685                     log_to_screen("User has chosen not to backup the PC");
     1684                    log_to_screen(_("User has chosen not to backup the PC"));
    16861685                    finish(1);
    16871686                }
     
    16991698
    17001699            asprintf(&comment,
    1701                     "How much data (in Megabytes) will each media store?");
    1702             if (!popup_and_get_string("Size", comment, sz_size, 5)) {
    1703                 log_to_screen("User has chosen not to backup the PC");
     1700                    _("How much data (in Megabytes) will each media store?"));
     1701            if (!popup_and_get_string(_("Size"), comment, sz_size, 5)) {
     1702                log_to_screen(_("User has chosen not to backup the PC"));
    17041703                finish(1);
    17051704            }
     
    17081707            }
    17091708            if (bkpinfo->media_size[0] <= 0) {
    1710                 log_to_screen("User has chosen not to backup the PC");
     1709                log_to_screen(_("User has chosen not to backup the PC"));
    17111710                finish(1);
    17121711            }
     
    17161715            system("umount /tmp/isodir 2> /dev/null");
    17171716            if (!popup_and_get_string
    1718                 ("NFS share", "Which remote NFS share should I mount?",
     1717                (_("NFS share"), _("Which remote NFS share should I mount?"),
    17191718                 bkpinfo->nfs_mount, MAX_STR_LEN)) {
    1720                 log_to_screen("User has chosen not to backup the PC");
     1719                log_to_screen(_("User has chosen not to backup the PC"));
    17211720                finish(1);
    17221721            }
     
    17381737        if (!is_this_device_mounted(bkpinfo->nfs_mount)) {
    17391738            popup_and_OK
    1740                 ("Please mount that partition before you try to backup to or restore from it.");
     1739                (_("Please mount that partition before you try to backup to or restore from it."));
    17411740            finish(1);
    17421741        }
    17431742        asprintf(&tmp, bkpinfo->nfs_remote_dir);
    17441743        if (!popup_and_get_string
    1745             ("Directory", "Which directory within that mountpoint?", tmp,
     1744            (_("Directory"), _("Which directory within that mountpoint?"), tmp,
    17461745             MAX_STR_LEN)) {
    1747             log_to_screen("User has chosen not to backup the PC");
     1746            log_to_screen(_("User has chosen not to backup the PC"));
    17481747            finish(1);
    17491748        }
     
    17601759            asprintf(&tmp, bkpinfo->nfs_remote_dir);
    17611760            asprintf(&prompt,
    1762                      "Directory '%s' under mountpoint '%s' does not exist or is not writable. You can fix this or change the directory and retry or cancel the backup.",
     1761                     _("Directory '%s' under mountpoint '%s' does not exist or is not writable. You can fix this or change the directory and retry or cancel the backup."),
    17631762                     bkpinfo->nfs_remote_dir, bkpinfo->isodir);
    17641763            if (!popup_and_get_string
    1765                 ("Directory", prompt, tmp, MAX_STR_LEN)) {
    1766                 log_to_screen("User has chosen not to backup the PC");
     1764                (_("Directory"), prompt, tmp, MAX_STR_LEN)) {
     1765                log_to_screen(_("User has chosen not to backup the PC"));
    17671766                finish(1);
    17681767            }
     
    17781777
    17791778        if (!popup_and_get_string
    1780             ("Prefix.",
    1781              "Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files",
     1779            (_("Prefix."),
     1780             _("Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files"),
    17821781            bkpinfo->prefix, MAX_STR_LEN / 4)) {
    1783             log_to_screen("User has chosen not to backup the PC");
     1782            log_to_screen(_("User has chosen not to backup the PC"));
    17841783            finish(1);
    17851784        }
     
    17971796        if (!bkpinfo->disaster_recovery) {
    17981797            if (!popup_and_get_string
    1799                 ("Storage dir.",
    1800                  "Please enter the full path that contains your ISO images.  Example: /mnt/raid0_0",
     1798                (_("Storage dir."),
     1799                 _("Please enter the full path that contains your ISO images.  Example: /mnt/raid0_0"),
    18011800                 bkpinfo->isodir, MAX_STR_LEN / 4)) {
    1802                 log_to_screen("User has chosen not to backup the PC");
     1801                log_to_screen(_("User has chosen not to backup the PC"));
    18031802                finish(1);
    18041803            }
     
    18061805                if ((bkpinfo->compression_level =
    18071806                     which_compression_level()) == -1) {
    1808                     log_to_screen("User has chosen not to backup the PC");
     1807                    log_to_screen(_("User has chosen not to backup the PC"));
    18091808                    finish(1);
    18101809                }
    18111810                if (!popup_and_get_string
    1812                     ("ISO size.",
    1813                      "Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s or DVD's you plan to backup to.",
     1811                    (_("ISO size."),
     1812                     _("Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s or DVD's you plan to backup to."),
    18141813                     sz_size, 16)) {
    1815                     log_to_screen("User has chosen not to backup the PC");
     1814                    log_to_screen(_("User has chosen not to backup the PC"));
    18161815                    finish(1);
    18171816                }
     
    18221821
    18231822                if (!popup_and_get_string
    1824                     ("Prefix.",
    1825                      "Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files",
     1823                    (_("Prefix."),
     1824                     _("Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files"),
    18261825                     bkpinfo->prefix, MAX_STR_LEN / 4)) {
    18271826                    log_to_screen("User has chosen not to backup the PC");
     
    18571856#ifdef __FreeBSD__
    18581857            if (!popup_and_get_string
    1859                 ("Boot device",
    1860                  "What is your boot device? (e.g. /dev/ad0)",
     1858                (_("Boot device"),
     1859                 _("What is your boot device? (e.g. /dev/ad0)"),
    18611860                 bkpinfo->boot_device, MAX_STR_LEN / 4)) {
    1862                 log_to_screen("User has chosen not to backup the PC");
     1861                log_to_screen(_("User has chosen not to backup the PC"));
    18631862                finish(1);
    18641863            }
     
    18661865#else
    18671866            if (!popup_and_get_string
    1868                 ("Boot device",
    1869                  "What is your boot device? (e.g. /dev/hda)",
     1867                (_("Boot device"),
     1868                 _("What is your boot device? (e.g. /dev/hda)"),
    18701869                 bkpinfo->boot_device, MAX_STR_LEN / 4)) {
    1871                 log_to_screen("User has chosen not to backup the PC");
     1870                log_to_screen(_("User has chosen not to backup the PC"));
    18721871                finish(1);
    18731872            }
     
    18891888            if (i == 'U') {
    18901889                if (ask_me_yes_or_no
    1891                     ("Unidentified boot loader. Shall I restore it byte-for-byte at restore time and hope for the best?"))
     1890                    (_("Unidentified boot loader. Shall I restore it byte-for-byte at restore time and hope for the best?")))
    18921891                {
    18931892                    i = 'R';    // raw
    18941893                } else {
    18951894                    log_to_screen
    1896                         ("I cannot find your boot loader. Please run mondoarchive with parameters.");
     1895                        (_("I cannot find your boot loader. Please run mondoarchive with parameters."));
    18971896                    finish(1);
    18981897                }
     
    19021901        strcpy(bkpinfo->include_paths, "/");
    19031902        if (!popup_and_get_string
    1904             ("Backup paths",
    1905              "Please enter paths which you want me to backup. The default is '/' (i.e. everything).",
     1903            (_("Backup paths"),
     1904             _("Please enter paths which you want me to backup. The default is '/' (i.e. everything)."),
    19061905             bkpinfo->include_paths, MAX_STR_LEN)) {
    1907             log_to_screen("User has chosen not to backup the PC");
     1906            log_to_screen(_("User has chosen not to backup the PC"));
    19081907            finish(1);
    19091908        }
     
    19221921        if (strlen(tmp) > 2) {
    19231922            if (!popup_and_get_string
    1924                 ("NTFS partitions",
    1925                  "Please enter/confirm the NTFS partitions you wish to backup as well.",
     1923                (_("NTFS partitions"),
     1924                 _("Please enter/confirm the NTFS partitions you wish to backup as well."),
    19261925                 tmp, MAX_STR_LEN / 4)) {
    1927                 log_to_screen("User has chosen not to backup the PC");
     1926                log_to_screen(_("User has chosen not to backup the PC"));
    19281927                finish(1);
    19291928            }
     
    19331932
    19341933        if (!popup_and_get_string
    1935             ("Exclude paths",
    1936              "Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.",
     1934            (_("Exclude paths"),
     1935             _("Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup."),
    19371936             bkpinfo->exclude_paths, MAX_STR_LEN)) {
    1938             log_to_screen("User has chosen not to backup the PC");
     1937            log_to_screen(_("User has chosen not to backup the PC"));
    19391938            finish(1);
    19401939        }
     
    19431942        bkpinfo->verify_data =
    19441943            ask_me_yes_or_no
    1945             ("Will you want to verify your backups after Mondo has created them?");
     1944            (_("Will you want to verify your backups after Mondo has created them?"));
    19461945
    19471946#ifndef __FreeBSD__
    19481947        if (!ask_me_yes_or_no
    1949             ("Are you confident that your kernel is a sane, sensible, standard Linux kernel? Say 'no' if you are using a Gentoo <1.4 or Debian <3.0, please.")) {
     1948            (_("Are you confident that your kernel is a sane, sensible, standard Linux kernel? Say 'no' if you are using a Gentoo <1.4 or Debian <3.0, please."))){
    19501949            paranoid_alloc(bkpinfo->kernel_path, "FAILSAFE");
    19511950        }
     
    19531952
    19541953        if (!ask_me_yes_or_no
    1955             ("Are you sure you want to proceed? Hit 'no' to abort.")) {
    1956             log_to_screen("User has chosen not to backup the PC");
     1954            (_("Are you sure you want to proceed? Hit 'no' to abort."))) {
     1955            log_to_screen(_("User has chosen not to backup the PC"));
    19571956            finish(1);
    19581957        }
Note: See TracChangeset for help on using the changeset viewer.