Changeset 3879 in MondoRescue for branches/3.3/mondo/src/mondorestore/mondorestore.c
- Timestamp:
- Mar 9, 2024, 3:10:04 AM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/mondorestore/mondorestore.c
r3876 r3879 13 13 #include "mr_mem.h" 14 14 #include "mr_file.h" 15 #include "../common/mondostructures.h" 16 #include "../common/libmondo.h" 17 #include "mr-externs.h" 15 #include "mondostructures.h" 18 16 #include "mondorestore.h" 19 17 #include "mr_msg.h" … … 21 19 #include "mondo-rstr-tools-EXT.h" 22 20 #include "libmondo-mountlist-EXT.h" 21 #include "libmondo-tools-EXT.h" 22 #include "libmondo-gui-EXT.h" 23 #include "libmondo-devices-EXT.h" 24 #include "libmondo-fork-EXT.h" 25 #include "libmondo-string-EXT.h" 26 #include "libmondo-archive-EXT.h" 27 #include "libmondo-raid-EXT.h" 28 #include "libmondo-filelist-EXT.h" 29 #include "libmondo-files-EXT.h" 30 #include "libmondo-stream-EXT.h" 31 #include "libmondo-cli-EXT.h" 23 32 #include "newt-specific-EXT.h" 24 33 25 34 extern void wait_until_software_raids_are_prepped(char *, int); 26 35 extern void twenty_seconds_til_yikes(void); 36 // in mondo-prep.c 37 extern void resize_mountlist_proportionately_to_suit_new_drives(struct mountlist_itself *); 38 extern int format_everything(struct mountlist_itself *, bool , struct raidlist_itself *); 39 extern int partition_everything(struct mountlist_itself *); 40 extern int fput_string_one_char_at_a_time(FILE *, char *); 41 extern int do_my_funky_lvm_stuff(bool, bool ); 42 extern int stop_all_raid_devices(struct mountlist_itself *); 43 44 // in mondo-rstr-newt.c 45 extern int edit_mountlist(char *, struct mountlist_itself *, struct raidlist_itself *); 46 47 // from libmondo-devices.c 48 extern bool g_restoring_live_from_cd; 49 extern bool g_restoring_live_from_netfs; 50 51 extern int g_currentY; 27 52 28 53 /* We don't have a cleanup function yet */ … … 53 78 extern int g_partition_table_locked_up; 54 79 extern int g_noof_rows; 55 56 extern int partition_everything(struct mountlist_itself *mountlist); 57 extern int handle_incoming_parameters(int argc, char *argv[]); 80 extern int g_current_media_number; 58 81 59 82 /** … … 121 144 char *g_getfattr; 122 145 146 extern long g_current_progress; 147 extern int g_currentY; 148 extern int g_current_media_number; 149 150 123 151 /* @} - end of "Restore-Time Globals" in globalGroup */ 124 152 125 126 127 extern int copy_from_src_to_dest(FILE * f_orig, FILE * f_archived,128 char direction);129 153 130 154 … … 580 604 just_changed_cds = FALSE; 581 605 log_msg(3, "I'll continue to scan this CD for bigfiles to be restored."); 582 } else if (does_file_exist( MNT_CDROM "/archives/NOT-THE-LAST")) {606 } else if (does_file_exist(ARCHIVES_PATH "/NOT-THE-LAST")) { 583 607 insist_on_this_cd_number(++g_current_media_number); 584 608 log_to_screen("Restoring from %s #%d", mds, g_current_media_number); … … 691 715 paranoid_free(command); 692 716 693 mr_asprintf(filelist_name, MNT_CDROM "/archives/filelist.%ld", current_tarball_number);717 mr_asprintf(filelist_name, ARCHIVES_PATH "/filelist.%ld", current_tarball_number); 694 718 if (length_of_file(filelist_name) <= 2) { 695 719 log_msg(2, "There are _zero_ files in filelist '%s'", filelist_name); … … 726 750 if (filelist == NULL || matches > 0) { 727 751 if (g_getfattr) { 728 mr_asprintf(xattr_fname, XATTR_LIST_FNAME_RAW_SZ, MNT_CDROM "/archives", current_tarball_number);752 mr_asprintf(xattr_fname, XATTR_LIST_FNAME_RAW_SZ, ARCHIVES_PATH, current_tarball_number); 729 753 } 730 754 if (g_getfacl) { 731 mr_asprintf(acl_fname, ACL_LIST_FNAME_RAW_SZ, MNT_CDROM "/archives", current_tarball_number);755 mr_asprintf(acl_fname, ACL_LIST_FNAME_RAW_SZ, ARCHIVES_PATH, current_tarball_number); 732 756 } 733 757 if (strstr(tarball_fname, ".bz2")) { … … 922 946 mr_free(progress_str); 923 947 924 mr_asprintf(tarball_fname, MNT_CDROM "/archives/%ld.afio.bz2", current_tarball_number);948 mr_asprintf(tarball_fname, ARCHIVES_PATH "/%ld.afio.bz2", current_tarball_number); 925 949 if (!does_file_exist(tarball_fname)) { 926 950 mr_free(tarball_fname); 927 mr_asprintf(tarball_fname, MNT_CDROM "/archives/%ld.afio.gz", current_tarball_number);951 mr_asprintf(tarball_fname, ARCHIVES_PATH "/%ld.afio.gz", current_tarball_number); 928 952 } 929 953 if (!does_file_exist(tarball_fname)) { 930 954 mr_free(tarball_fname); 931 mr_asprintf(tarball_fname, MNT_CDROM "/archives/%ld.afio.lzma", current_tarball_number);955 mr_asprintf(tarball_fname, ARCHIVES_PATH "/%ld.afio.lzma", current_tarball_number); 932 956 } 933 957 if (!does_file_exist(tarball_fname)) { 934 958 mr_free(tarball_fname); 935 mr_asprintf(tarball_fname, MNT_CDROM "/archives/%ld.afio.lzo", current_tarball_number);959 mr_asprintf(tarball_fname, ARCHIVES_PATH "/%ld.afio.lzo", current_tarball_number); 936 960 } 937 961 if (!does_file_exist(tarball_fname)) { 938 962 mr_free(tarball_fname); 939 mr_asprintf(tarball_fname, MNT_CDROM "/archives/%ld.afio.", current_tarball_number);963 mr_asprintf(tarball_fname, ARCHIVES_PATH "/%ld.afio.", current_tarball_number); 940 964 } 941 965 if (!does_file_exist(tarball_fname)) { 942 966 mr_free(tarball_fname); 943 mr_asprintf(tarball_fname, MNT_CDROM "/archives/%ld.star.bz2", current_tarball_number);967 mr_asprintf(tarball_fname, ARCHIVES_PATH "/%ld.star.bz2", current_tarball_number); 944 968 } 945 969 if (!does_file_exist(tarball_fname)) { 946 970 mr_free(tarball_fname); 947 mr_asprintf(tarball_fname, MNT_CDROM "/archives/%ld.star.", current_tarball_number);971 mr_asprintf(tarball_fname, ARCHIVES_PATH "/%ld.star.", current_tarball_number); 948 972 } 949 973 if (!does_file_exist(tarball_fname)) { … … 954 978 return (0); 955 979 } 956 if (!does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST") 957 || system("find " MNT_CDROM 958 "/archives/slice* > /dev/null 2> /dev/null") == 980 if (!does_file_exist(ARCHIVES_PATH "/NOT-THE-LAST") 981 || system("find " ARCHIVES_PATH "/slice* > /dev/null 2> /dev/null") == 959 982 0) { 960 983 break;
Note:
See TracChangeset
for help on using the changeset viewer.