Implemented option -reassure
This commit is contained in:
@ -1815,6 +1815,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
|
||||
m->bar_is_fresh= 0;
|
||||
m->pending_option[0]= 0;
|
||||
m->request_to_abort= 0;
|
||||
m->request_not_to_ask= 0;
|
||||
m->idle_time= 0.0;
|
||||
m->re_failed_at= -1;
|
||||
m->prepended_wd= 0;
|
||||
@ -1962,11 +1963,16 @@ int Xorriso_request_confirmation(struct XorrisO *xorriso, int flag)
|
||||
bit0= important operation going on:
|
||||
demand confirmation of abort, only abort on @@@
|
||||
bit1= mark '@' and '@@' by return 4
|
||||
bit2= accept: i=ignore , r=retry , x=abort
|
||||
bit2= accept: i|n= ignore | do not remove , r|y= retry | remove , q|x= abort
|
||||
bit3= @@@ = 'done reading' rather than 'abort'
|
||||
*/
|
||||
/* return: <=0 error , 1=go on , 2=abort , 3=redo request, 4=see flag bit1
|
||||
(5=skip volume) , 6=retry failed operation
|
||||
/* return: <=0 error
|
||||
1= go on | do not remove existing file
|
||||
2= abort
|
||||
3= redo request for confirmation
|
||||
4= see flag bit1
|
||||
(5= skip volume)
|
||||
6= retry failed operation | remove existing file
|
||||
*/
|
||||
{
|
||||
int ret;
|
||||
@ -2030,7 +2036,7 @@ klammer_affe:;
|
||||
xorriso->result_page_length= -xorriso->result_page_length;
|
||||
if(flag&1) {
|
||||
sprintf(xorriso->info_text,
|
||||
"... [@ = page prompt suppression registered. -page disabled temporarily ] ...\n");
|
||||
"... [@ = prompt suppression registered. Prompting disabled temporarily ] ...\n");
|
||||
Xorriso_info(xorriso,0);
|
||||
}
|
||||
|
||||
@ -2048,16 +2054,20 @@ klammer_affe:;
|
||||
return(1);
|
||||
} else if(flag&4) {
|
||||
|
||||
if(strcmp(cpt,"i")==0 || strcmp(cpt,"I")==0 || *cpt==0) {
|
||||
if(strcmp(cpt,"i")==0 || strcmp(cpt,"I")==0 ||
|
||||
strcmp(cpt,"n")==0 || strcmp(cpt,"N")==0 ||
|
||||
*cpt==0) {
|
||||
return(1);
|
||||
} else if(strcmp(cpt,"r")==0 || strcmp(cpt,"R")==0) {
|
||||
} else if(strcmp(cpt,"r")==0 || strcmp(cpt,"R")==0 ||
|
||||
strcmp(cpt,"y")==0 || strcmp(cpt,"Y")==0) {
|
||||
return(6);
|
||||
} else if(strcmp(cpt,"x")==0 || strcmp(cpt,"X")==0) {
|
||||
} else if(strcmp(cpt,"x")==0 || strcmp(cpt,"X")==0 ||
|
||||
strcmp(cpt,"q")==0 || strcmp(cpt,"Q")==0) {
|
||||
goto request_to_abort;
|
||||
} else {
|
||||
/* >>> unknown input */
|
||||
sprintf(xorriso->info_text,
|
||||
"--- Please enter one of : empty line, i, r, x, @, @@, @@@\n");
|
||||
"--- Please enter one of : empty line, i,n, r,y, q,x, @, @@, @@@\n");
|
||||
Xorriso_info(xorriso,0);
|
||||
return(3);
|
||||
}
|
||||
@ -2124,7 +2134,7 @@ int Xorriso_pager(struct XorrisO *xorriso, char *line, int flag)
|
||||
int ret,linecount;
|
||||
char info_text[10*SfileadrL];
|
||||
|
||||
if(xorriso->result_page_length<=0)
|
||||
if(xorriso->result_page_length<=0 || xorriso->request_not_to_ask)
|
||||
return(1);
|
||||
Xorriso_predict_linecount(xorriso,line,&linecount,0);
|
||||
if(xorriso->result_line_counter+linecount>xorriso->result_page_length) {
|
||||
@ -2180,6 +2190,7 @@ int Xorriso_info(struct XorrisO *xorriso, int flag)
|
||||
/*
|
||||
bit0= use pager (as with result)
|
||||
bit1= permission to suppress output
|
||||
bit2= insist in showing output
|
||||
*/
|
||||
{
|
||||
int ret;
|
||||
@ -2192,7 +2203,7 @@ int Xorriso_info(struct XorrisO *xorriso, int flag)
|
||||
if(note_sev==0)
|
||||
Xorriso__text_to_sev("NOTE", ¬e_sev, 0);
|
||||
if(note_sev<xorriso->report_about_severity &&
|
||||
note_sev<xorriso->abort_on_severity)
|
||||
note_sev<xorriso->abort_on_severity && !(flag&4))
|
||||
return(1);
|
||||
|
||||
if(flag&1) {
|
||||
@ -2825,7 +2836,8 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
|
||||
is_default= !xorriso->do_reassure;
|
||||
sprintf(line,"-reassure %s\n",(xorriso->do_reassure ? "on" : "off"));
|
||||
sprintf(line,"-reassure %s\n",(xorriso->do_reassure == 1 ? "on" :
|
||||
(xorriso->do_reassure == 2 ? "tree" : "off")));
|
||||
if(!(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
|
||||
@ -4553,10 +4565,20 @@ int Xorriso_option_pwdx(struct XorrisO *xorriso, int flag)
|
||||
}
|
||||
|
||||
|
||||
/* Option -reassure "on"|"off" */
|
||||
/* Option -reassure "on"|"tree"|"off" */
|
||||
int Xorriso_option_reassure(struct XorrisO *xorriso, char *mode, int flag)
|
||||
{
|
||||
xorriso->do_reassure= !!strcmp(mode, "off");
|
||||
if(strcmp(mode, "off")==0)
|
||||
xorriso->do_reassure= 0;
|
||||
else if(strcmp(mode, "on")==0)
|
||||
xorriso->do_reassure= 1;
|
||||
else if(strcmp(mode, "tree")==0)
|
||||
xorriso->do_reassure= 2;
|
||||
else {
|
||||
sprintf(xorriso->info_text, "-reassure: unknown mode '%s'", mode);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
|
||||
return(0);
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
|
||||
@ -4606,12 +4628,14 @@ int Xorriso_option_rmi(struct XorrisO *xorriso, int argc, char **argv,
|
||||
return(ret);
|
||||
strcpy(path, eff_path);
|
||||
|
||||
ret= Xorriso_rmi(xorriso, path, flag&1);
|
||||
ret= Xorriso_rmi(xorriso, NULL, path, flag&1);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
sprintf(xorriso->info_text, "Removed from ISO image: %s '%s'\n",
|
||||
(ret>1 ? "subtree" : "file"), path);
|
||||
Xorriso_info(xorriso, 0);
|
||||
if(ret<3) {
|
||||
sprintf(xorriso->info_text, "Removed from ISO image: %s '%s'\n",
|
||||
(ret>1 ? "subtree" : "file"), path);
|
||||
Xorriso_info(xorriso, 0);
|
||||
}
|
||||
}
|
||||
ret= 1;
|
||||
ex:;
|
||||
@ -4754,7 +4778,7 @@ int Xorriso_option_tell_media_space(struct XorrisO *xorriso, int flag)
|
||||
"Pending image size larger than free space on media");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
|
||||
}
|
||||
sprintf(xorriso->result_line, "Write space : %d\n", media_space);
|
||||
sprintf(xorriso->result_line, "Media space : %d\n", media_space);
|
||||
Xorriso_result(xorriso, 0);
|
||||
sprintf(xorriso->result_line, "Free space : %d\n", free_space);
|
||||
Xorriso_result(xorriso, 0);
|
||||
@ -4883,7 +4907,7 @@ return:
|
||||
|
||||
next_command:;
|
||||
xorriso->prepended_wd= 0;
|
||||
xorriso->request_to_abort= 0;
|
||||
xorriso->request_to_abort= xorriso->request_not_to_ask= 0;
|
||||
Xorriso_set_problem_status(xorriso, "", 0);
|
||||
if((*idx)<argc)
|
||||
cmd= argv[*idx];
|
||||
|
Reference in New Issue
Block a user