Changeset 2296 in MondoRescue for branches/2.2.10/mondo/src/common
- Timestamp:
- Jul 23, 2009, 2:53:30 PM (16 years ago)
- Location:
- branches/2.2.10/mondo/src/common
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-archive.c
r2291 r2296 350 350 paranoid_free(command); 351 351 352 mr_asprintf(&command, "afio -o -b %ld -M 16m %s %s < %s 2>> %s", 353 TAPE_BLOCK_SIZE, zipparams, fname, filelist, MONDO_LOGFILE); 352 mr_asprintf(&command, "afio -o -b %ld -M 16m %s %s < %s 2>> %s", TAPE_BLOCK_SIZE, zipparams, fname, filelist, MONDO_LOGFILE); 354 353 paranoid_free(zipparams); 355 354 … … 867 866 log_msg(1, "lines_in_filelist = %ld", lines_in_filelist); 868 867 869 mr_asprintf(&command, 870 /* "mindi --custom 2=%s 3=%s/images 4=\"%s\" 5=\"%s\" \ 868 /* "mindi 1=%s --custom 2=%s 3=%s/images 4=\"%s\" 5=\"%s\" \ 871 869 6=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \ 872 870 11=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/ 873 871 mr_asprintf(&command, "mindi %s --custom %s %s/images '%s' '%s' \ 874 872 '%s' %ld '%s' '%s' '%s' \ 875 873 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", tmp2, bkpinfo->tmpdir, // parameter #2 … … 1076 1074 this_thread_no, archiving_set_no); 1077 1075 if (g_getfattr) { 1078 mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ, 1079 bkpinfo->tmpdir, archiving_set_no); 1076 mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ, bkpinfo->tmpdir, archiving_set_no); 1080 1077 get_fattr_list(archiving_filelist_fname, curr_xattr_list_fname); 1081 1078 mr_free(curr_xattr_list_fname); 1082 1079 } 1083 1080 if (g_getfacl) { 1084 mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ, 1085 bkpinfo->tmpdir, archiving_set_no); 1081 mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ, bkpinfo->tmpdir, archiving_set_no); 1086 1082 get_acl_list(archiving_filelist_fname, curr_acl_list_fname); 1087 1083 mr_free(curr_acl_list_fname); … … 1097 1093 1098 1094 if (res) { 1099 mr_asprintf(&tmp, 1100 "Errors occurred while archiving set %ld. Please review logs.", 1101 archiving_set_no); 1095 mr_asprintf(&tmp, "Errors occurred while archiving set %ld. Please review logs.", archiving_set_no); 1102 1096 log_to_screen(tmp); 1103 1097 mr_free(tmp); … … 1427 1421 } else { 1428 1422 // store set N 1429 mr_asprintf(&storing_filelist_fname, FILELIST_FNAME_RAW_SZ, 1430 bkpinfo->tmpdir, storing_set_no); 1431 mr_asprintf(&storing_afioball_fname, AFIOBALL_FNAME_RAW_SZ, 1432 bkpinfo->tmpdir, storing_set_no, bkpinfo->zip_suffix); 1423 mr_asprintf(&storing_filelist_fname, FILELIST_FNAME_RAW_SZ, bkpinfo->tmpdir, storing_set_no); 1424 mr_asprintf(&storing_afioball_fname, AFIOBALL_FNAME_RAW_SZ, bkpinfo->tmpdir, storing_set_no, bkpinfo->zip_suffix); 1433 1425 if (g_getfattr) { 1434 mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ, 1435 bkpinfo->tmpdir, storing_set_no); 1426 mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ, bkpinfo->tmpdir, storing_set_no); 1436 1427 } 1437 1428 if (g_getfacl) { 1438 mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ, 1439 bkpinfo->tmpdir, storing_set_no); 1429 mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ, bkpinfo->tmpdir, storing_set_no); 1440 1430 } 1441 1431 … … 1491 1481 mr_free(media_usage_comment); 1492 1482 if (res) { 1493 mr_asprintf(&tmp, "Failed to add archive %ld's files to CD dir\n", 1494 storing_set_no); 1483 mr_asprintf(&tmp, "Failed to add archive %ld's files to CD dir\n", storing_set_no); 1495 1484 log_to_screen(tmp); 1496 1485 paranoid_free(tmp); … … 1717 1706 1718 1707 if (bkpinfo->call_before_iso[0] != '\0') { 1719 mr_asprintf(&message_to_screen, "Running pre-ISO call for CD#%d", 1720 g_current_media_number); 1708 mr_asprintf(&message_to_screen, "Running pre-ISO call for CD#%d", g_current_media_number); 1721 1709 res = 1722 1710 eval_call_to_make_ISO(bkpinfo->call_before_iso, … … 1763 1751 retval += res; 1764 1752 #ifdef DVDRWFORMAT 1765 mr_asprintf(&tmp, 1766 "tail -n8 %s | grep 'blank=full.*dvd-compat.*DAO'", 1767 MONDO_LOGFILE); 1753 mr_asprintf(&tmp, "tail -n8 %s | grep 'blank=full.*dvd-compat.*DAO'", MONDO_LOGFILE); 1768 1754 if (g_backup_media_type == dvd 1769 1755 && (res || !run_program_and_log_output(tmp, 1))) { … … 2089 2075 "Calling ntfsclone in background because %s is an NTFS partition", 2090 2076 bigfile_fname); 2091 mr_asprintf(&sz_devfile, "%s/%d.%d.000", bkpinfo->tmpdir, 2092 (int) (random() % 32768), 2093 (int) (random() % 32768)); 2077 mr_asprintf(&sz_devfile, "%s/%d.%d.000", bkpinfo->tmpdir, (int) (random() % 32768), (int) (random() % 32768)); 2094 2078 mkfifo(sz_devfile, 0x770); 2095 2079 ntfsprog_fifo = sz_devfile; … … 2774 2758 mr_asprintf(&tmp, "cat %s 2> /dev/null", szserfname); 2775 2759 mr_free(our_serial_str); 2776 mr_asprintf(&our_serial_str, "%s", 2777 call_program_and_get_last_line_of_output(tmp)); 2760 mr_asprintf(&our_serial_str, "%s", call_program_and_get_last_line_of_output(tmp)); 2778 2761 mr_free(tmp); 2779 2762 // FIXME - should be able to use last_line_of_file(), surely? … … 2812 2795 eject_device(cdrom_dev); 2813 2796 mds = media_descriptor_string(g_backup_media_type); 2814 mr_asprintf(&tmp, "I am about to burn %s #%d of the backup set. Please insert %s and press Enter.", 2815 mds, g_current_media_number, mds); 2797 mr_asprintf(&tmp, "I am about to burn %s #%d of the backup set. Please insert %s and press Enter.", mds, g_current_media_number, mds); 2816 2798 mr_free(mds); 2817 2799 … … 3114 3096 mr_asprintf(&tmp, "Problem with slice # %ld", slice_num); 3115 3097 } else { 3116 mr_asprintf(&tmp, "%s - Bigfile #%ld, slice #%ld compressed OK ", biggie_filename, biggie_file_number + 1, 3117 slice_num); 3098 mr_asprintf(&tmp, "%s - Bigfile #%ld, slice #%ld compressed OK ", biggie_filename, biggie_file_number + 1, slice_num); 3118 3099 } 3119 3100 #ifndef _XWIN … … 3351 3332 if (space_occupied_by_cd(bkpinfo->scratchdir) / 1024 > 3352 3333 bkpinfo->media_size[g_current_media_number]) { 3353 mr_asprintf(&tmp1, 3354 "Warning! CD is too big. It occupies %ld KB, which is more than the %ld KB allowed.", 3355 (long) space_occupied_by_cd(bkpinfo->scratchdir), 3334 mr_asprintf(&tmp1, "Warning! CD is too big. It occupies %ld KB, which is more than the %ld KB allowed.", (long) space_occupied_by_cd(bkpinfo->scratchdir), 3356 3335 (long) bkpinfo->media_size[g_current_media_number]); 3357 3336 log_to_screen(tmp1); 3358 3337 mr_free(tmp1); 3359 3338 } 3360 mr_asprintf(&isofile, "%s/%s/%s-%d.iso", bkpinfo->isodir, 3361 bkpinfo->nfs_remote_dir, bkpinfo->prefix, 3362 g_current_media_number); 3339 mr_asprintf(&isofile, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->nfs_remote_dir, bkpinfo->prefix, g_current_media_number); 3363 3340 for (that_one_was_ok = FALSE; !that_one_was_ok;) { 3364 3341 if (bkpinfo->backup_media_type != usb) { … … 3421 3398 } 3422 3399 wipe_archives(bkpinfo->scratchdir); 3423 mr_asprintf(&tmp1, "rm -Rf %s/images/*gz %s/images/*data*img", 3424 bkpinfo->scratchdir, bkpinfo->scratchdir); 3400 mr_asprintf(&tmp1, "rm -Rf %s/images/*gz %s/images/*data*img", bkpinfo->scratchdir, bkpinfo->scratchdir); 3425 3401 if (system(tmp1)) { 3426 3402 log_msg -
branches/2.2.10/mondo/src/common/libmondo-cli.c
r2291 r2296 901 901 } 902 902 flag_set['d'] = TRUE; 903 mr_asprintf(&tmp1, 904 "You didn't specify a tape streamer device. I'm assuming %s", 905 flag_val['d']); 903 mr_asprintf(&tmp1, "You didn't specify a tape streamer device. I'm assuming %s", flag_val['d']); 906 904 log_to_screen(tmp1); 907 905 mr_free(tmp1); … … 1184 1182 1185 1183 if (flag_set['b']) { 1186 mr_asprintf(&psz, flag_val['b']);1184 mr_asprintf(&psz, "%s", flag_val['b']); 1187 1185 log_msg(1, "psz = '%s'", psz); 1188 1186 if (psz[strlen(psz) - 1] == 'k') { … … 1230 1228 && !does_file_exist(bkpinfo->kernel_path)) { 1231 1229 retval++; 1232 mr_asprintf(&tmp1, 1233 "You specified kernel '%s', which does not exist\n", 1234 bkpinfo->kernel_path); 1230 mr_asprintf(&tmp1, "You specified kernel '%s', which does not exist\n", bkpinfo->kernel_path); 1235 1231 log_to_screen(tmp1); 1236 1232 mr_free(tmp1); … … 1272 1268 if (i) { 1273 1269 retval++; 1274 mr_asprintf(&tmp2, 1275 "Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n", 1276 bkpinfo->nfs_remote_dir, bkpinfo->nfs_mount); 1270 mr_asprintf(&tmp2, "Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n", bkpinfo->nfs_remote_dir, bkpinfo->nfs_mount); 1277 1271 log_to_screen(tmp2); 1278 1272 mr_free(tmp2); … … 1593 1587 case SIGKILL: 1594 1588 mr_asprintf(&tmp, "SIGKILL"); 1595 mr_asprintf(&tmp2, 1596 "I seriously have no clue how this signal even got to me. Something's wrong with your system."); 1589 mr_asprintf(&tmp2, "I seriously have no clue how this signal even got to me. Something's wrong with your system."); 1597 1590 break; 1598 1591 case SIGTERM: … … 1606 1599 case SIGSEGV: 1607 1600 mr_asprintf(&tmp, "SIGSEGV"); 1608 mr_asprintf(&tmp2, 1609 "Internal programming error. Please send a backtrace as well as your log."); 1601 mr_asprintf(&tmp2, "Internal programming error. Please send a backtrace as well as your log."); 1610 1602 break; 1611 1603 case SIGPIPE: -
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2291 r2296 257 257 mr_asprintf(&command, "cdcontrol -f %s close", dev); 258 258 } else { 259 mr_asprintf(&command, "camcontrol load `echo %s | sed 's|/dev/||'`", 260 dev); 259 mr_asprintf(&command, "camcontrol load `echo %s | sed 's|/dev/||'`", dev); 261 260 } 262 261 #else … … 343 342 #ifdef __FreeBSD__ 344 343 // We assume here that this is running from mondorestore. (It is.) 345 mr_asprintf(&program, "ls %s %s >/dev/null 2>&1", drive, 346 build_partition_name(tmp, drive, partno)); 344 mr_asprintf(&program, "ls %s %s >/dev/null 2>&1", drive, build_partition_name(tmp, drive, partno)); 347 345 res = system(program); 348 346 mr_free(program); … … 399 397 assert_string_is_neither_NULL_nor_zerolength(str); 400 398 401 mr_asprintf(&command, 402 "dd if=%s bs=446 count=1 2> /dev/null | strings | grep \"%s\" > /dev/null 2> /dev/null", 403 dev, str); 399 mr_asprintf(&command, "dd if=%s bs=446 count=1 2> /dev/null | strings | grep \"%s\" > /dev/null 2> /dev/null", dev, str); 404 400 i = system(command); 405 401 mr_free(command); … … 425 421 int i; 426 422 427 mr_asprintf(&command, 428 "dd if=%s bs=512 count=%i 2> /dev/null | strings | grep \"%s\" > /dev/null 2> /dev/null", 429 dev, n, str); 423 mr_asprintf(&command, "dd if=%s bs=512 count=%i 2> /dev/null | strings | grep \"%s\" > /dev/null 2> /dev/null", dev, n, str); 430 424 i = system(command); 431 425 mr_free(command); … … 530 524 } 531 525 if (find_home_of_exe(cdr_exe)) { 532 mr_asprintf(&command, 533 "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep CD | cut -d' ' -f2 | head -n1", 534 cdr_exe); 526 mr_asprintf(&command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep CD | cut -d' ' -f2 | head -n1", cdr_exe); 535 527 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output(command)); 536 528 mr_free(command); … … 848 840 } 849 841 850 mr_asprintf(&command, 851 "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", 852 cdr_exe, g_cdrw_drive_is_here); 842 mr_asprintf(&command, "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", cdr_exe, g_cdrw_drive_is_here); 853 843 log_msg(1, "command=%s", command); 854 844 mr_asprintf(&tmp1, "%s", call_program_and_get_last_line_of_output(command)); … … 1042 1032 1043 1033 #ifdef __FreeBSD__ 1044 mr_asprintf(&command, 1045 "lsvfs | tr -s '\t' ' ' | grep -v Filesys | grep -v -- -- | cut -d' ' -f1 | tr -s '\n' ' '"); 1034 mr_asprintf(&command, "lsvfs | tr -s '\t' ' ' | grep -v Filesys | grep -v -- -- | cut -d' ' -f1 | tr -s '\n' ' '"); 1046 1035 #else 1047 mr_asprintf(&command, 1048 "grep -v nodev /proc/filesystems | tr -s '\t' ' ' | cut -d' ' -f2 | tr -s '\n' ' '"); 1036 mr_asprintf(&command, "grep -v nodev /proc/filesystems | tr -s '\t' ' ' | cut -d' ' -f2 | tr -s '\n' ' '"); 1049 1037 #endif 1050 1038 … … 1243 1231 1244 1232 #ifdef __FreeBSD__ 1245 mr_asprintf(&command, "mount_vfat %s %s 2>> %s", 1246 device, mountpoint, MONDO_LOGFILE); 1233 mr_asprintf(&command, "mount_vfat %s %s 2>> %s", device, mountpoint, MONDO_LOGFILE); 1247 1234 1248 1235 #else 1249 mr_asprintf(&command, "mount %s -t vfat %s 2>> %s", 1250 device, mountpoint, MONDO_LOGFILE); 1236 mr_asprintf(&command, "mount %s -t vfat %s 2>> %s", device, mountpoint, MONDO_LOGFILE); 1251 1237 #endif 1252 1238 … … 1382 1368 mr_free(tmp); 1383 1369 1384 mr_asprintf(&tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir, 1385 bkpinfo->nfs_remote_dir, bkpinfo->prefix, 1386 cd_number_i_want); 1370 mr_asprintf(&tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->nfs_remote_dir, bkpinfo->prefix, cd_number_i_want); 1387 1371 if (!does_file_exist(tmp)) { 1388 1372 mr_free(tmp); 1389 mr_asprintf(&tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir, 1390 bkpinfo->nfs_remote_dir, bkpinfo->prefix, 1391 cd_number_i_want); 1373 mr_asprintf(&tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir, bkpinfo->nfs_remote_dir, bkpinfo->prefix, cd_number_i_want); 1392 1374 if (does_file_exist(tmp)) { 1393 1375 log_msg(1, … … 1550 1532 mr_free(tmp); 1551 1533 1552 mr_asprintf(&comment, 1553 "How much data (in Megabytes) will each %s store?", mds); 1534 mr_asprintf(&comment, "How much data (in Megabytes) will each %s store?", mds); 1554 1535 mr_free(mds); 1555 1536 if (!popup_and_get_string("Size", comment, sz_size, 5)) { … … 1588 1569 log_msg(1, "bkpinfo->media_device = %s", 1589 1570 bkpinfo->media_device); 1590 mr_asprintf(&comment, 1591 "Please specify your %s drive's /dev entry", mds); 1571 mr_asprintf(&comment, "Please specify your %s drive's /dev entry", mds); 1592 1572 if (!popup_and_get_string 1593 1573 ("Device?", comment, bkpinfo->media_device, … … 1761 1741 1762 1742 if (!bkpinfo->restore_data) { 1763 mr_asprintf(&comment, 1764 "How much data (in Megabytes) will each media store?"); 1743 mr_asprintf(&comment, "How much data (in Megabytes) will each media store?"); 1765 1744 if (!popup_and_get_string("Size", comment, sz_size, 5)) { 1766 1745 mr_free(comment); -
branches/2.2.10/mondo/src/common/libmondo-fifo.c
r2291 r2296 88 88 for (bufsize = wise_upper_limit, res = -1; 89 89 res != 0 && bufsize >= wise_lower_limit; bufsize--) { 90 mr_asprintf(&tmp, 91 "dd if=/dev/zero bs=1024 count=16k 2> /dev/null | buffer -o /dev/null -s %ld -m %d%c", 92 internal_tape_block_size, bufsize, 'm'); 90 mr_asprintf(&tmp, "dd if=/dev/zero bs=1024 count=16k 2> /dev/null | buffer -o /dev/null -s %ld -m %d%c", internal_tape_block_size, bufsize, 'm'); 93 91 res = run_program_and_log_output(tmp, 2); 94 92 mr_free(tmp); -
branches/2.2.10/mondo/src/common/libmondo-filelist.c
r2291 r2296 500 500 mr_free(command); 501 501 502 mr_asprintf(&command, 503 "getfacl --all-effective -P %s 2>> %s | gzip -c1 > %s 2>> %s", 504 filelist, MONDO_LOGFILE, facl_fname, MONDO_LOGFILE); 502 mr_asprintf(&command, "getfacl --all-effective -P %s 2>> %s | gzip -c1 > %s 2>> %s", filelist, MONDO_LOGFILE, facl_fname, MONDO_LOGFILE); 505 503 log_it("%s",command); 506 504 retval = system(command); -
branches/2.2.10/mondo/src/common/libmondo-files.c
r2289 r2296 71 71 mr_free(command); 72 72 } else { 73 mr_asprintf(&tmp, "File '%s' not found; cannot calc checksum", 74 filename); 73 mr_asprintf(&tmp, "File '%s' not found; cannot calc checksum", filename); 75 74 log_it(tmp); 76 75 mr_free(tmp); … … 143 142 assert_string_is_neither_NULL_nor_zerolength(filename); 144 143 if (!does_file_exist(filename)) { 145 mr_asprintf(&tmp, 146 "%s does not exist, so I cannot found the number of lines in it", 147 filename); 144 mr_asprintf(&tmp, "%s does not exist, so I cannot found the number of lines in it", filename); 148 145 log_it(tmp); 149 146 mr_free(tmp); … … 358 355 return (NULL); // forget it :) 359 356 } 360 mr_asprintf(&command, 361 "file %s 2> /dev/null | cut -d':' -f1 2> /dev/null", 362 incoming); 357 mr_asprintf(&command, "file %s 2> /dev/null | cut -d':' -f1 2> /dev/null", incoming); 363 358 strcpy(incoming, 364 359 call_program_and_get_last_line_of_output(command)); … … 459 454 && !strstr(err_log_lines[i], "% done"); i--); 460 455 if (i < 0) { 461 mr_asprintf(&command, 462 "tail -n3 %s | grep -Fi \"%c\" | tail -n1 | awk '{print $0;}'", 463 filename, '%'); 456 mr_asprintf(&command, "tail -n3 %s | grep -Fi \"%c\" | tail -n1 | awk '{print $0;}'", filename, '%'); 464 457 strcpy(lastline, 465 458 call_program_and_get_last_line_of_output(command)); … … 512 505 513 506 if (!does_file_exist(filename)) { 514 mr_asprintf(&tmp, "Tring to get last line of nonexistent file (%s)", 515 filename); 507 mr_asprintf(&tmp, "Tring to get last line of nonexistent file (%s)", filename); 516 508 log_it(tmp); 517 509 mr_free(tmp); … … 630 622 time_remaining = 631 623 time_taken * 100 / (long) (percentage) - time_taken; 632 mr_asprintf(&tmp, 633 "%02d%% done %02d:%02d taken %02d:%02d remaining %-37s\r", 634 percentage, (int) (time_taken / 60), 635 (int) (time_taken % 60), 636 (int) (time_remaining / 60), 637 (int) (time_remaining % 60), curr_fname); 624 mr_asprintf(&tmp, "%02d%% done %02d:%02d taken %02d:%02d remaining %-37s\r", percentage, (int) (time_taken / 60), (int) (time_taken % 60), (int) (time_remaining / 60), (int) (time_remaining % 60), curr_fname); 638 625 log_to_screen(tmp); 639 626 mr_free(tmp); … … 758 745 759 746 mr_asprintf(&mountlist, "%s/mountlist.txt", tmpdir); 760 mr_asprintf(&command, 761 "grep \"%s \" %s/mountlist.txt | head -n1 | awk '{print $4}'", 762 dev, tmpdir); 747 mr_asprintf(&command, "grep \"%s \" %s/mountlist.txt | head -n1 | awk '{print $4}'", dev, tmpdir); 763 748 mr_free(mountlist); 764 749 … … 837 822 log_msg(4, "%s --> %ld K", fname, file_len_K); 838 823 } 839 mr_asprintf(&comment, 840 "After adding %s, scratchL+%ld now equals %ld", fname, 841 file_len_K, scratchL); 824 mr_asprintf(&comment, "After adding %s, scratchL+%ld now equals %ld", fname, file_len_K, scratchL); 842 825 log_msg(4, comment); 843 826 mr_free(comment); … … 1060 1043 find_and_store_mondoarchives_home(g_mondo_home); 1061 1044 } 1062 mr_asprintf(&command, CP_BIN " --parents -pRdf %s %s", g_mondo_home, 1063 bkpinfo->scratchdir); 1045 mr_asprintf(&command, CP_BIN " --parents -pRdf %s %s", g_mondo_home, bkpinfo->scratchdir); 1064 1046 1065 1047 log_msg(4, "command = %s", command); … … 1071 1053 } 1072 1054 1073 mr_asprintf(&command, "cp -f %s/LAST-FILELIST-NUMBER %s", bkpinfo->tmpdir, 1074 bkpinfo->scratchdir); 1055 mr_asprintf(&command, "cp -f %s/LAST-FILELIST-NUMBER %s", bkpinfo->tmpdir, bkpinfo->scratchdir); 1075 1056 res = run_program_and_log_output(command, FALSE); 1076 1057 mr_free(command); … … 1099 1080 1100 1081 if (bkpinfo->postnuke_tarball[0]) { 1101 mr_asprintf(&command, "cp -f %s %s/post-nuke.tgz", 1102 bkpinfo->postnuke_tarball, bkpinfo->tmpdir); 1082 mr_asprintf(&command, "cp -f %s %s/post-nuke.tgz", bkpinfo->postnuke_tarball, bkpinfo->tmpdir); 1103 1083 res = run_program_and_log_output(command, FALSE); 1104 1084 mr_free(command); … … 1150 1130 } 1151 1131 *(p++) = '\0'; 1152 mr_asprintf(&nfs_server_ipaddr, tmp);1153 mr_asprintf(&nfs_mount, p);1132 mr_asprintf(&nfs_server_ipaddr, "%s", tmp); 1133 mr_asprintf(&nfs_mount, "%s", p); 1154 1134 mr_free(tmp); 1155 1135 1156 1136 /* BERLIOS : there is a bug #67 here as it only considers the first NIC */ 1157 mr_asprintf(&command, 1158 "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\n' | head -n1 | cut -d' ' -f1"); 1137 mr_asprintf(&command, "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\n' | head -n1 | cut -d' ' -f1"); 1159 1138 mr_asprintf(&nfs_dev, "%s", call_program_and_get_last_line_of_output(command)); 1160 1139 mr_free(command); 1161 1140 1162 mr_asprintf(&command, 1163 "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f7 | cut -d':' -f2"); 1141 mr_asprintf(&command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f7 | cut -d':' -f2"); 1164 1142 mr_asprintf(&nfs_client_ipaddr, "%s", call_program_and_get_last_line_of_output(command)); 1165 1143 mr_free(command); 1166 1144 1167 mr_asprintf(&command, 1168 "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f9 | cut -d':' -f2"); 1145 mr_asprintf(&command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f9 | cut -d':' -f2"); 1169 1146 mr_asprintf(&nfs_client_netmask, "%s", call_program_and_get_last_line_of_output(command)); 1170 1147 mr_free(command); 1171 1148 1172 mr_asprintf(&command, 1173 "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f8 | cut -d':' -f2"); 1149 mr_asprintf(&command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f8 | cut -d':' -f2"); 1174 1150 mr_asprintf(&nfs_client_broadcast, "%s", call_program_and_get_last_line_of_output(command)); 1175 1151 mr_free(command); 1176 1152 1177 mr_asprintf(&command, 1178 "%s", "route -n | grep '^0.0.0.0' | awk '{print $2}'"); 1153 mr_asprintf(&command, "%s", "route -n | grep '^0.0.0.0' | awk '{print $2}'"); 1179 1154 mr_asprintf(&nfs_client_defgw, "%s", call_program_and_get_last_line_of_output(command)); 1180 1155 mr_free(command); … … 1195 1170 if (!strncmp(nfs_dev, "bond", 4) || !strncmp(nfs_dev, "alb", 3) || !strncmp(nfs_dev, "aft", 3)) { 1196 1171 log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", nfs_dev); 1197 mr_asprintf(&command, 1198 "%s", "ifconfig %s | awk '{print $5}' | head -n1", nfs_dev); 1172 mr_asprintf(&command, "%s", "ifconfig %s | awk '{print $5}' | head -n1", nfs_dev); 1199 1173 mr_asprintf(&mac_addr, "%s", call_program_and_get_last_line_of_output(command)); 1200 1174 mr_free(command); … … 1204 1178 mr_free(nfs_dev); 1205 1179 1206 mr_asprintf(&nfs_dev, call_program_and_get_last_line_of_output(command));1180 mr_asprintf(&nfs_dev, "%s", call_program_and_get_last_line_of_output(command)); 1207 1181 mr_free(command); 1208 1182 … … 1313 1287 mr_free(mds); 1314 1288 } else if (scratchLL > 4) { 1315 mr_asprintf(&tmp, 1316 "Your backup will occupy one meeeeellion media! (maybe %s)", 1317 number_to_text((int) (scratchLL + 1))); 1289 mr_asprintf(&tmp, "Your backup will occupy one meeeeellion media! (maybe %s)", number_to_text((int) (scratchLL + 1))); 1318 1290 } else { 1319 mr_asprintf(&tmp, "Your backup will occupy approximately %s media.", 1320 number_to_text((int) (scratchLL + 1))); 1291 mr_asprintf(&tmp, "Your backup will occupy approximately %s media.", number_to_text((int) (scratchLL + 1))); 1321 1292 } 1322 1293 if (!bkpinfo->image_devs[0] && (scratchLL < 50)) { -
branches/2.2.10/mondo/src/common/libmondo-fork.c
r2275 r2296 283 283 log_if_failure = TRUE; 284 284 } 285 mr_asprintf(&callstr, "%s > %s/mondo-run-prog-thing.tmp 2> %s/mondo-run-prog-thing.err", 286 program, bkpinfo->tmpdir, bkpinfo->tmpdir); 285 mr_asprintf(&callstr, "%s > %s/mondo-run-prog-thing.tmp 2> %s/mondo-run-prog-thing.err", program, bkpinfo->tmpdir, bkpinfo->tmpdir); 287 286 while ((p = strchr(callstr, '\r'))) { 288 287 *p = ' '; … … 390 389 mr_asprintf(&lockfile, "%s/mojo-jojo.bla.bla", bkpinfo->tmpdir); 391 390 392 mr_asprintf(&command, 393 "echo hi > %s ; %s >> %s 2>> %s; res=$?; sleep 1; rm -f %s; exit $res", 394 lockfile, basic_call, MONDO_LOGFILE, MONDO_LOGFILE, lockfile); 391 mr_asprintf(&command, "echo hi > %s ; %s >> %s 2>> %s; res=$?; sleep 1; rm -f %s; exit $res", lockfile, basic_call, MONDO_LOGFILE, MONDO_LOGFILE, lockfile); 395 392 open_evalcall_form(what_i_am_doing); 396 393 mr_asprintf(&tmp, "Executing %s", basic_call); -
branches/2.2.10/mondo/src/common/libmondo-stream.c
r2266 r2296 273 273 strcpy(cdr_exe, "dvdrecord"); 274 274 } 275 mr_asprintf(&command, "%s -scanbus 2> /dev/null | grep -i tape | wc -l", 276 cdr_exe); 275 mr_asprintf(&command, "%s -scanbus 2> /dev/null | grep -i tape | wc -l", cdr_exe); 277 276 strcpy(tmp, call_program_and_get_last_line_of_output(command)); 278 277 mr_free(command); … … 284 283 return 1; 285 284 } 286 mr_asprintf(&command, 287 "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1", 288 cdr_exe); 285 mr_asprintf(&command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1", cdr_exe); 289 286 strcpy(tmp, call_program_and_get_last_line_of_output(command)); 290 287 mr_free(command); … … 294 291 return 1; 295 292 } 296 mr_asprintf(&command, 297 "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1", 298 cdr_exe); 293 mr_asprintf(&command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1", cdr_exe); 299 294 strcpy(tmp, call_program_and_get_last_line_of_output(command)); 300 295 mr_free(command); … … 475 470 log_it("Insisting on tape #%d", tapeno); 476 471 if (g_current_media_number != tapeno) { 477 mr_asprintf(&tmp, 478 "When the tape drive goes quiet, please insert volume %d in this series.", 479 tapeno); 472 mr_asprintf(&tmp, "When the tape drive goes quiet, please insert volume %d in this series.", tapeno); 480 473 popup_and_OK(tmp); 481 474 mr_free(tmp); … … 869 862 (void) getcwd(old_cwd, MAX_STR_LEN); 870 863 chdir(bkpinfo->tmpdir); 871 mr_asprintf(&tmp, "tar -zxf %s ./tmp/mondo-restore.cfg 2> /dev/null", 872 outfname); 864 mr_asprintf(&tmp, "tar -zxf %s ./tmp/mondo-restore.cfg 2> /dev/null", outfname); 873 865 paranoid_system(tmp); 874 866 mr_free(tmp); … … 1143 1135 } 1144 1136 if (strcmp(temp_cksum, actual_cksum)) { 1145 mr_asprintf(&tmp, "actual cksum=%s; recorded cksum=%s", actual_cksum, 1146 temp_cksum); 1137 mr_asprintf(&tmp, "actual cksum=%s; recorded cksum=%s", actual_cksum, temp_cksum); 1147 1138 log_to_screen(tmp); 1148 1139 mr_free(tmp); 1149 1140 1150 mr_asprintf(&tmp, "%s (%ld K) is corrupt on tape", temp_fname, 1151 (long) orig_size >> 10); 1141 mr_asprintf(&tmp, "%s (%ld K) is corrupt on tape", temp_fname, (long) orig_size >> 10); 1152 1142 log_to_screen(tmp); 1153 1143 mr_free(tmp); … … 1500 1490 } 1501 1491 if (bkpinfo->backup_media_type == cdstream) { 1502 mr_asprintf(&command, 1503 "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s", 1504 bkpinfo->media_device, bkpinfo->cdrw_speed, MONDO_LOGFILE, 1505 MONDO_LOGFILE); 1492 mr_asprintf(&command, "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s", bkpinfo->media_device, bkpinfo->cdrw_speed, MONDO_LOGFILE, MONDO_LOGFILE); 1506 1493 log_it("Opening OUT to next CD with the command"); 1507 1494 log_it(command); … … 1706 1693 p++; 1707 1694 } 1708 mr_asprintf(&tmp, "Writing file '%s' to tape (%ld KB)", p, 1709 (long) filesize >> 10); 1695 mr_asprintf(&tmp, "Writing file '%s' to tape (%ld KB)", p, (long) filesize >> 10); 1710 1696 log_it(tmp); 1711 1697 mr_free(tmp); … … 1812 1798 fwrite(tempblock, 1, (size_t) TAPE_BLOCK_SIZE, 1813 1799 g_tape_stream) / 1024; 1814 mr_asprintf(&tmp, "%s (fname=%s, size=%ld K)", 1815 marker_to_string(control_char), p, 1816 (long) length_of_incoming_file >> 10); 1800 mr_asprintf(&tmp, "%s (fname=%s, size=%ld K)", marker_to_string(control_char), p, (long) length_of_incoming_file >> 10); 1817 1801 log_msg(6, tmp); 1818 1802 mr_free(tmp); -
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2291 r2296 610 610 611 611 log_it("isodir = %s", bkpinfo->isodir); 612 mr_asprintf(&command, "df -P %s | tail -n1 | cut -d' ' -f1", 613 bkpinfo->isodir); 612 mr_asprintf(&command, "df -P %s | tail -n1 | cut -d' ' -f1", bkpinfo->isodir); 614 613 log_it("command = %s", command); 615 614 log_it("res of it = %s", call_program_and_get_last_line_of_output(command)); … … 911 910 ("ln -sf `which mkfs.msdos` /sbin/mkfs.vfat", FALSE); 912 911 } 913 mr_asprintf(&tmp, "%s", 914 call_program_and_get_last_line_of_output 915 ("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2")); 912 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2")); 916 913 if (atol(tmp) < 35000) { 917 914 retval++; … … 984 981 run_program_and_log_output 985 982 ("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5); 986 mr_asprintf(&tmp, "%s", 987 call_program_and_get_last_line_of_output 988 ("mount | grep -E \"cdr(om|w)\"")); 983 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output("mount | grep -E \"cdr(om|w)\"")); 989 984 if (strcmp("", tmp)) { 990 985 if (strstr(tmp, "autofs")) { … … 1067 1062 assert_string_is_neither_NULL_nor_zerolength(label); 1068 1063 if (!does_file_exist(config_file)) { 1069 mr_asprintf(&tmp, "(read_cfg_var) Cannot find %s config file", 1070 config_file); 1064 mr_asprintf(&tmp, "(read_cfg_var) Cannot find %s config file", config_file); 1071 1065 log_to_screen(tmp); 1072 1066 mr_free(tmp); … … 1078 1072 return (0); 1079 1073 } else { 1080 mr_asprintf(&command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", 1081 label, config_file); 1074 mr_asprintf(&command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", label, config_file); 1082 1075 strcpy(value, call_program_and_get_last_line_of_output(command)); 1083 1076 mr_free(command); … … 1207 1200 g_boot_mountpt[0] = '\0'; 1208 1201 log_msg(4, "Done. Great. Seeting command to something"); 1209 mr_asprintf(&command, "%s", 1210 "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1202 mr_asprintf(&command, "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1211 1203 log_msg(4, "Cool. Command = '%s'", command); 1212 1204 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output(command)); … … 1218 1210 mr_asprintf(&command, "mount | grep -Ew '/boot'"); 1219 1211 mr_free(tmp); 1220 mr_asprintf(&tmp, call_program_and_get_last_line_of_output(command));1212 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output(command)); 1221 1213 mr_free(command); 1222 1214 … … 1235 1227 strcpy(g_boot_mountpt, tmp); 1236 1228 mr_free(tmp); 1237 mr_asprintf(&tmp, 1238 "%s (your /boot partition) is not mounted. I'll mount it before backing up", 1239 g_boot_mountpt); 1229 mr_asprintf(&tmp, "%s (your /boot partition) is not mounted. I'll mount it before backing up", g_boot_mountpt); 1240 1230 log_it(tmp); 1241 1231 mr_free(tmp); … … 1304 1294 assert(value != NULL); 1305 1295 if (!does_file_exist(config_file)) { 1306 mr_asprintf(&tmp, "(write_cfg_file) Cannot find %s config file", 1307 config_file); 1296 mr_asprintf(&tmp, "(write_cfg_file) Cannot find %s config file", config_file); 1308 1297 log_to_screen(tmp); 1309 1298 mr_free(tmp); … … 1312 1301 mr_asprintf(&tempfile, "%s/mojo-jojo.blah", bkpinfo->tmpdir); 1313 1302 if (does_file_exist(config_file)) { 1314 mr_asprintf(&command, "grep -vE '^%s .*$' %s > %s", 1315 label, config_file, tempfile); 1303 mr_asprintf(&command, "grep -vE '^%s .*$' %s > %s", label, config_file, tempfile); 1316 1304 paranoid_system(command); 1317 1305 mr_free(command); -
branches/2.2.10/mondo/src/common/libmondo-verify.c
r2276 r2296 107 107 108 108 log_msg(1, "Now scanning log file for 'star: ' stuff"); 109 mr_asprintf(&command, 110 "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s", 111 stderr_fname, afio_found_changes); 109 mr_asprintf(&command, "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s", stderr_fname, afio_found_changes); 112 110 log_msg(2, command); 113 111 res = system(command); … … 118 116 } 119 117 afio_diffs = count_lines_in_file(afio_found_changes); 120 mr_asprintf(&command, 121 "sort %s %s %s | uniq -c | awk '{ if ($1==\"2\") {print $2;};}' | grep -v \"incheckentry xwait()\" > %s", 122 ignorefiles_fname, afio_found_changes, afio_found_changes, 123 changedfiles_fname); 118 mr_asprintf(&command, "sort %s %s %s | uniq -c | awk '{ if ($1==\"2\") {print $2;};}' | grep -v \"incheckentry xwait()\" > %s", ignorefiles_fname, afio_found_changes, afio_found_changes, changedfiles_fname); 124 119 mr_free(afio_found_changes); 125 120 log_msg(2, command); … … 172 167 } else { 173 168 retval++; 174 mr_asprintf(&tmp, "Warning - missing set(s) between %d and %d\n", 175 g_last_afioball_number, set_number - 1); 169 mr_asprintf(&tmp, "Warning - missing set(s) between %d and %d\n", g_last_afioball_number, set_number - 1); 176 170 log_to_screen(tmp); 177 171 mr_free(tmp); … … 342 336 g_current_media_number, bigfile_num, slice_num); 343 337 if (!does_file_exist(slice_fname(bigfile_num, slice_num, mountpoint, ""))) { 344 mr_asprintf(&command, "%s -dc %s 2>> %s", 345 sz_exe, 346 slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix), 347 MONDO_LOGFILE); 338 mr_asprintf(&command, "%s -dc %s 2>> %s", sz_exe, slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix), MONDO_LOGFILE); 348 339 } else { 349 340 mr_asprintf(&command, "cat %s 2>> %s", slice_fname(bigfile_num, slice_num, mountpoint, ""), MONDO_LOGFILE); … … 474 465 bkpinfo->use_star = TRUE; 475 466 if (strstr(tarball_fname, ".bz2")) 476 mr_asprintf(&command, 477 "star -diff diffopts=mode,size,data file=%s %s >> %s 2>> %s", 478 tarball_fname, 479 (strstr(tarball_fname, ".bz2")) ? "-bz" : " ", outlog, 480 outlog); 467 mr_asprintf(&command, "star -diff diffopts=mode,size,data file=%s -bz >> %s 2>> %s", tarball_fname, outlog, outlog); 481 468 } else { 482 469 bkpinfo->use_star = FALSE; 483 mr_asprintf(&command, "afio -r -P %s -Z %s >> %s 2>> %s", 484 bkpinfo->zip_exe, tarball_fname, outlog, outlog); 470 mr_asprintf(&command, "afio -r -P %s -Z %s >> %s 2>> %s", bkpinfo->zip_exe, tarball_fname, outlog, outlog); 485 471 } 486 472 log_msg(6, "command=%s", command); … … 491 477 mr_asprintf(&command, "cat %s >> %s", outlog, MONDO_LOGFILE); 492 478 } else { 493 mr_asprintf(&command, "cut -d: -f%d %s | sort -u", 494 (bkpinfo->use_star) ? 1 : 2, outlog); 479 mr_asprintf(&command, "cut -d: -f%d %s | sort -u", (bkpinfo->use_star) ? 1 : 2, outlog); 495 480 pin = popen(command, "r"); 496 481 if (pin) { … … 794 779 res = verify_an_afioball_from_stream(fname, size); 795 780 if (res) { 796 mr_asprintf(&tmp, "Afioball %ld differs from live filesystem", 797 current_afioball_number); 781 mr_asprintf(&tmp, "Afioball %ld differs from live filesystem", current_afioball_number); 798 782 log_to_screen(tmp); 799 783 mr_free(tmp); … … 897 881 p++; 898 882 } 899 mr_asprintf(&comment, "Verifying bigfile #%ld (%ld K)", 900 current_biggiefile_number, (long) size >> 10); 883 mr_asprintf(&comment, "Verifying bigfile #%ld (%ld K)", current_biggiefile_number, (long) size >> 10); 901 884 update_progress_form(comment); 902 885 mr_free(comment); … … 1208 1191 diffs = count_lines_in_file(changed_files_fname); 1209 1192 if (diffs > 0) { 1210 mr_asprintf(&tmp, "cp -f %s %s/changed.files", changed_files_fname, 1211 MONDO_CACHE); 1193 mr_asprintf(&tmp, "cp -f %s %s/changed.files", changed_files_fname, MONDO_CACHE); 1212 1194 run_program_and_log_output(tmp, FALSE); 1213 1195 mr_free(tmp); -
branches/2.2.10/mondo/src/common/newt-specific.c
r2291 r2296 1026 1026 || percentage > g_isoform_old_progress) { 1027 1027 g_isoform_old_progress = percentage; 1028 mr_asprintf(&timeline_str, "%2ld:%02ld taken %2ld:%02ld remaining", (long) time_taken / 60, (long) time_taken % 60, 1029 (long) time_remaining / 60, (long) time_remaining % 60); 1028 mr_asprintf(&timeline_str, "%2ld:%02ld taken %2ld:%02ld remaining", (long) time_taken / 60, (long) time_taken % 60, (long) time_remaining / 60, (long) time_remaining % 60); 1030 1029 if (percentage < 3) { 1031 1030 mr_asprintf(&pcline_str, " Working"); … … 1038 1037 mr_strcat(pcline_str, " %c", special_dot_char(g_mysterious_dot_counter)); 1039 1038 } else { 1040 mr_asprintf(&pcline_str, " %3d%% done %3d%% to go", 1041 percentage, 100 - percentage); 1039 mr_asprintf(&pcline_str, " %3d%% done %3d%% to go", percentage, 100 - percentage); 1042 1040 } 1043 1041 if (g_text_mode) { … … 1143 1141 } else { 1144 1142 if (g_current_progress > g_maximum_progress) { 1145 mr_asprintf(&tmp, 1146 "update_progress_form_full(%s,%s,%s) --- g_current_progress=%ld; g_maximum_progress=%ld", 1147 blurb1, blurb2, blurb3, g_current_progress, 1148 g_maximum_progress); 1149 log_msg(0, tmp); 1150 mr_free(tmp); 1143 log_msg(0, "update_progress_form_full(%s,%s,%s) --- g_current_progress=%ld; g_maximum_progress=%ld", blurb1, blurb2, blurb3, g_current_progress, g_maximum_progress); 1151 1144 g_current_progress = g_maximum_progress; 1152 1145 } … … 1185 1178 paranoid_free(taskprogress); 1186 1179 } else { 1187 mr_asprintf(&timeline_str, "%2ld:%02ld taken %2ld:%02ld remaining ", 1188 (long) time_taken / 60, (long) time_taken % 60, (long) time_remaining / 60, (long) time_remaining % 60); 1180 mr_asprintf(&timeline_str, "%2ld:%02ld taken %2ld:%02ld remaining ", (long) time_taken / 60, (long) time_taken % 60, (long) time_remaining / 60, (long) time_remaining % 60); 1189 1181 mr_asprintf(percentline_str, " %3d%% done %3d%% to go", percentage, 100 - percentage); 1190 1182 … … 1608 1600 keylist[i]); 1609 1601 } 1610 mr_asprintf(&differ_sz, 1611 " %ld files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list.", 1612 i); 1602 mr_asprintf(&differ_sz, " %ld files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list.", i); 1613 1603 newtPushHelpLine(differ_sz); 1614 1604 mr_free(differ_sz);
Note:
See TracChangeset
for help on using the changeset viewer.