Changeset 1200 in MondoRescue for branches/stable
- Timestamp:
- Feb 25, 2007, 1:28:17 AM (18 years ago)
- Location:
- branches/stable/mondo/src/mondorestore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondorestore/mondo-restore-EXT.h
r1166 r1200 29 29 struct raidlist_itself *); 30 30 extern void sort_mountlist_by_device(struct mountlist_itself *); 31 extern void find_pathname_of_executable_preferably_in_RESTORING(char *,32 char *,33 char *);34 31 extern int interactive_mode(struct s_bkpinfo *, struct mountlist_itself *, 35 32 struct raidlist_itself *); -
branches/stable/mondo/src/mondorestore/mondo-restore.h
r1166 r1200 10 10 int catchall_mode(struct s_bkpinfo *, struct mountlist_itself *, 11 11 struct raidlist_itself *); 12 void find_pathname_of_executable_preferably_in_RESTORING(char *, char *,13 char *);14 12 int interactive_mode(struct s_bkpinfo *, struct mountlist_itself *, 15 13 struct raidlist_itself *); -
branches/stable/mondo/src/mondorestore/mondo-rstr-compare-EXT.h
r128 r1200 1 /* mondo-rstr-compare-EXT.h */ 1 /* 2 * $Id$ 3 **/ 2 4 3 5 -
branches/stable/mondo/src/mondorestore/mondo-rstr-compare.c
r1125 r1200 8 8 #include "../common/mondostructures.h" 9 9 #include "../common/libmondo.h" 10 //#include "../../config.h"11 10 #include "mr_msg.h" 11 #include "mr_mem.h" 12 12 #include "mr-externs.h" 13 13 #include "mondo-rstr-compare.h" … … 33 33 { 34 34 35 FILE *fin ;36 FILE *fout ;35 FILE *fin = NULL; 36 FILE *fout = NULL; 37 37 38 38 /** needs malloc *******/ 39 char *checksum_ptr; 40 char *original_cksum_ptr; 41 char *bigfile_fname_ptr; 42 char *tmp_ptr; 43 char *command_ptr; 44 45 char *checksum, *original_cksum, *bigfile_fname, *tmp, *command; 46 47 char *p; 48 int i; 39 char *checksum = NULL; 40 char *original_cksum = NULL; 41 char *bigfile_fname = NULL; 42 char *tmp = NULL; 43 char *command = NULL; 44 45 char *p = NULL; 46 int i = 0; 47 size_t n = 0; 49 48 int retval = 0; 50 49 51 50 struct s_filename_and_lstat_info biggiestruct; 52 51 53 malloc_string(checksum);54 malloc_string(original_cksum);55 malloc_string(bigfile_fname);56 malloc_string(tmp);57 malloc_string(command);58 malloc_string(checksum_ptr);59 malloc_string(original_cksum_ptr);60 malloc_string(bigfile_fname_ptr);61 malloc_string(command_ptr);62 malloc_string(tmp_ptr);63 64 /*********************************************************************65 * allocate memory clear test sab 16 feb 2003 *66 *********************************************************************/67 52 assert(bkpinfo != NULL); 68 memset(checksum_ptr, '\0', sizeof(checksum));69 memset(original_cksum_ptr, '\0', sizeof(original_cksum));70 memset(bigfile_fname_ptr, '\0', sizeof(bigfile_fname));71 memset(tmp_ptr, '\0', sizeof(tmp));72 memset(command_ptr, '\0', sizeof(command));73 /** end **/74 53 75 54 if (!does_file_exist(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""))) { … … 77 56 insist_on_this_cd_number(bkpinfo, (++g_current_media_number)); 78 57 } else { 79 sprintf(tmp_ptr, 80 "No CD's left. No biggiefiles left. No prob, Bob."); 81 mr_msg(2, tmp_ptr); 58 mr_msg(2, "No CD's left. No biggiefiles left. No problem."); 82 59 return (0); 83 60 } 84 61 } 85 62 if (!(fin = fopen(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""), "r"))) { 86 sprintf(tmp_ptr, 87 "Cannot open bigfile %ld (%s)'s info file", 88 bigfileno + 1, bigfile_fname_ptr); 89 log_to_screen(tmp_ptr); 63 log_to_screen(_("Cannot open bigfile %ld (%s)'s info file"), 64 bigfileno + 1, slice_fname(bigfileno, 0, ARCHIVES_PATH, "")); 90 65 return (1); 91 66 } … … 93 68 paranoid_fclose(fin); 94 69 95 strcpy(checksum_ptr, biggiestruct.checksum); 96 strcpy(bigfile_fname_ptr, biggiestruct.filename); 97 98 mr_msg(2, "biggiestruct.filename = %s", biggiestruct.filename); 99 mr_msg(2, "biggiestruct.checksum = %s", biggiestruct.checksum); 100 101 sprintf(tmp_ptr, "Comparing %s", bigfile_fname_ptr); 70 mr_asprintf(&bigfile_fname, biggiestruct.filename); 71 mr_msg(2, "biggiestruct.filename = %s", bigfile_fname); 72 if (!biggiestruct.checksum[0]) { 73 mr_msg(2, "Warning - %s has no checksum", bigfile_fname); 74 } else { 75 mr_asprintf(&checksum, biggiestruct.checksum); 76 mr_msg(2, "biggiestruct.checksum = %s", checksum); 77 } 102 78 103 79 if (!g_text_mode) { 104 newtDrawRootText(0, 22, tmp_ptr); 80 mr_asprintf(&tmp, _("Comparing %s"), bigfile_fname); 81 newtDrawRootText(0, 22, tmp); 105 82 newtRefresh(); 106 } 107 if (!checksum[0]) { 108 mr_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr); 109 } 110 if (!strncmp(bigfile_fname_ptr, "/dev/", 5)) { 111 strcpy(original_cksum_ptr, "IGNORE"); 112 } else { 113 sprintf(command_ptr, 114 "md5sum \"%s%s\" > /tmp/md5sum.txt 2> /tmp/errors.txt", 115 MNT_RESTORING, bigfile_fname_ptr); 116 } 117 mr_msg(2, command_ptr); 118 paranoid_system 119 ("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null"); 120 if (system(command_ptr)) { 83 mr_free(tmp); 84 } 85 86 if (!strncmp(bigfile_fname, "/dev/", 5)) { 87 mr_msg(2, _("Ignoring device %s"), bigfile_fname); 88 mr_free(bigfile_fname); 89 return(0); 90 } 91 mr_asprintf(&command, 92 "md5sum \"%s%s\" > /tmp/md5sum.txt 2> /tmp/errors.txt", 93 MNT_RESTORING, bigfile_fname); 94 mr_msg(2, command); 95 if (system(command)) { 121 96 log_OS_error("Warning - command failed"); 122 original_cksum[0] = '\0'; 97 paranoid_system("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null"); 98 mr_free(command); 99 mr_free(bigfile_fname); 123 100 return (1); 124 101 } else { 102 mr_free(command); 125 103 if (!(fin = fopen("/tmp/md5sum.txt", "r"))) { 126 mr_msg(2, 127 "Unable to open /tmp/md5sum.txt; can't get live checksum"); 128 original_cksum[0] = '\0'; 104 mr_msg(2, "Unable to open /tmp/md5sum.txt; can't get live checksum"); 105 mr_free(bigfile_fname); 129 106 return (1); 130 107 } else { 131 fgets(original_cksum_ptr, MAX_STR_LEN - 1, fin);108 mr_getline(&original_cksum, &n, fin); 132 109 paranoid_fclose(fin); 133 for (i = strlen(original_cksum _ptr);110 for (i = strlen(original_cksum); 134 111 i > 0 && original_cksum[i - 1] < 32; i--); 135 112 original_cksum[i] = '\0'; 136 p = (char *) strchr(original_cksum _ptr, ' ');113 p = (char *) strchr(original_cksum, ' '); 137 114 if (p) { 138 115 *p = '\0'; … … 140 117 } 141 118 } 142 sprintf(tmp_ptr, "bigfile #%ld ('%s') ", bigfileno + 1, 143 bigfile_fname_ptr); 144 if (!strcmp(checksum_ptr, original_cksum_ptr) != 0) { 145 strcat(tmp_ptr, " ... OK"); 146 } else { 147 strcat(tmp_ptr, "... changed"); 119 if (!strcmp(checksum, original_cksum) != 0) { 120 mr_msg(1, "bigfile #%ld ('%s') ... OK", bigfileno + 1, bigfile_fname); 121 } else { 122 mr_msg(1, "bigfile #%ld ('%s') ... changed", bigfileno + 1, bigfile_fname); 148 123 retval++; 149 124 } 150 mr_msg(1, tmp_ptr); 125 mr_free(original_cksum); 126 mr_free(checksum); 127 151 128 if (retval) { 152 129 if (!(fout = fopen("/tmp/changed.txt", "a"))) { 153 130 fatal_error("Cannot openout changed.txt"); 154 131 } 155 fprintf(fout, "%s\n", bigfile_fname _ptr);132 fprintf(fout, "%s\n", bigfile_fname); 156 133 paranoid_fclose(fout); 157 134 } 158 159 mr_free(original_cksum_ptr);160 mr_free(original_cksum);161 mr_free(bigfile_fname_ptr);162 135 mr_free(bigfile_fname); 163 mr_free(checksum_ptr);164 mr_free(checksum);165 mr_free(command_ptr);166 mr_free(command);167 mr_free(tmp_ptr);168 mr_free(tmp);169 136 170 137 return (retval); … … 184 151 { 185 152 int retval = 0; 186 int res ;187 long noof_biggiefiles , bigfileno = 0;188 char tmp[MAX_STR_LEN];153 int res = 0; 154 long noof_biggiefiles = 0L, bigfileno = 0L; 155 char *tmp = NULL; 189 156 190 157 assert(bkpinfo != NULL); … … 202 169 } 203 170 mvaddstr_and_log_it(g_currentY, 0, 204 "Comparing large files "); 205 open_progress_form("Comparing large files", 206 "I am now comparing the large files", 207 "against the filesystem. Please wait.", "", 171 _ 172 ("Comparing large files ")); 173 open_progress_form(_("Comparing large files"), 174 _("I am now comparing the large files"), 175 _("against the filesystem. Please wait."), "", 208 176 noof_biggiefiles); 209 177 for (bigfileno = 0; bigfileno < noof_biggiefiles; bigfileno++) { 210 sprintf(tmp, "Comparing big file #%ld", bigfileno + 1);178 mr_asprintf(&tmp, "Comparing big file #%ld", bigfileno + 1); 211 179 mr_msg(1, tmp); 212 180 update_progress_form(tmp); 181 mr_free(tmp); 182 213 183 res = compare_a_biggiefile(bkpinfo, bigfileno); 214 184 retval += res; … … 216 186 } 217 187 close_progress_form(); 188 /* BERLIOS: useless ? 218 189 return (0); 190 */ 219 191 if (retval) { 220 mvaddstr_and_log_it(g_currentY++, 74, "Errors.");221 } else { 222 mvaddstr_and_log_it(g_currentY++, 74, "Done.");192 mvaddstr_and_log_it(g_currentY++, 74, _("Errors.")); 193 } else { 194 mvaddstr_and_log_it(g_currentY++, 74, _("Done.")); 223 195 } 224 196 return (retval); … … 241 213 { 242 214 int retval = 0; 243 int res; 244 long noof_lines; 245 long archiver_errors; 246 bool use_star; 247 248 /*** needs malloc *********/ 249 char *command, *tmp, *filelist_name, *logfile, *archiver_exe, 250 *compressor_exe; 251 252 malloc_string(command); 253 malloc_string(tmp); 254 malloc_string(filelist_name); 255 malloc_string(logfile); 256 malloc_string(archiver_exe); 257 malloc_string(compressor_exe); 215 int res = 0; 216 long noof_lines = 0L; 217 long archiver_errors = 0L; 218 bool use_star = FALSE; 219 220 char *command = NULL; 221 char *tmp = NULL; 222 char *filelist_name = NULL; 223 char *logfile = NULL; 224 char *archiver_exe = NULL; 225 char *compressor_exe = NULL; 258 226 259 227 use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE; 260 228 assert_string_is_neither_NULL_nor_zerolength(tarball_fname); 261 sprintf(logfile, "/tmp/afio.log.%d", current_tarball_number); 262 sprintf(filelist_name, MNT_CDROM "/archives/filelist.%d", 229 mr_asprintf(&filelist_name, MNT_CDROM "/archives/filelist.%d", 263 230 current_tarball_number); 264 231 265 232 noof_lines = count_lines_in_file(filelist_name); 233 mr_free(filelist_name); 266 234 267 235 if (strstr(tarball_fname, ".bz2")) { 268 strcpy(compressor_exe, "bzip2");236 mr_asprintf(&compressor_exe, "bzip2"); 269 237 } else if (strstr(tarball_fname, ".gz")) { 270 strcpy(compressor_exe, "gzip");238 mr_asprintf(&compressor_exe, "gzip"); 271 239 } else if (strstr(tarball_fname, ".lzo")) { 272 strcpy(compressor_exe, "lzop");273 } else { 274 compressor_exe [0] = '\0';240 mr_asprintf(&compressor_exe, "lzop"); 241 } else { 242 compressor_exe = NULL; 275 243 } 276 244 277 245 if (use_star) { 278 strcpy(archiver_exe, "star"); 279 } else { 280 strcpy(archiver_exe, "afio"); 281 } 282 283 if (compressor_exe[0]) { 284 strcpy(tmp, compressor_exe); 285 if (!find_home_of_exe(tmp)) { 246 mr_asprintf(&archiver_exe, "star -bz"); 247 } else { 248 mr_asprintf(&archiver_exe, "afio"); 249 } 250 251 if (compressor_exe != NULL) { 252 if (!find_home_of_exe(compressor_exe)) { 286 253 fatal_error("(compare_a_tarball) Compression program missing"); 287 254 } 288 if (use_star) // star 289 { 290 if (!strcmp(compressor_exe, "bzip2")) { 291 strcat(archiver_exe, " -bz"); 292 } else { 255 if (use_star) { 256 if (strcmp(compressor_exe, "bzip2")) { 293 257 fatal_error 294 258 ("(compare_a_tarball) Please use only bzip2 with star"); 295 259 } 296 } else // afio297 {298 sprintf(compressor_exe, "-P %s -Z", tmp);299 }300 }301 // star -diff H=star -bz file=.... 260 } else { 261 tmp = compressor_exe; 262 mr_asprintf(&compressor_exe, "-P %s -Z", tmp); 263 mr_free(tmp); 264 } 265 } 302 266 303 267 #ifdef __FreeBSD__ … … 306 270 #define BUFSIZE (1024L*1024L)/TAPE_BLOCK_SIZE 307 271 #endif 272 273 mr_asprintf(&logfile, "/tmp/afio.log.%d", current_tarball_number); 308 274 if (use_star) // doesn't use compressor_exe 309 275 { 310 sprintf(command,276 mr_asprintf(&command, 311 277 "%s -diff H=star file=%s >> %s 2>> %s", 312 278 archiver_exe, tarball_fname, logfile, logfile); 313 279 } else { 314 sprintf(command,280 mr_asprintf(&command, 315 281 "%s -r -b %ld -M 16m -c %ld %s %s >> %s 2>> %s", 316 282 archiver_exe, … … 319 285 } 320 286 #undef BUFSIZE 287 mr_free(archiver_exe); 288 mr_free(compressor_exe); 321 289 322 290 res = system(command); … … 324 292 if (res) { 325 293 log_OS_error(command); 326 sprintf(tmp, "Warning - afio returned error = %d", res); 327 } 294 } 295 mr_free(command); 296 328 297 if (length_of_file(logfile) > 5) { 329 sprintf(command,298 mr_asprintf(&command, 330 299 "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vx \"dev/.*\" >> /tmp/changed.txt", 331 300 logfile); 332 301 system(command); 302 mr_free(command); 333 303 archiver_errors = count_lines_in_file(logfile); 334 304 } else { 335 305 archiver_errors = 0; 336 306 } 337 sprintf(tmp, "%ld difference%c in fileset #%d ",338 archiver_errors, (archiver_errors != 1) ? 's' : ' ',339 current_tarball_number);340 307 if (archiver_errors) { 341 sprintf(tmp, 342 "Differences found while processing fileset #%d ", 308 mr_msg(1, "Differences found while processing fileset #%d ", 343 309 current_tarball_number); 344 mr_msg(1, tmp);345 310 } 346 311 unlink(logfile); 347 mr_free(command);348 mr_free(tmp);349 mr_free(filelist_name);350 312 mr_free(logfile); 351 malloc_string(archiver_exe);352 malloc_string(compressor_exe);353 313 return (retval); 354 314 } … … 367 327 { 368 328 int retval = 0; 369 int res ;329 int res = 0; 370 330 int current_tarball_number = 0; 371 331 372 /** needs malloc **********/ 373 374 char *t arball_fname, *progress_str, *tmp;375 long max_val ;376 377 malloc_string(tarball_fname);378 m alloc_string(progress_str);332 char *tarball_fname = NULL; 333 char *progress_str = NULL; 334 char *tmp = NULL; 335 long max_val = 0L; 336 337 assert(bkpinfo != NULL); 338 mvaddstr_and_log_it(g_currentY, 0, _("Comparing archives")); 379 339 malloc_string(tmp); 380 381 assert(bkpinfo != NULL);382 mvaddstr_and_log_it(g_currentY, 0, "Comparing archives");383 340 read_cfg_var(g_mondo_cfg_file, "last-filelist-number", tmp); 384 341 385 342 max_val = atol(tmp); 386 sprintf(progress_str, "Comparing with %s #%d ", 387 media_descriptor_string(bkpinfo->backup_media_type), 343 mr_free(tmp); 344 345 mr_asprintf(&progress_str, _("Comparing with %s #%d "), 346 bkpinfo->backup_media_string, 388 347 g_current_media_number); 389 348 390 open_progress_form( "Comparing files",391 "Comparing tarballs against filesystem.",392 "Please wait. This may take some time.",349 open_progress_form(_("Comparing files"), 350 _("Comparing tarballs against filesystem."), 351 _("Please wait. This may take some time."), 393 352 progress_str, max_val); 394 353 … … 398 357 insist_on_this_cd_number(bkpinfo, g_current_media_number); 399 358 update_progress_form(progress_str); 400 sprintf(tarball_fname,359 mr_asprintf(&tarball_fname, 401 360 MNT_CDROM "/archives/%d.afio.bz2", current_tarball_number); 402 361 403 362 if (!does_file_exist(tarball_fname)) { 404 sprintf(tarball_fname, MNT_CDROM "/archives/%d.afio.lzo", 363 mr_free(tarball_fname); 364 mr_asprintf(&tarball_fname, MNT_CDROM "/archives/%d.afio.lzo", 405 365 current_tarball_number); 406 366 } 407 367 if (!does_file_exist(tarball_fname)) { 408 sprintf(tarball_fname, MNT_CDROM "/archives/%d.afio.", 368 mr_free(tarball_fname); 369 mr_asprintf(&tarball_fname, MNT_CDROM "/archives/%d.afio.", 409 370 current_tarball_number); 410 371 } 411 372 if (!does_file_exist(tarball_fname)) { 412 sprintf(tarball_fname, MNT_CDROM "/archives/%d.star.bz2", 373 mr_free(tarball_fname); 374 mr_asprintf(&tarball_fname, MNT_CDROM "/archives/%d.star.bz2", 413 375 current_tarball_number); 414 376 } 415 377 if (!does_file_exist(tarball_fname)) { 416 sprintf(tarball_fname, MNT_CDROM "/archives/%d.star.", 378 mr_free(tarball_fname); 379 mr_asprintf(&tarball_fname, MNT_CDROM "/archives/%d.star.", 417 380 current_tarball_number); 418 381 } … … 423 386 == 0) { 424 387 mr_msg(2, "OK, I think I'm done with tarballs..."); 388 mr_free(tarball_fname); 425 389 break; 426 390 } 427 391 mr_msg(2, "OK, I think it's time for another CD..."); 428 392 g_current_media_number++; 429 sprintf(progress_str, "Comparing with %s #%d ", 430 media_descriptor_string(bkpinfo->backup_media_type), 393 mr_free(progress_str); 394 mr_asprintf(&progress_str, _("Comparing with %s #%d "), 395 bkpinfo->backup_media_string, 431 396 g_current_media_number); 432 397 log_to_screen(progress_str); 433 398 } else { 434 399 res = compare_a_tarball(tarball_fname, current_tarball_number); 435 436 400 g_current_progress++; 437 401 current_tarball_number++; 438 402 } 439 } 403 mr_free(tarball_fname); 404 } 405 mr_free(progress_str); 440 406 close_progress_form(); 407 441 408 if (retval) { 442 mvaddstr_and_log_it(g_currentY++, 74, "Errors."); 443 } else { 444 mvaddstr_and_log_it(g_currentY++, 74, "Done."); 445 } 446 mr_free(tarball_fname); 447 mr_free(progress_str); 448 mr_free(tmp); 409 mvaddstr_and_log_it(g_currentY++, 74, _("Errors.")); 410 } else { 411 mvaddstr_and_log_it(g_currentY++, 74, _("Done.")); 412 } 449 413 return (retval); 450 414 } … … 469 433 { 470 434 /** needs malloc *********/ 471 char *tmp, *cwd, *new, *command; 435 char *tmp = NULL; 436 char *cwd = NULL; 437 char *new = NULL; 438 char *command = NULL; 472 439 int resA = 0; 473 440 int resB = 0; 474 long noof_changed_files; 475 476 malloc_string(tmp); 441 long noof_changed_files = 0L; 442 477 443 malloc_string(cwd); 478 444 malloc_string(new); 479 malloc_string(command);480 445 481 446 assert(bkpinfo != NULL); … … 484 449 chdir(bkpinfo->restore_path); 485 450 getcwd(new, MAX_STR_LEN - 1); 486 sprintf(tmp, "new path is %s", new);487 451 insist_on_this_cd_number(bkpinfo, g_current_media_number); 488 452 unlink("/tmp/changed.txt"); … … 493 457 noof_changed_files = count_lines_in_file("/tmp/changed.txt"); 494 458 if (noof_changed_files) { 495 sprintf(tmp, "%ld files do not match the backup ",459 log_to_screen(_("%ld files do not match the backup "), 496 460 noof_changed_files); 497 // mvaddstr_and_log_it( g_currentY++, 0, tmp ); 498 log_to_screen(tmp); 499 sprintf(command, "cat /tmp/changed.txt >> %s", MONDO_LOGFILE); 461 mr_asprintf(&command, "cat /tmp/changed.txt >> %s", MONDO_LOGFILE); 500 462 paranoid_system(command); 501 } else { 502 sprintf(tmp, "All files match the backup "); 463 mr_free(command); 464 } else { 465 mr_asprintf(&tmp, _("All files match the backup ")); 503 466 mvaddstr_and_log_it(g_currentY++, 0, tmp); 504 467 log_to_screen(tmp); 505 }506 507 mr_free(tmp); 468 mr_free(tmp); 469 } 470 508 471 mr_free(cwd); 509 472 mr_free(new); 510 mr_free(command);511 473 512 474 return (resA + resB); … … 516 478 *END_COMPARE_TO_CD * 517 479 **************************************************************************/ 518 519 520 480 521 481 … … 535 495 { 536 496 int retval = 0; 537 long q; 538 char *tmp; 539 540 malloc_string(tmp); 497 long q = 0L; 498 char *tmp = NULL; 541 499 542 500 /************************************************************************** … … 550 508 while (get_cfg_file_from_archive(bkpinfo)) { 551 509 if (!ask_me_yes_or_no 552 ("Failed to find config file/archives. Choose another source?")) 510 (_ 511 ("Failed to find config file/archives. Choose another source?"))) 553 512 { 554 513 fatal_error("Unable to find config file/archives. Aborting."); … … 559 518 read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo); 560 519 g_current_media_number = 1; 561 mvaddstr_and_log_it(1, 30, "Comparing Automatically");520 mvaddstr_and_log_it(1, 30, _("Comparing Automatically")); 562 521 iamhere("Pre-MAD"); 563 522 retval = mount_all_devices(mountlist, FALSE); … … 578 537 mvaddstr_and_log_it(g_currentY++, 579 538 0, 580 "Warning - differences found during the compare phase"); 539 _ 540 ("Warning - differences found during the compare phase")); 581 541 } 582 542 … … 585 545 if (count_lines_in_file("/tmp/changed.txt") > 0) { 586 546 mvaddstr_and_log_it(g_currentY++, 0, 587 "Differences found while files were being compared."); 547 _ 548 ("Differences found while files were being compared.")); 588 549 streamline_changes_file("/tmp/changed.files", "/tmp/changed.txt"); 589 550 if (count_lines_in_file("/tmp/changed.files") <= 0) { 590 551 mvaddstr_and_log_it(g_currentY++, 0, 591 "...but they were logfiles and temporary files. Your archives are fine."); 592 log_to_screen 593 ("The differences were logfiles and temporary files. Your archives are fine."); 552 _ 553 ("...but they were logfiles and temporary files. Your archives are fine.")); 554 log_to_screen(_ 555 ("The differences were logfiles and temporary files. Your archives are fine.")); 594 556 } else { 595 557 q = count_lines_in_file("/tmp/changed.files"); 596 sprintf(tmp, "%ld significant difference%s found.", q,558 mr_asprintf(&tmp, _("%ld significant difference%s found."), q, 597 559 (q != 1) ? "s" : ""); 598 560 mvaddstr_and_log_it(g_currentY++, 0, tmp); 599 561 log_to_screen(tmp); 600 601 strcpy(tmp, 602 "Type 'less /tmp/changed.files' for a list of non-matching files"); 562 mr_free(tmp); 563 564 mr_asprintf(&tmp, 565 _("Type 'less /tmp/changed.files' for a list of non-matching files")); 603 566 mvaddstr_and_log_it(g_currentY++, 0, tmp); 604 567 log_to_screen(tmp); 568 mr_free(tmp); 605 569 606 570 mr_msg(2, "calling popup_changelist_from_file()"); … … 610 574 } else { 611 575 log_to_screen 612 ("No significant differences were found. Your backup is perfect."); 576 (_ 577 ("No significant differences were found. Your backup is perfect.")); 613 578 } 614 579 kill_petris(); 615 mr_free(tmp);616 580 return (retval); 617 581 } … … 620 584 *END_COMPARE_MODE * 621 585 **************************************************************************/ 586 622 587 623 588 /** … … 633 598 int res; 634 599 600 char *dir = NULL; 601 char *command = NULL; 602 603 assert(bkpinfo != NULL); 635 604 /** needs malloc **/ 636 char *dir, *command;637 638 assert(bkpinfo != NULL);639 605 malloc_string(dir); 640 malloc_string(command);641 606 getcwd(dir, MAX_STR_LEN); 642 607 chdir(bkpinfo->restore_path); 643 608 644 sprintf(command, "cp -f /tmp/LAST-FILELIST-NUMBER %s/tmp",609 mr_asprintf(&command, "cp -f /tmp/LAST-FILELIST-NUMBER %s/tmp", 645 610 bkpinfo->restore_path); 646 611 run_program_and_log_output(command, FALSE); 612 mr_free(command); 613 647 614 mvaddstr_and_log_it(g_currentY, 648 0, "Verifying archives against filesystem");615 0, _("Verifying archives against filesystem")); 649 616 650 617 if (bkpinfo->disaster_recovery … … 666 633 } 667 634 668 mvaddstr_and_log_it(g_currentY++, 74, "Done.");635 mvaddstr_and_log_it(g_currentY++, 74, _("Done.")); 669 636 mr_free(dir); 670 mr_free(command);671 637 return (res); 672 638 } … … 690 656 int compare_to_tape(struct s_bkpinfo *bkpinfo) 691 657 { 692 int res; 693 char *dir, *command; 658 int res = 0; 659 char *dir = NULL; 660 char *command = NULL; 694 661 695 662 assert(bkpinfo != NULL); 696 663 malloc_string(dir); 697 malloc_string(command);698 664 699 665 getcwd(dir, MAX_STR_LEN); 700 666 chdir(bkpinfo->restore_path); 701 sprintf(command, "cp -f /tmp/LAST-FILELIST-NUMBER %s/tmp",667 mr_asprintf(&command, "cp -f /tmp/LAST-FILELIST-NUMBER %s/tmp", 702 668 bkpinfo->restore_path); 703 669 run_program_and_log_output(command, FALSE); 670 mr_free(command); 671 704 672 mvaddstr_and_log_it(g_currentY, 705 0, "Verifying archives against filesystem");673 0, _("Verifying archives against filesystem")); 706 674 res = verify_tape_backups(bkpinfo); 707 675 chdir(dir); 708 676 if (res) { 709 mvaddstr_and_log_it(g_currentY++, 74, "Failed.");710 } else { 711 mvaddstr_and_log_it(g_currentY++, 74, "Done.");677 mvaddstr_and_log_it(g_currentY++, 74, _("Failed.")); 678 } else { 679 mvaddstr_and_log_it(g_currentY++, 74, _("Done.")); 712 680 } 713 681 mr_free(dir); 714 mr_free(command);715 682 return (res); 716 683 } -
branches/stable/mondo/src/mondorestore/mondo-rstr-compare.h
r128 r1200 1 /* mondo-rstr-compare.h1 /* 2 2 * $Id$ 3 3 **/ 4 4 5 5 -
branches/stable/mondo/src/mondorestore/mondo-rstr-newt.h
r1168 r1200 1 /*************************************************************************** 2 mondo-rstr-newt.h - description 3 ------------------- 4 begin : Sat Apr 20 2002 5 copyright : (C) 2002 by Stan Benoit 6 email : troff@nakedsoul.org 7 cvsid : $Id$ 8 ***************************************************************************/ 9 10 /*************************************************************************** 11 * * 12 * This program is free software; you can redistribute it and/or modify * 13 * it under the terms of the GNU General Public License as published by * 14 * the Free Software Foundation; either version 2 of the License, or * 15 * (at your option) any later version. * 16 * * 17 ***************************************************************************/ 18 1 /* 2 * $Id$ 3 **/ 19 4 20 5 #include "my-stuff.h" … … 27 12 #endif /*__FreeBSD__*/ 28 13 29 #define NO_FLAWS_DETECTED "No flaws detected in mountlist at this time. Hit 'OK' to proceed."14 #define NO_FLAWS_DETECTED _("No flaws detected in mountlist at this time. Hit 'OK' to proceed.") 30 15 31 16 … … 46 31 extern long get_phys_size_of_drive(char *); 47 32 extern bool is_this_device_mounted(char *); 33 extern void mr_strip_spaces(char *); 48 34 extern void initialize_raidrec(struct raid_device_record *); 49 35 extern int make_list_of_drives(struct mountlist_itself *, … … 72 58 g_current_progress, g_currentY; 73 59 extern bool g_ISO_restore_mode; 74 75 76 /* my global variables */77 78 //extern newtComponent g_progressForm, g_blurb1, g_blurb2, g_blurb3, g_label,79 // g_timeline, g_percentline, g_scale;80 //extern char err_log_lines[NOOF_ERR_LINES][MAX_STR_LEN], g_blurb_str_1[MAX_STR_LEN] =81 // "", g_blurb_str_2[MAX_STR_LEN] = "", g_blurb_str_3[MAX_STR_LEN] = "";82 //newtComponent g_isoform_main =83 // NULL, g_isoform_header, g_isoform_scale, g_isoform_timeline,84 // g_isoform_pcline;85 //long g_isoform_starttime;86 //int g_isoform_old_progress = -1;87 //char g_isoform_header_str[MAX_STR_LEN];88 //int g_mysterious_dot_counter;89 90 91 92 93 60 94 61 /* my subroutines */ … … 195 162 char *strip_path(char *); 196 163 197 198 199 200 164 /* -------------------------------------------------------------------- */ 201 165 -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools-EXT.h
r1103 r1200 1 /* mondo-rstr-tools-EXT.h1 /* 2 2 * $Id: mondo-rstr-tools-EXT.h 3 3 **/ 4 4 5 5 extern void free_MR_global_filenames(void); … … 26 26 extern void set_signals(int on); 27 27 extern void setup_MR_global_filenames(struct s_bkpinfo *bkpinfo); 28 //extern void setup_signals(int);29 28 extern void terminate_daemon(int); 30 29 extern void termination_in_progress(int); -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.h
r1103 r1200 1 /* mondo-rstr-tools.h1 /* 2 2 * $Id: mondo-rstr-tools.h 3 3 **/ 4 4 5 5 void free_global_filenames(void); … … 26 26 void set_signals(int on); 27 27 void setup_global_filenames(struct s_bkpinfo *bkpinfo); 28 //void setup_signals(int);29 28 void twenty_seconds_til_yikes(void); 30 29 int run_raw_mbr(bool offer_to_hack_scripts, char *bd); -
branches/stable/mondo/src/mondorestore/mondoprep.h
r684 r1200 1 /*************************************************************************** 2 mondoprep.h - description 3 ------------------- 4 begin : Sat Apr 20 2002 5 copyright : (C) 2002 by Stan Benoit 6 email : troff@nakedsoul.org 7 cvsid : $Id$ 8 ***************************************************************************/ 9 10 /*************************************************************************** 11 * * 12 * This program is free software; you can redistribute it and/or modify * 13 * it under the terms of the GNU General Public License as published by * 14 * the Free Software Foundation; either version 2 of the License, or * 15 * (at your option) any later version. * 16 * * 17 ***************************************************************************/ 1 /* 2 * $Id$ 3 **/ 18 4 19 5 … … 28 14 extern bool ask_me_yes_or_no(char *); 29 15 extern long get_phys_size_of_drive(char *); 30 //extern void log_to_screen (char *);31 16 extern void update_progress_form(char *); 32 17 extern void open_progress_form(char *, char *, char *, char *, long); … … 41 26 extern off_t length_of_file(char *); 42 27 extern long noof_lines_that_match_wildcard(char *, char *); 43 //extern char *slice_fname (long, long, bool, char *);44 28 extern char *last_line_of_file(char *); 45 29 extern void log_file_end_to_screen(char *, char *); -
branches/stable/mondo/src/mondorestore/mr-externs.h
r1168 r1200 71 71 extern int read_header_block_from_stream(long long *, char *, int *); 72 72 extern void save_filelist(struct s_node *, char *); 73 extern void mr_strip_spaces(char *); 73 74 extern int strcmp_inc_numbers(char *, char *); 74 75 extern char *slice_fname(long, long, char *, char *);
Note:
See TracChangeset
for help on using the changeset viewer.