Changeset 2242 in MondoRescue for branches/2.2.9/mondo/src/common/libmondo-archive.c
- Timestamp:
- Jun 29, 2009, 7:19:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-archive.c
r2241 r2242 1586 1586 char *message_to_screen = NULL; 1587 1587 char *old_pwd; 1588 char *mds = NULL; 1588 1589 1589 1590 malloc_string(old_pwd); … … 1597 1598 (void)chdir(bkpinfo->scratchdir); 1598 1599 1599 m r_asprintf(&message_to_screen, "Copying data to make %s #%d",1600 media_descriptor_string(bkpinfo->backup_media_type),1601 g_current_media_number);1600 mds = media_descriptor_string(bkpinfo->backup_media_type); 1601 mr_asprintf(&message_to_screen, "Copying data to make %s #%d",mds, g_current_media_number); 1602 mr_free(mds); 1602 1603 log_msg(1, message_to_screen); 1603 1604 … … 1689 1690 char *tmp2; 1690 1691 char *tmp3; 1692 char *mds = NULL; 1691 1693 bool cd_is_mountable; 1692 1694 … … 1746 1748 log_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso); 1747 1749 sprintf(tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir); 1748 m r_asprintf(&message_to_screen, "Making an ISO (%s #%d)",1749 media_descriptor_string(bkpinfo->backup_media_type),1750 g_current_media_number);1750 mds = media_descriptor_string(bkpinfo->backup_media_type); 1751 mr_asprintf(&message_to_screen, "Making an ISO (%s #%d)", mds, g_current_media_number); 1752 mr_free(mds); 1751 1753 1752 1754 pause_and_ask_for_cdr(2, &cd_is_mountable); /* if g_current_media_number >= 2 then pause & ask */ … … 1843 1845 paranoid_free(message_to_screen); 1844 1846 } else { 1845 mr_asprintf(&message_to_screen, "Running mkisofs to make %s #%d", 1846 media_descriptor_string(bkpinfo->backup_media_type), 1847 g_current_media_number); 1847 mds = media_descriptor_string(bkpinfo->backup_media_type); 1848 mr_asprintf(&message_to_screen, "Running mkisofs to make %s #%d", mds, g_current_media_number); 1848 1849 log_msg(1, message_to_screen); 1849 mr_asprintf(&result_sz, "Call to mkisofs to make ISO (%s #%d) ", 1850 media_descriptor_string(bkpinfo->backup_media_type), 1851 g_current_media_number); 1850 mr_asprintf(&result_sz, "Call to mkisofs to make ISO (%s #%d) ", mds, g_current_media_number); 1851 mr_free(mds); 1852 1852 if (bkpinfo->nonbootable_backup) { 1853 1853 log_msg(1, "Making nonbootable backup"); … … 1925 1925 if (bkpinfo->call_burn_iso[0] != '\0') { 1926 1926 log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso); 1927 m r_asprintf(&message_to_screen, "Burning %s #%d",1928 media_descriptor_string(bkpinfo->backup_media_type),1929 g_current_media_number);1927 mds = media_descriptor_string(bkpinfo->backup_media_type); 1928 mr_asprintf(&message_to_screen, "Burning %s #%d", mds, g_current_media_number); 1929 mr_free(mds); 1930 1930 pause_and_ask_for_cdr(2, &cd_is_mountable); 1931 1931 res = … … 1945 1945 1946 1946 if (bkpinfo->call_after_iso[0] != '\0') { 1947 m r_asprintf(&message_to_screen, "Running post-ISO call (%s #%d)",1948 media_descriptor_string(bkpinfo->backup_media_type),1949 g_current_media_number);1947 mds = media_descriptor_string(bkpinfo->backup_media_type); 1948 mr_asprintf(&message_to_screen, "Running post-ISO call (%s #%d)", mds, g_current_media_number); 1949 mr_free(mds); 1950 1950 res = 1951 1951 eval_call_to_make_ISO(bkpinfo->call_after_iso, … … 2052 2052 assert_string_is_neither_NULL_nor_zerolength(biggielist_fname); 2053 2053 2054 malloc_string(bigfile_fname);2055 2054 estimated_total_noof_slices = 2056 2055 size_of_all_biggiefiles_K() / bkpinfo->optimal_set_size + 1; … … 2078 2077 return (1); 2079 2078 } 2079 2080 malloc_string(bigfile_fname); 2080 2081 for (fgets(bigfile_fname, MAX_STR_LEN, fin); !feof(fin); 2081 2082 fgets(bigfile_fname, MAX_STR_LEN, fin), biggie_file_number++) { … … 2759 2760 char *szserfname; 2760 2761 char *szunmount; 2762 char *mds = NULL; 2761 2763 2762 2764 malloc_string(tmp); … … 2769 2771 malloc_string(szunmount); 2770 2772 2771 sprintf(szmsg, "I am about to burn %s #%d",2772 media_descriptor_string(g_backup_media_type),2773 g_current_media_number);2773 mds = media_descriptor_string(g_backup_media_type); 2774 sprintf(szmsg, "I am about to burn %s #%d", mds, g_current_media_number); 2775 mr_free(mds); 2774 2776 log_to_screen(szmsg); 2775 2777 if (g_current_media_number < ask_for_one_if_more_than_this) { … … 2812 2814 } else if (!does_file_exist(szcdno) 2813 2815 || !does_file_exist(szserfname)) { 2816 mds = media_descriptor_string(g_backup_media_type); 2814 2817 log_to_screen 2815 ("%s has data on it but it's probably not a Mondo CD.", 2816 media_descriptor_string(g_backup_media_type));2818 ("%s has data on it but it's probably not a Mondo CD.", mds); 2819 mr_free(mds); 2817 2820 } else { 2818 log_to_screen("%s found in drive. It's a Mondo disk.", 2819 media_descriptor_string(g_backup_media_type)); 2821 mds = media_descriptor_string(g_backup_media_type); 2822 log_to_screen("%s found in drive. It's a Mondo disk.", mds); 2823 mr_free(mds); 2824 2820 2825 cd_number = atoi(last_line_of_file(szcdno)); 2821 2826 sprintf(tmp, "cat %s 2> /dev/null", szserfname); … … 2830 2835 our_serial_str, g_serial_string); 2831 2836 if (cd_number > 0 && !strcmp(our_serial_str, g_serial_string)) { 2832 log_msg(2, "This %s is part of this backup set!",2833 media_descriptor_string(g_backup_media_type));2837 mds = media_descriptor_string(g_backup_media_type); 2838 log_msg(2, "This %s is part of this backup set!", mds); 2834 2839 ok_go_ahead_burn_it = FALSE; 2835 2840 if (cd_number == g_current_media_number - 1) { 2836 log_to_screen 2837 ("I think you've left the previous %s in the drive.", 2838 media_descriptor_string(g_backup_media_type)); 2841 log_to_screen("I think you've left the previous %s in the drive.", mds); 2839 2842 } else { 2840 log_to_screen 2841 ("Please remove this %s. It is part of the backup set you're making now.", 2842 media_descriptor_string(g_backup_media_type)); 2843 log_to_screen("Please remove this %s. It is part of the backup set you're making now.", mds); 2843 2844 } 2845 mr_free(mds); 2846 2844 2847 } else { 2845 2848 log_to_screen("...but not part of _our_ backup set."); … … 2847 2850 mr_free(our_serial_str); 2848 2851 } else { 2852 mds = media_descriptor_string(g_backup_media_type); 2849 2853 log_msg(2, 2850 "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?", 2851 media_descriptor_string(g_backup_media_type)); 2854 "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?", mds); 2852 2855 if (interrogate_disk_currently_in_cdrw_drive(cdrw_dev, FALSE)) { 2853 2856 ok_go_ahead_burn_it = FALSE; 2854 log_to_screen("There isn't a writable %s in the drive.", 2855 media_descriptor_string(g_backup_media_type)); 2856 } 2857 } 2858 2859 /* 2860 if (g_current_media_number > ask_for_one_if_more_than_this) 2861 { 2862 ok_go_ahead_burn_it = FALSE; 2863 log_it("paafcd: %d > %d, so I'll definitely pause.", g_current_media_number > ask_for_one_if_more_than_this); 2864 } 2865 */ 2857 log_to_screen("There isn't a writable %s in the drive.", mds); 2858 } 2859 mr_free(mds); 2860 } 2866 2861 2867 2862 if (!ok_go_ahead_burn_it) { 2868 2863 eject_device(cdrom_dev); 2864 mds = media_descriptor_string(g_backup_media_type); 2869 2865 sprintf(tmp, 2870 "I am about to burn %s #%d of the backup set. Please insert %s and press Enter.", 2871 m edia_descriptor_string(g_backup_media_type),2872 g_current_media_number,2873 media_descriptor_string(g_backup_media_type)); 2866 "I am about to burn %s #%d of the backup set. Please insert %s and press Enter.", 2867 mds, g_current_media_number, mds); 2868 mr_free(mds); 2869 2874 2870 popup_and_OK(tmp); 2875 2871 goto gotos_make_me_puke; … … 2878 2874 } 2879 2875 2876 mds = media_descriptor_string(g_backup_media_type); 2880 2877 log_msg(2, 2881 "paafcd: OK, I assume I have a blank/reusable %s in the drive...", 2882 media_descriptor_string(g_backup_media_type)); 2878 "paafcd: OK, I assume I have a blank/reusable %s in the drive...", mds); 2883 2879 2884 2880 // if (ask_for_one_if_more_than_this>1) { popup_and_OK(szmsg); } 2885 2881 2886 log_to_screen("Proceeding w/ %s in drive.", 2887 media_descriptor_string(g_backup_media_type)); 2882 log_to_screen("Proceeding w/ %s in drive.", mds); 2883 mr_free(mds); 2884 2888 2885 paranoid_free(tmp); 2889 2886 paranoid_free(szmsg); … … 3369 3366 char *lastcd_fname; 3370 3367 char *isofile; 3368 char *mds = NULL; 3371 3369 3372 3370 /*@ bool ******************************************************** */ … … 3388 3386 } 3389 3387 3390 log_msg(1, "OK, time to make %s #%d",3391 media_descriptor_string(bkpinfo->backup_media_type),3392 g_current_media_number);3388 mds = media_descriptor_string(bkpinfo->backup_media_type); 3389 log_msg(1, "OK, time to make %s #%d", mds, g_current_media_number); 3390 mr_free(mds); 3393 3391 3394 3392 /* label the ISO with its number */ … … 3447 3445 } 3448 3446 if (bkpinfo->verify_data && !res) { 3447 mds = media_descriptor_string(g_backup_media_type); 3449 3448 log_to_screen 3450 ("Please reboot from the 1st %s in Compare Mode, as a precaution.", 3451 media_descriptor_string(g_backup_media_type));3449 ("Please reboot from the 1st %s in Compare Mode, as a precaution.", mds); 3450 mr_free(mds); 3452 3451 chdir("/"); 3453 3452 log_it("Before calling verification of image()"); … … 3462 3461 that_one_was_ok = TRUE; 3463 3462 } else { 3464 sprintf(tmp, "Failed to create %s #%d. Retry?",3465 media_descriptor_string(bkpinfo->backup_media_type),3466 g_current_media_number);3463 mds = media_descriptor_string(bkpinfo->backup_media_type); 3464 sprintf(tmp, "Failed to create %s #%d. Retry?", mds, g_current_media_number); 3465 mr_free(mds); 3467 3466 res = ask_me_yes_or_no(tmp); 3468 3467 if (!res) { … … 3525 3524 int res = 0, retval = 0, cdno = 0; 3526 3525 char *tmp; 3526 char *mds = NULL; 3527 3527 long diffs = 0; 3528 3528 … … 3564 3564 retval += res; 3565 3565 if (res) { 3566 mds = media_descriptor_string(bkpinfo->backup_media_type); 3566 3567 sprintf(tmp, 3567 "Warnings/errors were reported while checking %s #%d", 3568 media_descriptor_string(bkpinfo->backup_media_type), 3569 g_current_media_number); 3568 "Warnings/errors were reported while checking %s #%d", mds, g_current_media_number); 3569 mr_free(mds); 3570 3570 log_to_screen(tmp); 3571 3571
Note:
See TracChangeset
for help on using the changeset viewer.