Changeset 541 in MondoRescue for branches/stable/mondo/mondo/mondoarchive/main.c
- Timestamp:
- May 13, 2006, 8:47:23 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/mondo/mondoarchive/main.c
r538 r541 247 247 { 248 248 struct s_bkpinfo *bkpinfo; 249 struct s_mrconf *mrconf;250 249 char *tmp; 251 250 int res, retval; 252 251 char *say_at_end; 253 252 254 #ifdef ENABLE_NLS255 setlocale(LC_ALL, "");256 (void) textdomain("mondo");257 #endif258 253 /* Make sure I'm root; abort if not */ 259 254 if (getuid() != 0) { 260 fprintf(stderr, _("Please run as root.\n"));255 fprintf(stderr, "Please run as root.\r\n"); 261 256 exit(127); 262 257 } … … 266 261 && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V") 267 262 || !strcmp(argv[argc - 1], "--version"))) { 268 printf( _("mondoarchive v%s\nSee man page for help\n"), PACKAGE_VERSION);263 printf("mondoarchive v%s\nSee man page for help\n", PACKAGE_VERSION); 269 264 exit(0); 270 265 } … … 275 270 malloc_string(tmp); 276 271 malloc_string(say_at_end); 277 278 /* Initialize Configuration Structure */279 mrarchive_init_conf(mrconf);280 272 281 273 res = 0; … … 283 275 diffs = 0; 284 276 say_at_end[0] = '\0'; 285 printf( _("Initializing...\n"));277 printf("Initializing...\n"); 286 278 if (!(bkpinfo = malloc(sizeof(struct s_bkpinfo)))) { 287 279 fatal_error("Cannot malloc bkpinfo"); … … 329 321 setup_newt_stuff(); 330 322 if (!strstr(argv[2], "filelist")) { 331 printf( _("Sorry - filelist goes first\n"));323 printf("Sorry - filelist goes first\n"); 332 324 finish(1); 333 325 } else { … … 358 350 setup_newt_stuff(); 359 351 if (!strstr(argv[2], "filelist")) { 360 printf( _("Sorry - filelist goes first\n"));352 printf("Sorry - filelist goes first\n"); 361 353 finish(1); 362 354 } else { … … 378 370 setup_newt_stuff(); 379 371 if (find_cdrw_device(tmp)) { 380 printf( _("Failed to find CDR-RW drive\n"));381 } else { 382 printf( _("CD-RW is at %s\n"), tmp);372 printf("Failed to find CDR-RW drive\n"); 373 } else { 374 printf("CD-RW is at %s\n", tmp); 383 375 } 384 376 tmp[0] = '\0'; 385 377 if (find_cdrom_device(tmp, atoi(argv[2]))) { 386 printf( _("Failed to find CD-ROM drive\n"));387 } else { 388 printf( _("CD-ROM is at %s\n"), tmp);378 printf("Failed to find CD-ROM drive\n"); 379 } else { 380 printf("CD-ROM is at %s\n", tmp); 389 381 } 390 382 finish(0); … … 396 388 setup_newt_stuff(); 397 389 if (find_dvd_device(tmp, atoi(argv[2]))) { 398 printf( _("Failed to find DVD drive\n"));399 } else { 400 printf( _("DVD is at %s\n"), tmp);390 printf("Failed to find DVD drive\n"); 391 } else { 392 printf("DVD is at %s\n", tmp); 401 393 } 402 394 finish(0); … … 409 401 if (argc > 2 && !strcmp(argv[1], "test-dev")) { 410 402 if (is_dev_an_NTFS_dev(argv[2])) { 411 printf( _("%s is indeed an NTFS dev\n"), argv[2]);412 } else { 413 printf( _("%s is _not_ an NTFS dev\n"), argv[2]);403 printf("%s is indeed an NTFS dev\n", argv[2]); 404 } else { 405 printf("%s is _not_ an NTFS dev\n", argv[2]); 414 406 } 415 407 finish(0); … … 434 426 if (res) { 435 427 printf 436 ( _("Errors were detected in the command line you supplied.\n"));437 printf( _("Please review the log file - %s \n"),MONDO_LOGFILE);428 ("Errors were detected in the command line you supplied.\n"); 429 printf("Please review the log file - " MONDO_LOGFILE "\n"); 438 430 log_msg(1, "Mondoarchive will now exit."); 439 431 finish(1); … … 449 441 450 442 log_to_screen 451 ( _("BusyBox's sources are available from http://www.busybox.net"));443 ("BusyBox's sources are available from http://www.busybox.net"); 452 444 sprintf(g_erase_tmpdir_and_scratchdir, "rm -Rf %s %s", bkpinfo->tmpdir, 453 445 bkpinfo->scratchdir); … … 461 453 finish(0); 462 454 */ 463 res = backup_data(bkpinfo , mrconf);455 res = backup_data(bkpinfo); 464 456 retval += res; 465 457 if (res) { 466 458 strcat(say_at_end, 467 _("Data archived. Please check the logs, just as a precaution. "));468 } else { 469 strcat(say_at_end, _("Data archived OK. "));459 "Data archived. Please check the logs, just as a precaution. "); 460 } else { 461 strcat(say_at_end, "Data archived OK. "); 470 462 } 471 463 } … … 475 467 res = verify_data(bkpinfo); 476 468 if (res < 0) { 477 sprintf(tmp, _("%d difference%c found."), -res,469 sprintf(tmp, "%d difference%c found.", -res, 478 470 (-res != 1) ? 's' : ' '); 479 471 strcat(say_at_end, tmp); … … 495 487 if (!retval) { 496 488 mvaddstr_and_log_it(g_currentY++, 0, 497 _("Backup and/or verify ran to completion. Everything appears to be fine."));489 "Backup and/or verify ran to completion. Everything appears to be fine."); 498 490 } else { 499 491 mvaddstr_and_log_it(g_currentY++, 0, 500 _("Backup and/or verify ran to completion. However, errors did occur."));501 } 502 503 if (does_file_exist("/ var/cache/mindi/mondorescue.iso")) {492 "Backup and/or verify ran to completion. However, errors did occur."); 493 } 494 495 if (does_file_exist("/root/images/mindi/mondorescue.iso")) { 504 496 log_to_screen 505 ( _("/var/cache/mindi/mondorescue.iso, a boot/utility CD, is available if you want it."));497 ("/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it."); 506 498 } 507 499 … … 510 502 if (g_text_mode) { 511 503 log_to_screen 512 ( _("Type 'less /tmp/changed.files' to see which files don't match the archives"));504 ("Type 'less /tmp/changed.files' to see which files don't match the archives"); 513 505 } else { 514 506 log_msg(1, 515 _("Type 'less /tmp/changed.files' to see which files don't match the archives"));507 "Type 'less /tmp/changed.files' to see which files don't match the archives"); 516 508 log_msg(2, "Calling popup_changelist_from_file()"); 517 509 popup_changelist_from_file("/tmp/changed.files"); … … 531 523 system("rm -Rf /tmp.mondo.* /mondo.scratch.*"); 532 524 if (!retval) { 533 printf( _("Mondoarchive ran OK.\n"));525 printf("Mondoarchive ran OK.\n"); 534 526 } else { 535 printf( _("Errors occurred during backup. Please check logfile.\n"));527 printf("Errors occurred during backup. Please check logfile.\n"); 536 528 } 537 529 distro_specific_kludges_at_end_of_mondoarchive(); … … 557 549 if (!g_text_mode) { 558 550 popup_and_OK 559 ( _("Mondo Archive has finished its run. Please press ENTER to return to the shell prompt."));560 log_to_screen( _("See %s for details of backup run."), MONDO_LOGFILE);551 ("Mondo Archive has finished its run. Please press ENTER to return to the shell prompt."); 552 log_to_screen("See %s for details of backup run.", MONDO_LOGFILE); 561 553 finish(retval); 562 554 } else { 563 printf( _("See %s for details of backup run.\n"), MONDO_LOGFILE);555 printf("See %s for details of backup run.\n", MONDO_LOGFILE); 564 556 exit(retval); 565 557 }
Note:
See TracChangeset
for help on using the changeset viewer.