Changeset 507 in MondoRescue for trunk/mondo/mondo/common/libmondo-devices.c
- Timestamp:
- Apr 30, 2006, 2:04:16 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-devices.c
r309 r507 11 11 #include "libmondo-files-EXT.h" 12 12 #include "libmondo-devices.h" 13 #include "lib-common-externs.h"14 13 #include "libmondo-string-EXT.h" 15 14 #include "libmondo-tools-EXT.h" 16 #include " libmondo-gui-EXT.h"15 #include "newt-specific-EXT.h" 17 16 #include "libmondo-fork-EXT.h" 18 17 #include "libmondo-stream-EXT.h" … … 139 138 && !does_file_exist("/tmp/mountlist.txt.sample")) { 140 139 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.")); 142 141 is_this_a_ramdisk = FALSE; 143 142 } … … 165 164 switch (bt) { 166 165 case none: 167 asprintf(&output, "none");166 asprintf(&output, _("none")); 168 167 break; 169 168 case iso: 170 asprintf(&output, "iso");169 asprintf(&output, _("iso")); 171 170 break; 172 171 case cdr: 173 asprintf(&output, "cdr");172 asprintf(&output, _("cdr")); 174 173 break; 175 174 case cdrw: 176 asprintf(&output, "cdrw");175 asprintf(&output, _("cdrw")); 177 176 break; 178 177 case cdstream: 179 asprintf(&output, "cdstream");178 asprintf(&output, _("cdstream")); 180 179 break; 181 180 case nfs: 182 asprintf(&output, "nfs");181 asprintf(&output, _("nfs")); 183 182 break; 184 183 case tape: 185 asprintf(&output, "tape");184 asprintf(&output, _("tape")); 186 185 break; 187 186 case udev: 188 asprintf(&output, "udev");187 asprintf(&output, _("udev")); 189 188 break; 190 189 default: 191 asprintf(&output, "default");190 asprintf(&output, _("default")); 192 191 } 193 192 return (output); … … 470 469 if ((dev == NULL) || (! mount_CDROM_here(dev, mountpoint))) { 471 470 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"), 473 472 dev, MAX_STR_LEN / 4)) { 474 473 res = FALSE; … … 478 477 } 479 478 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); 483 482 } 484 483 paranoid_free(dev); … … 1370 1369 } 1371 1370 if (res) { 1372 log_to_screen( "WARNING - failed to unmount CD-ROM drive");1371 log_to_screen(_("WARNING - failed to unmount CD-ROM drive")); 1373 1372 } 1374 1373 if (!bkpinfo->please_dont_eject) { … … 1378 1377 } 1379 1378 if (res) { 1380 log_to_screen( "WARNING - failed to eject CD-ROM disk");1379 log_to_screen(_("WARNING - failed to eject CD-ROM disk")); 1381 1380 } 1382 1381 popup_and_OK(request); … … 1428 1427 which_backup_media_type(bkpinfo->restore_data); 1429 1428 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")); 1431 1430 finish(1); 1432 1431 } 1433 1432 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)")); 1435 1434 } 1436 1435 log_msg(3, "media type = %s", … … 1467 1466 if (archiving_to_media) { 1468 1467 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?"))) 1470 1469 { 1471 1470 bkpinfo->manual_cd_tray = TRUE; … … 1473 1472 if ((bkpinfo->compression_level = 1474 1473 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")); 1476 1475 finish(1); 1477 1476 } 1478 asprintf(&comment, "What speed is your %s (re)writer?",1477 asprintf(&comment, _("What speed is your %s (re)writer?"), 1479 1478 media_descriptor_string(bkpinfo->backup_media_type)); 1480 1479 if (bkpinfo->backup_media_type == dvd) { … … 1491 1490 } 1492 1491 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")); 1495 1494 finish(1); 1496 1495 } … … 1502 1501 1503 1502 asprintf(&comment, 1504 "How much data (in Megabytes) will each %s store?",1503 _("How much data (in Megabytes) will each %s store?"), 1505 1504 media_descriptor_string(bkpinfo->backup_media_type)); 1506 1505 1507 1506 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")); 1509 1508 finish(1); 1510 1509 } … … 1515 1514 } 1516 1515 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")); 1518 1517 finish(1); 1519 1518 } … … 1539 1538 bkpinfo->media_device); 1540 1539 asprintf(&comment, 1541 "Please specify your %s drive's /dev entry",1540 _("Please specify your %s drive's /dev entry"), 1542 1541 media_descriptor_string(bkpinfo-> 1543 1542 backup_media_type)); 1544 1543 if (!popup_and_get_string 1545 ( "Device?", comment, bkpinfo->media_device,1544 (_("Device?"), comment, bkpinfo->media_device, 1546 1545 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")); 1548 1547 finish(1); 1549 1548 } … … 1558 1557 if (bkpinfo->media_device != NULL) { 1559 1558 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?"), 1561 1560 media_descriptor_string(bkpinfo-> 1562 1561 backup_media_type), … … 1568 1567 } else { 1569 1568 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?"), 1572 1571 bkpinfo->media_device, 1573 1572 MAX_STR_LEN / 4); 1574 1573 } 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?"), 1577 1576 bkpinfo->media_device, 1578 1577 MAX_STR_LEN / 4); 1579 1578 } 1580 1579 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")); 1582 1581 finish(1); 1583 1582 } … … 1592 1591 case udev: 1593 1592 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")); 1596 1595 finish(1); 1597 1596 } … … 1600 1599 paranoid_free(bkpinfo->media_device); 1601 1600 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.")); 1603 1602 paranoid_alloc(bkpinfo->media_device,VANILLA_SCSI_TAPE ); 1604 1603 if ((fin = fopen(bkpinfo->media_device, "r"))) { … … 1618 1617 } 1619 1618 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?"), 1621 1620 bkpinfo->media_device); 1622 1621 if (!ask_me_yes_or_no(tmp)) { … … 1627 1626 if (bkpinfo->media_device == NULL) { 1628 1627 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?"), 1631 1630 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")); 1633 1632 finish(1); 1634 1633 } … … 1636 1635 asprintf(&tmp, "ls -l %s", bkpinfo->media_device); 1637 1636 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")); 1639 1638 finish(1); 1640 1639 } … … 1653 1652 if ((bkpinfo->compression_level = 1654 1653 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")); 1656 1655 finish(1); 1657 1656 } … … 1674 1673 { 1675 1674 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.)"), 1678 1677 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")); 1680 1679 finish(1); 1681 1680 } … … 1683 1682 if ((bkpinfo->compression_level = 1684 1683 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")); 1686 1685 finish(1); 1687 1686 } … … 1699 1698 1700 1699 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")); 1704 1703 finish(1); 1705 1704 } … … 1708 1707 } 1709 1708 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")); 1711 1710 finish(1); 1712 1711 } … … 1716 1715 system("umount /tmp/isodir 2> /dev/null"); 1717 1716 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?"), 1719 1718 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")); 1721 1720 finish(1); 1722 1721 } … … 1738 1737 if (!is_this_device_mounted(bkpinfo->nfs_mount)) { 1739 1738 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.")); 1741 1740 finish(1); 1742 1741 } 1743 1742 asprintf(&tmp, bkpinfo->nfs_remote_dir); 1744 1743 if (!popup_and_get_string 1745 ( "Directory", "Which directory within that mountpoint?", tmp,1744 (_("Directory"), _("Which directory within that mountpoint?"), tmp, 1746 1745 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")); 1748 1747 finish(1); 1749 1748 } … … 1760 1759 asprintf(&tmp, bkpinfo->nfs_remote_dir); 1761 1760 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."), 1763 1762 bkpinfo->nfs_remote_dir, bkpinfo->isodir); 1764 1763 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")); 1767 1766 finish(1); 1768 1767 } … … 1778 1777 1779 1778 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"), 1782 1781 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")); 1784 1783 finish(1); 1785 1784 } … … 1797 1796 if (!bkpinfo->disaster_recovery) { 1798 1797 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"), 1801 1800 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")); 1803 1802 finish(1); 1804 1803 } … … 1806 1805 if ((bkpinfo->compression_level = 1807 1806 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")); 1809 1808 finish(1); 1810 1809 } 1811 1810 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."), 1814 1813 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")); 1816 1815 finish(1); 1817 1816 } … … 1822 1821 1823 1822 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"), 1826 1825 bkpinfo->prefix, MAX_STR_LEN / 4)) { 1827 1826 log_to_screen("User has chosen not to backup the PC"); … … 1857 1856 #ifdef __FreeBSD__ 1858 1857 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)"), 1861 1860 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")); 1863 1862 finish(1); 1864 1863 } … … 1866 1865 #else 1867 1866 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)"), 1870 1869 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")); 1872 1871 finish(1); 1873 1872 } … … 1889 1888 if (i == 'U') { 1890 1889 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?"))) 1892 1891 { 1893 1892 i = 'R'; // raw 1894 1893 } else { 1895 1894 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.")); 1897 1896 finish(1); 1898 1897 } … … 1902 1901 strcpy(bkpinfo->include_paths, "/"); 1903 1902 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)."), 1906 1905 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")); 1908 1907 finish(1); 1909 1908 } … … 1922 1921 if (strlen(tmp) > 2) { 1923 1922 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."), 1926 1925 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")); 1928 1927 finish(1); 1929 1928 } … … 1933 1932 1934 1933 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."), 1937 1936 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")); 1939 1938 finish(1); 1940 1939 } … … 1943 1942 bkpinfo->verify_data = 1944 1943 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?")); 1946 1945 1947 1946 #ifndef __FreeBSD__ 1948 1947 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."))){ 1950 1949 paranoid_alloc(bkpinfo->kernel_path, "FAILSAFE"); 1951 1950 } … … 1953 1952 1954 1953 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")); 1957 1956 finish(1); 1958 1957 }
Note:
See TracChangeset
for help on using the changeset viewer.