Changeset 2816 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-devices.c
- Timestamp:
- Apr 29, 2011, 3:42:55 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2715 r2816 37 37 /*@unused@*/ 38 38 //static char cvsid[] = "$Id$"; 39 // 40 41 extern char *which_compression_type(); 42 /* Do we use extended attributes and acl ? */ 43 extern char *g_getfacl; 44 extern char *g_getfattr; 39 45 40 46 extern int g_current_media_number; … … 1283 1289 { 1284 1290 char *mount_cmd = NULL; 1291 char *mountdir = NULL; 1285 1292 int i, res; 1286 1293 #ifdef __FreeBSD__ … … 1326 1333 1327 1334 } else if (bkpinfo->backup_media_type == iso) { 1335 if (bkpinfo->subdir) { 1336 mr_asprintf(mountdir, "%s/%s", bkpinfo->isodir, bkpinfo->subdir); 1337 } else { 1338 mr_asprintf(mountdir, "%s", bkpinfo->isodir); 1339 } 1328 1340 #ifdef __FreeBSD__ 1329 mr_sprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir, 1330 bkpinfo->prefix, g_current_media_number); 1341 mr_asprintf(mount_cmd, "%s/%s-%d.iso", mountdir, bkpinfo->prefix, g_current_media_number); 1331 1342 mddev = make_vn(mount_cmd); 1332 1343 mr_free(mount_cmd); … … 1334 1345 mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM); 1335 1346 #else 1336 mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM); 1337 #endif 1347 mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", mountdir, bkpinfo->prefix, g_current_media_number, MNT_CDROM); 1348 #endif 1349 mr_free(mountdir); 1338 1350 } else if (bkpinfo->backup_media_type == usb) { 1339 1351 mr_asprintf(mount_cmd, "mount -t vfat %s %s", bkpinfo->media_device, MNT_CDROM); … … 1984 1996 char *tmp1 = NULL; 1985 1997 1998 if (pathlist == NULL) { 1999 return; 2000 } 1986 2001 while ((token = mr_strtok(pathlist, token_chars, &lastpos)) != NULL) { 1987 2002 switch (get_dsf_mount_list(token, &mounted_on_dsf, ¬_mounted_on_dsf)) { … … 2614 2629 char *command = NULL; 2615 2630 char *comment = NULL; 2631 char *compression_type = NULL; 2616 2632 int i; 2617 2633 FILE *fin; … … 2657 2673 } 2658 2674 } 2675 if ((compression_type = which_compression_type()) == NULL) { 2676 log_to_screen("User has chosen not to backup the PC"); 2677 finish(1); 2678 } 2679 2659 2680 if ((bkpinfo->compression_level = which_compression_level()) == -1) { 2660 2681 log_to_screen("User has chosen not to backup the PC"); … … 2840 2861 } 2841 2862 if (archiving_to_media) { 2842 if ((bkpinfo->compression_level = 2843 which_compression_level()) == -1) { 2863 if ((compression_type = which_compression_type()) == NULL) { 2864 log_to_screen("User has chosen not to backup the PC"); 2865 finish(1); 2866 } 2867 if ((bkpinfo->compression_level = which_compression_level()) == -1) { 2844 2868 log_to_screen("User has chosen not to backup the PC"); 2845 2869 finish(1); … … 2876 2900 bkpinfo->netfs_mount = p; 2877 2901 if (!bkpinfo->restore_data) { 2878 if ((bkpinfo->compression_level = 2879 which_compression_level()) == -1) { 2902 if ((compression_type = which_compression_type()) == NULL) { 2903 log_to_screen("User has chosen not to backup the PC"); 2904 finish(1); 2905 } 2906 2907 if ((bkpinfo->compression_level = which_compression_level()) == -1) { 2880 2908 log_to_screen("User has chosen not to backup the PC"); 2881 2909 finish(1); … … 3004 3032 3005 3033 if (archiving_to_media) { 3006 if ((bkpinfo->compression_level = 3007 which_compression_level()) == -1) { 3034 if ((compression_type = which_compression_type()) == NULL) { 3035 log_to_screen("User has chosen not to backup the PC"); 3036 finish(1); 3037 } 3038 if ((bkpinfo->compression_level = which_compression_level()) == -1) { 3008 3039 log_to_screen("User has chosen not to backup the PC"); 3009 3040 finish(1); … … 3119 3150 3120 3151 3121 p = popup_and_get_string("Exclude paths", "Please enter paths which you do NOT want to backup. Separate them with pipes. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", bkpinfo->exclude_paths);3152 p = popup_and_get_string("Exclude paths", "Please enter paths which you do NOT want to backup. Separate them with '|'. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", bkpinfo->exclude_paths); 3122 3153 if (p == NULL) { 3123 3154 log_to_screen("User has chosen not to backup the PC"); … … 3145 3176 bkpinfo->scratchdir = p; 3146 3177 3178 if (ask_me_yes_or_no("Do you want to backup extended attributes?")) { 3179 if (find_home_of_exe("getfattr")) { 3180 mr_free(g_getfattr); 3181 mr_asprintf(g_getfattr,"getfattr"); 3182 } 3183 if (find_home_of_exe("getfacl")) { 3184 mr_free(g_getfacl); 3185 mr_asprintf(g_getfacl,"getfacl"); 3186 } 3187 } 3147 3188 // Interactive mode: 3148 3189 #ifdef __IA64__ … … 3152 3193 #endif 3153 3194 bkpinfo->backup_data = TRUE; 3195 3196 mr_free(bkpinfo->zip_exe); 3197 mr_free(bkpinfo->zip_suffix); 3198 if (strcmp(compression_type,"lzo") == 0) { 3199 mr_asprintf(bkpinfo->zip_exe, "lzop"); 3200 mr_asprintf(bkpinfo->zip_suffix, "lzo"); 3201 } else if (strcmp(compression_type,"gzip") == 0) { 3202 mr_asprintf(bkpinfo->zip_exe, "gzip"); 3203 mr_asprintf(bkpinfo->zip_suffix, "gz"); 3204 } else if (strcmp(compression_type,"lzma") == 0) { 3205 mr_asprintf(bkpinfo->zip_exe, "xy"); 3206 mr_asprintf(bkpinfo->zip_suffix, "xy"); 3207 } else if (strcmp(compression_type,"bzip2") == 0) { 3208 mr_asprintf(bkpinfo->zip_exe, "bzip2"); 3209 mr_asprintf(bkpinfo->zip_suffix, "bz2"); 3210 } else { 3211 bkpinfo->zip_exe = NULL; 3212 bkpinfo->zip_suffix = NULL; 3213 } 3154 3214 bkpinfo->verify_data = 3155 3215 ask_me_yes_or_no … … 3164 3224 bkpinfo->restore_data = TRUE; // probably... 3165 3225 } 3226 mr_free(compression_type); 3166 3227 3167 3228 if (bkpinfo->backup_media_type == iso … … 3229 3290 3230 3291 3231 3232 3233 3292 /* @} - end of deviceGroup */
Note:
See TracChangeset
for help on using the changeset viewer.