Changeset 1999 in MondoRescue
- Timestamp:
- Jul 10, 2008, 6:37:04 PM (16 years ago)
- Location:
- branches/2.2.7/mondo/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.7/mondo/src/common/libmondo-fork-EXT.h
r1689 r1999 10 10 int cd_no, char *logstub, 11 11 char *what_i_am_doing); 12 extern int run_external_binary_with_percentage_indicator_OLD(char *tt,13 char *cmd);14 12 extern int run_external_binary_with_percentage_indicator_NEW(char *tt, 15 13 char *cmd); -
branches/2.2.7/mondo/src/common/libmondo-fork.c
r1784 r1999 701 701 702 702 703 704 705 706 int run_external_binary_with_percentage_indicator_OLD(char *tt, char *cmd)707 {708 709 /*@ int *************************************************************** */710 int res = 0;711 int percentage = 0;712 int maxpc = 0;713 int pcno = 0;714 int last_pcno = 0;715 716 /*@ buffers *********************************************************** */717 char *command;718 char *tempfile;719 char *title;720 /*@ pointers ********************************************************** */721 FILE *pin;722 723 malloc_string(title);724 malloc_string(command);725 malloc_string(tempfile);726 assert_string_is_neither_NULL_nor_zerolength(cmd);727 assert_string_is_neither_NULL_nor_zerolength(title);728 729 strcpy(title, tt);730 sprintf(tempfile, "%s/mondo.binperc", bkpinfo->tmpdir);731 sprintf(command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile,732 tempfile);733 log_msg(3, command);734 open_evalcall_form(title);735 if (!(pin = popen(command, "r"))) {736 log_OS_error("fmt err");737 return (1);738 }739 maxpc = 100;740 // OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD741 for (sleep(1); does_file_exist(tempfile); sleep(1)) {742 pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE);743 if (pcno < 0 || pcno > 100) {744 log_msg(5, "Weird pc#");745 continue;746 }747 percentage = pcno * 100 / maxpc;748 if (pcno <= 5 && last_pcno > 40) {749 close_evalcall_form();750 strcpy(title, "Verifying...");751 open_evalcall_form(title);752 }753 last_pcno = pcno;754 update_evalcall_form(percentage);755 }756 // OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD757 close_evalcall_form();758 if (pclose(pin)) {759 res++;760 log_OS_error("Unable to pclose");761 }762 unlink(tempfile);763 paranoid_free(command);764 paranoid_free(tempfile);765 paranoid_free(title);766 return (res);767 }768 769 770 771 772 703 void *run_prog_in_bkgd_then_exit(void *info) 773 704 { -
branches/2.2.7/mondo/src/common/libmondo-fork.h
r1689 r1999 12 12 int cd_no, char *logstub, char *what_i_am_doing); 13 13 14 int run_external_binary_with_percentage_indicator_OLD(char *tt, char *cmd);15 14 int run_external_binary_with_percentage_indicator_NEW(char *tt, char *cmd); 16 15 int copy_from_src_to_dest(FILE *, FILE *, char); -
branches/2.2.7/mondo/src/common/libmondo-tools.c
r1967 r1999 810 810 char *p = NULL; 811 811 812 if ( bkpinfo->tmpdir != NULL) {812 if ((bkpinfo->tmpdir != NULL) && (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL)) { 813 813 /* purging a potential old tmpdir */ 814 814 asprintf(&tmp,"rm -Rf %s",bkpinfo->tmpdir); -
branches/2.2.7/mondo/src/common/newt-specific.c
r1919 r1999 406 406 printf("Execution run ended; result=%d\n", signal); 407 407 printf("Type 'less %s' to see the output log\n", MONDO_LOGFILE); 408 asprintf(&command, "rm -Rf %s %s", bkpinfo->tmpdir, bkpinfo->scratchdir); 409 system(command); 410 paranoid_free(command); 408 if (strstr(bkpinfo->tmpdir ,"mondo.tmp.") != NULL) { 409 asprintf(&command, "rm -Rf %s %s", bkpinfo->tmpdir, bkpinfo->scratchdir); 410 system(command); 411 paranoid_free(command); 412 } 411 413 paranoid_free(bkpinfo); 412 414 free_libmondo_global_strings(); -
branches/2.2.7/mondo/src/mondorestore/mondorestore.c
r1987 r1999 3189 3189 } 3190 3190 log_msg(2, "Still here. Yay."); 3191 if ( strlen(bkpinfo->tmpdir) > 0) {3191 if ((strlen(bkpinfo->tmpdir) > 0) && (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL)) { 3192 3192 sprintf(tmp, "rm -Rf %s/*", bkpinfo->tmpdir); 3193 3193 run_program_and_log_output(tmp, FALSE); … … 3353 3353 run_program_and_log_output("mount / -o remount,rw", 2); 3354 3354 } // for b0rken distros 3355 sprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir); 3356 system(tmp); 3355 if (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL) { 3356 sprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir); 3357 system(tmp); 3358 } 3357 3359 paranoid_MR_finish(retval); // frees global stuff plus bkpinfo 3358 3360 free_libmondo_global_strings(); // it's fine to have this here :) really :) -
branches/2.2.7/mondo/src/restore-scripts/mondo/grub-install.patched
r691 r1999 282 282 283 283 copy_images() { 284 # Copy the GRUB images to the GRUB directory. 285 # for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do 286 # rm -f $file || exit 1 287 # done 288 for file in \ 289 ${pkgdatadir}/stage1 ${pkgdatadir}/stage2 ${pkgdatadir}/*stage1_5; do 290 cp -f $file ${grubdir} || exit 1 284 for file in ${pkgdatadir}/stage1 ${pkgdatadir}/stage2 ${pkgdatadir}/*stage1_5; do 285 cp -f $file ${grubdir} || exit 1 291 286 done 292 287 } -
branches/2.2.7/mondo/src/restore-scripts/mondo/mount-subroutine-me
r567 r1999 24 24 if [ -e "$mountdir" ] && [ ! -d "$mountdir" ] ; then 25 25 LogIt "$mountdir exists (but not a dir). Deleting..." 2 26 rm "$mountdir" -f26 rm -f "$mountdir" 27 27 mkdir -p "$mountdir" 28 28 else
Note:
See TracChangeset
for help on using the changeset viewer.