Changeset 1769 in MondoRescue for branches/stable/mondo/src/common/libmondo-verify.c
- Timestamp:
- Nov 6, 2007, 1:37:38 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/libmondo-verify.c
r1663 r1769 41 41 /** 42 42 * Generate the filename of a tarball to verify. 43 * @param bkpinfo The backup information structure. @c bkpinfo-> zip_suffix is the only field used.43 * @param bkpinfo The backup information structure. @c bkpinfo->compression_suffix is the only field used. 44 44 * @param mountpoint The directory where the CD/DVD/ISO is mounted. 45 45 * @param setno The afioball number to get the location of. … … 56 56 assert_string_is_neither_NULL_nor_zerolength(mountpoint); 57 57 sprintf(output, "%s/archives/%d.star.%s", mountpoint, setno, 58 bkpinfo-> zip_suffix);58 bkpinfo->compression_suffix); 59 59 if (!does_file_exist(output)) { 60 60 sprintf(output, "%s/archives/%d.afio.%s", mountpoint, setno, 61 bkpinfo-> zip_suffix);61 bkpinfo->compression_suffix); 62 62 } 63 63 return (output); … … 211 211 * - @c compression_level 212 212 * - @c restore_path 213 * - @c use_lzo 214 * - @c zip_suffix 213 * - @c compression_suffix 215 214 * @param mtpt The mountpoint the CD/DVD/ISO is mounted on. 216 215 * @return The number of differences (0 for perfect biggiefiles). … … 224 223 char *mountpoint = NULL; 225 224 char *command = NULL; 226 char *sz_exe = NULL;227 225 static char *bufblkA = NULL; 228 226 static char *bufblkB = NULL; … … 252 250 assert(bkpinfo != NULL); 253 251 assert_string_is_neither_NULL_nor_zerolength(mtpt); 254 255 if (bkpinfo->compression_level > 0) {256 if (bkpinfo->use_lzo) {257 mr_asprintf(&sz_exe, "lzop");258 } else if (bkpinfo->use_gzip) {259 mr_asprintf(&sz_exe, "gzip");260 } else {261 mr_asprintf(&sz_exe, "bzip2");262 }263 } else {264 mr_asprintf(&sz_exe, "");265 }266 252 267 253 iamhere("before vsbf"); … … 286 272 while (does_file_exist 287 273 (slice_fname 288 (bigfile_num, slice_num, mountpoint, bkpinfo-> zip_suffix))274 (bigfile_num, slice_num, mountpoint, bkpinfo->compression_suffix)) 289 275 || 290 276 does_file_exist(slice_fname … … 340 326 g_current_media_number, bigfile_num, slice_num); 341 327 if (!does_file_exist(slice_fname(bigfile_num, slice_num, mountpoint, ""))) { 342 mr_asprintf(&command, "%s -dc %s 2>> %s", sz_exe,343 slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo-> zip_suffix),328 mr_asprintf(&command, "%s -dc %s 2>> %s", bkpinfi->compression_tool, 329 slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->compression_suffix), 344 330 MONDO_LOGFILE); 345 331 } else { … … 392 378 mr_free(tmp); 393 379 mr_free(mountpoint); 394 mr_free(sz_exe);395 380 396 381 last_bigfile_num = bigfile_num; … … 414 399 * You should be changed to the root directory (/) for this to work. 415 400 * @param bkpinfo The backup information structure. Fields used: 416 * - @c bkpinfo->use_lzo417 401 * - @c bkpinfo->tmpdir 418 * - @c bkpinfo-> zip_exe419 * - @c bkpinfo-> zip_suffix402 * - @c bkpinfo->compression_tool 403 * - @c bkpinfo->compression_suffix 420 404 * @param tarball_fname The filename of the afioball to verify. 421 405 * @return 0, always. … … 442 426 443 427 mr_asprintf(&outlog, "%s/afio.log", bkpinfo->tmpdir); 444 445 /* if programmer forgot to say which compression thingy to use then find out */446 if (strstr(tarball_fname, ".lzo")447 && strcmp(bkpinfo->zip_suffix, "lzo")) {448 mr_msg(2, "OK, I'm going to start using lzop.");449 strcpy(bkpinfo->zip_exe, "lzop");450 strcpy(bkpinfo->zip_suffix, "lzo");451 bkpinfo->use_lzo = TRUE;452 bkpinfo->use_gzip = FALSE;453 }454 if (strstr(tarball_fname, ".gz")455 && strcmp(bkpinfo->zip_suffix, "gz")) {456 mr_msg(2, "OK, I'm going to start using gzip.");457 strcpy(bkpinfo->zip_exe, "gzip");458 strcpy(bkpinfo->zip_suffix, "gz");459 bkpinfo->use_lzo = FALSE;460 bkpinfo->use_gzip = TRUE;461 }462 if (strstr(tarball_fname, ".bz2")463 && strcmp(bkpinfo->zip_suffix, "bz2")) {464 mr_msg(2, "OK, I'm going to start using bzip2.");465 strcpy(bkpinfo->zip_exe, "bzip2");466 strcpy(bkpinfo->zip_suffix, "bz2");467 bkpinfo->use_lzo = FALSE;468 bkpinfo->use_gzip = FALSE;469 }470 428 unlink(outlog); 429 471 430 if (strstr(tarball_fname, ".star")) { 472 431 bkpinfo->use_star = TRUE; … … 483 442 bkpinfo->use_star = FALSE; 484 443 mr_asprintf(&command, "afio -r -P %s -Z %s >> %s 2>> %s", 485 bkpinfo-> zip_exe, tarball_fname, outlog, outlog);444 bkpinfo->compression_tool, tarball_fname, outlog, outlog); 486 445 } 487 446 mr_msg(6, "command=%s", command);
Note:
See TracChangeset
for help on using the changeset viewer.