Changeset 541 in MondoRescue for branches/stable/mondo/mondo/mondoarchive/mondo-cli.c
- Timestamp:
- May 13, 2006, 8:47:23 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/mondo/mondoarchive/mondo-cli.c
r538 r541 247 247 flag_set[i] = FALSE; 248 248 } 249 // strcpy (bkpinfo->tmpdir, "/root/images/mondo"); 250 // strcpy (bkpinfo->scratchdir, "/home"); 249 251 for (j = 1; j <= MAX_NOOF_MEDIA; j++) { 250 252 bkpinfo->media_size[j] = 650; … … 354 356 /*@ buffers ** */ 355 357 char *tmp; 356 char *tmp1;357 358 char *psz; 358 359 … … 376 377 if (i == 0) { 377 378 retval++; 378 log_to_screen( _("You must specify the media type\n"));379 log_to_screen("You must specify the media type\n"); 379 380 } 380 381 if (i > 1) { 381 382 retval++; 382 log_to_screen( _("Please specify only one media type\n"));383 log_to_screen("Please specify only one media type\n"); 383 384 } 384 385 if (flag_set['K']) { … … 390 391 if (flag_set['L'] && flag_set['0']) { 391 392 retval++; 392 log_to_screen( _("You cannot have 'no compression' _and_ LZOP.\n"));393 log_to_screen("You cannot have 'no compression' _and_ LZOP.\n"); 393 394 } 394 395 bkpinfo->backup_data = flag_set['O']; 395 396 bkpinfo->verify_data = flag_set['V']; 396 397 if (flag_set['I'] && !bkpinfo->backup_data) { 397 log_to_screen( _("-I switch is ignored if just verifying"));398 log_to_screen("-I switch is ignored if just verifying"); 398 399 } 399 400 if (flag_set['E'] && !bkpinfo->backup_data) { 400 log_to_screen( _("-E switch is ignored if just verifying"));401 log_to_screen("-E switch is ignored if just verifying"); 401 402 } 402 403 … … 426 427 if (flag_set['f'] || flag_set['l']) { 427 428 log_to_screen 428 ( _("You don't need to specify bootloader or bootdevice"));429 ("You don't need to specify bootloader or bootdevice"); 429 430 } 430 431 } … … 441 442 strcat(bkpinfo->include_paths, " "); 442 443 } 443 asprintf(&tmp1, flag_val['I']); 444 char *p = tmp1; 445 char *q = tmp1; 446 447 /* Cut the flag_val['I'] in parts containing all paths to test them */ 448 while (p != NULL) { 449 q = strchr(p, ' '); 450 if (q != NULL) { 451 *q = '\0'; 452 p = q+1 ; 453 if (stat(p, &buf) != 0) { 454 log_msg(1, "ERROR ! %s doesn't exist", p); 455 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); 456 } 457 } else { 458 if (stat(p, &buf) != 0) { 459 log_msg(1, "ERROR ! %s doesn't exist", p); 460 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); 461 } 462 p = NULL; 463 } 464 } 465 paranoid_free(tmp1); 466 444 if (stat(flag_val['I'], &buf) != 0) { 445 log_msg(1, "ERROR ! %s doesn't exist", flag_val['I']); 446 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); 447 } 467 448 strncpy(bkpinfo->include_paths + strlen(bkpinfo->include_paths), 468 449 flag_val['I'], 469 4*MAX_STR_LEN - strlen(bkpinfo->include_paths));450 MAX_STR_LEN - strlen(bkpinfo->include_paths)); 470 451 log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths); 471 452 if (bkpinfo->include_paths[0] == '-') { 472 453 retval++; 473 log_to_screen( _("Please supply a sensible value with '-I'\n"));454 log_to_screen("Please supply a sensible value with '-I'\n"); 474 455 } 475 456 } … … 486 467 retval++; 487 468 log_to_screen 488 ( _("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. :-)"));469 ("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. :-)"); 489 470 } 490 471 bkpinfo->make_filelist = FALSE; … … 504 485 if (g_kernel_version >= 2.6 && !strstr(flag_val['d'], "/dev/")) { 505 486 log_to_screen 506 ( _("Linus says 2.6 has a broken ide-scsi module. Proceed at your own risk..."));487 ("Linus says 2.6 has a broken ide-scsi module. Proceed at your own risk..."); 507 488 } 508 489 … … 520 501 if (!flag_set['L']) { 521 502 log_to_screen 522 ( _("You must use -L with -C. Therefore I am setting it for you."));503 ("You must use -L with -C. Therefore I am setting it for you."); 523 504 flag_set['L'] = 1; 524 505 flag_val['L'][0] = '\0'; … … 550 531 flag_set['d'] = TRUE; 551 532 sprintf(tmp, 552 _("You didn't specify a tape streamer device. I'm assuming %s"),533 "You didn't specify a tape streamer device. I'm assuming %s", 553 534 flag_val['d']); 554 535 log_to_screen(tmp); … … 565 546 if (!find_dvd_device(flag_val['d'], FALSE)) { 566 547 flag_set['d'] = TRUE; 567 log_to_screen( _("I guess DVD drive is at %s"), flag_val['d']);548 log_to_screen("I guess DVD drive is at %s", flag_val['d']); 568 549 } 569 550 } … … 584 565 strcat(flag_val['s'], "m"); 585 566 log_to_screen 586 ( _("You did not specify a size (-s) for DVD. I'm guessing %s."),567 ("You did not specify a size (-s) for DVD. I'm guessing %s.", 587 568 flag_val['s']); 588 569 flag_set['s'] = 1; … … 640 621 if (strlen(bkpinfo->isodir) < 3) { 641 622 retval++; 642 log_to_screen( _("NFS share is not mounted. Please mount it.\n"));623 log_to_screen("NFS share is not mounted. Please mount it.\n"); 643 624 } 644 625 log_msg(3, "mount = %s", bkpinfo->nfs_mount); … … 678 659 strcat(bkpinfo->exclude_paths, " "); 679 660 } 680 asprintf(&tmp1, flag_val['E']); 681 char *p = tmp1; 682 char *q = tmp1; 683 684 /* Cut the flag_val['E'] in parts containing all paths to test them */ 685 while (p != NULL) { 686 q = strchr(p, ' '); 687 if (q != NULL) { 688 *q = '\0'; 689 p = q+1 ; 690 if (stat(p, &buf) != 0) { 691 log_msg(1, "WARNING ! %s doesn't exist", p); 692 } 693 } else { 694 if (stat(p, &buf) != 0) { 695 log_msg(1, "WARNING ! %s doesn't exist", p); 696 } 697 p = NULL; 698 } 699 } 700 paranoid_free(tmp1); 701 661 if (stat(flag_val['E'], &buf) != 0) { 662 log_msg(1, "WARNING ! %s doesn't exist", flag_val['E']); 663 } 702 664 strncpy(bkpinfo->exclude_paths + strlen(bkpinfo->exclude_paths), 703 665 flag_val['E'], 704 4*MAX_STR_LEN - strlen(bkpinfo->exclude_paths));666 MAX_STR_LEN - strlen(bkpinfo->exclude_paths)); 705 667 } 706 668 if (flag_set['e']) { … … 765 727 retval++; 766 728 sprintf(tmp, 767 _("You specified kernel '%s', which does not exist\n"),729 "You specified kernel '%s', which does not exist\n", 768 730 bkpinfo->kernel_path); 769 731 log_to_screen(tmp); … … 797 759 retval++; 798 760 sprintf(tmp, 799 _("Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n"),761 "Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n", 800 762 bkpinfo->nfs_remote_dir, bkpinfo->nfs_mount); 801 763 log_to_screen(tmp); … … 807 769 if (g_kernel_version >= 2.6) { 808 770 if (popup_and_get_string 809 ( _("Device"), _("Please specify the device"),771 ("Device", "Please specify the device", 810 772 bkpinfo->media_device, MAX_STR_LEN / 4)) { 811 773 retval++; 812 log_to_screen( _("User opted to cancel."));774 log_to_screen("User opted to cancel."); 813 775 } 814 776 } else if (find_cdrw_device(bkpinfo->media_device)) { 815 777 retval++; 816 778 log_to_screen 817 ( _("Tried and failed to find CD-R[W] drive automatically.\n"));779 ("Tried and failed to find CD-R[W] drive automatically.\n"); 818 780 } else { 819 781 flag_set['d'] = TRUE; … … 824 786 if (!flag_set['d'] && !flag_set['n'] && !flag_set['C']) { 825 787 retval++; 826 log_to_screen( _("Please specify the backup device/directory.\n"));788 log_to_screen("Please specify the backup device/directory.\n"); 827 789 fatal_error 828 790 ("You didn't use -d to specify the backup device/directory."); … … 845 807 retval++; 846 808 log_to_screen 847 ( _("Please specify a tempdir which I can write to. :)"));809 ("Please specify a tempdir which I can write to. :)"); 848 810 fatal_error("I cannot write to the tempdir you specified."); 849 811 } … … 853 815 retval++; 854 816 log_to_screen 855 ( _("Please don't specify a SAMBA or VFAT or NFS tmpdir."));817 ("Please don't specify a SAMBA or VFAT or NFS tmpdir."); 856 818 fatal_error("I cannot write to the tempdir you specified."); 857 819 } … … 901 863 i = which_boot_loader(tmp); 902 864 log_msg(3, "boot loader is %c, residing at %s", i, tmp); 903 printf( _("boot loader is %c, residing at %s\n"), i, tmp);865 printf("boot loader is %c, residing at %s\n", i, tmp); 904 866 finish(0); 905 867 } … … 909 871 retval++; 910 872 log_to_screen 911 ( _("Please install LZOP. You can't use '-L' until you do.\n"));873 ("Please install LZOP. You can't use '-L' until you do.\n"); 912 874 } 913 875 } … … 916 878 && 917 879 !run_program_and_log_output 918 (" egrep -i suse /etc/issue.net | egrep '9.0'| grep 64", TRUE)) {880 ("grep -i suse /etc/issue.net | grep 64", TRUE)) { 919 881 bkpinfo->make_cd_use_lilo = TRUE; 920 882 log_to_screen 921 ( _("Forcing you to use LILO. SuSE 9.0 (64-bit) has a broken mkfs.vfat binary."));883 ("Forcing you to use LILO. SuSE 9.0 (64-bit) has a broken mkfs.vfat binary."); 922 884 } 923 885 if (flag_set['o']) { … … 929 891 bkpinfo->make_cd_use_lilo = TRUE; 930 892 log_to_screen 931 ( _("Your kernel appears not to support vfat filesystems. I am therefore"));932 log_to_screen 933 ( _("using LILO instead of SYSLINUX as the CD/floppy's boot loader."));893 ("Your kernel appears not to support vfat filesystems. I am therefore"); 894 log_to_screen 895 ("using LILO instead of SYSLINUX as the CD/floppy's boot loader."); 934 896 } 935 897 if (run_program_and_log_output("which mkfs.vfat", FALSE)) { … … 937 899 #ifdef __IA32__ 938 900 log_to_screen 939 ( _("Your filesystem is missing 'mkfs.vfat', so I cannot use SYSLINUX as"));940 log_to_screen 941 ( _("your boot loader. I shall therefore use LILO instead."));901 ("Your filesystem is missing 'mkfs.vfat', so I cannot use SYSLINUX as"); 902 log_to_screen 903 ("your boot loader. I shall therefore use LILO instead."); 942 904 #endif 943 905 #ifdef __IA64__ 944 906 log_to_screen 945 ( _("Your filesystem is missing 'mkfs.vfat', so I cannot prepare the EFI"));946 log_to_screen( _("environment correctly. Please install it."));907 ("Your filesystem is missing 'mkfs.vfat', so I cannot prepare the EFI"); 908 log_to_screen("environment correctly. Please install it."); 947 909 fatal_error("Aborting"); 948 910 #endif … … 962 924 if (i == 0) { 963 925 retval++; 964 log_to_screen( _("Specify backup (-O), verify (-V) or both (-OV).\n"));926 log_to_screen("Specify backup (-O), verify (-V) or both (-OV).\n"); 965 927 } 966 928 … … 1016 978 if (flag_set[optopt]) { 1017 979 bad_switches = TRUE; 1018 sprintf(tmp, _("Switch -%c previously defined as %s\n"), opt,980 sprintf(tmp, "Switch -%c previously defined as %s\n", opt, 1019 981 flag_val[i]); 1020 982 log_to_screen(tmp); … … 1026 988 optarg[--len] = '\0'; 1027 989 log_to_screen 1028 ( _("Warning - param '%s' should not have trailing slash!"),990 ("Warning - param '%s' should not have trailing slash!", 1029 991 optarg); 1030 992 } … … 1033 995 && flag_val[opt][0] != '/') { 1034 996 sprintf(tmp, 1035 _("-%c flag --- must be absolute path --- '%s' isn't absolute"),997 "-%c flag --- must be absolute path --- '%s' isn't absolute", 1036 998 opt, flag_val[opt]); 1037 999 log_to_screen(tmp); … … 1046 1008 for (i = optind; i < argc; i++) { 1047 1009 bad_switches = TRUE; 1048 sprintf(tmp, _("Invalid arg -- %s\n"), argv[i]);1010 sprintf(tmp, "Invalid arg -- %s\n", argv[i]); 1049 1011 log_to_screen(tmp); 1050 1012 } … … 1079 1041 case SIGINT: 1080 1042 sprintf(tmp, "SIGINT"); 1081 strcpy(tmp2, _("You interrupted me :-)"));1043 strcpy(tmp2, "You interrupted me :-)"); 1082 1044 break; 1083 1045 case SIGKILL: 1084 1046 sprintf(tmp, "SIGKILL"); 1085 1047 strcpy(tmp2, 1086 _("I seriously have no clue how this signal even got to me. Something's wrong with your system."));1048 "I seriously have no clue how this signal even got to me. Something's wrong with your system."); 1087 1049 break; 1088 1050 case SIGTERM: 1089 1051 sprintf(tmp, "SIGTERM"); 1090 strcpy(tmp2, _("Got terminate signal"));1052 strcpy(tmp2, "Got terminate signal"); 1091 1053 break; 1092 1054 case SIGHUP: 1093 1055 sprintf(tmp, "SIGHUP"); 1094 strcpy(tmp2, _("Hangup on line"));1056 strcpy(tmp2, "Hangup on line"); 1095 1057 break; 1096 1058 case SIGSEGV: 1097 1059 sprintf(tmp, "SIGSEGV"); 1098 1060 strcpy(tmp2, 1099 _("Internal programming error. Please send a backtrace as well as your log."));1061 "Internal programming error. Please send a backtrace as well as your log."); 1100 1062 break; 1101 1063 case SIGPIPE: 1102 1064 sprintf(tmp, "SIGPIPE"); 1103 strcpy(tmp2, _("Pipe was broken"));1065 strcpy(tmp2, "Pipe was broken"); 1104 1066 break; 1105 1067 case SIGABRT: 1106 1068 sprintf(tmp, "SIGABRT"); 1107 1069 sprintf(tmp2, 1108 _("Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message."));1070 "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message."); 1109 1071 break; 1110 1072 default: 1111 sprintf(tmp, _("(Unknown)"));1112 } 1113 1114 strcat(tmp, _(" signal received from OS"));1073 sprintf(tmp, "(Unknown)"); 1074 } 1075 1076 strcat(tmp, " signal received from OS"); 1115 1077 log_to_screen(tmp); 1116 1078 log_to_screen(tmp2);
Note:
See TracChangeset
for help on using the changeset viewer.