Improved messages at the end of partially failed -extract runs

This commit is contained in:
Thomas Schmitt 2010-11-30 10:47:30 +00:00
parent 692a675329
commit 07c2bb8421
6 changed files with 25 additions and 14 deletions

View File

@ -1347,10 +1347,12 @@ ex:;
bit5= -extract_single: eventually do not insert directory tree
*/
int Xorriso_restore_sorted(struct XorrisO *xorriso, int count,
char **src_array, char **tgt_array, int flag)
char **src_array, char **tgt_array,
int *problem_count, int flag)
{
int i, ret, with_node_array= 0, hflag= 0, hret;
*problem_count= 0;
if(!(((xorriso->ino_behavior & 16) && xorriso->do_restore_sort_lba) ||
(xorriso->ino_behavior & 4) || (flag & 1))) {
ret= Xorriso_make_hln_array(xorriso, 0);
@ -1370,8 +1372,9 @@ int Xorriso_restore_sorted(struct XorrisO *xorriso, int count,
ret= Xorriso_restore(xorriso, src_array[i], tgt_array[i],
(off_t) 0, (off_t) 0, hflag);
if(ret <= 0) {
(*problem_count)++;
hret= Xorriso_eval_problem_status(xorriso, ret, 0);
if(ret < 0)
if(hret < 0)
goto ex;
}
with_node_array= 1;
@ -1392,8 +1395,9 @@ int Xorriso_restore_sorted(struct XorrisO *xorriso, int count,
ret= Xorriso_restore(xorriso, src_array[i], tgt_array[i],
(off_t) 0, (off_t) 0, 2 << 7);
if(ret <= 0) {
(*problem_count)++;
hret= Xorriso_eval_problem_status(xorriso, ret, 0);
if(ret < 0)
if(hret < 0)
goto ex;
}
}
@ -1411,6 +1415,7 @@ int Xorriso_restore_sorted(struct XorrisO *xorriso, int count,
ret= Xorriso_restore(xorriso, src_array[i], tgt_array[i],
(off_t) 0, (off_t) 0, 0);
if(ret <= 0) {
(*problem_count)++;
hret= Xorriso_eval_problem_status(xorriso, ret, flag & 32);
if(ret < 0)
goto ex;

View File

@ -69,7 +69,8 @@ int Xorriso_findx(struct XorrisO *xorriso, struct FindjoB *job,
bit5= -extract_single: eventually do not insert directory tree
*/
int Xorriso_restore_sorted(struct XorrisO *xorriso, int count,
char **src_array, char **tgt_array, int flag);
char **src_array, char **tgt_array,
int *problem_count, int flag);
/* @param flag bit0= path is a directory
bit2= recursion: do not reassure in mode 2 "tree"

View File

@ -1945,7 +1945,7 @@ ex:;
int Xorriso_option_cpx(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag)
{
int i, ret, is_dir= 0, was_failure= 0, fret, end_idx_dummy;
int i, ret, is_dir= 0, was_failure= 0, fret, end_idx_dummy, problem_count;
char eff_origin[SfileadrL], eff_dest[SfileadrL];
char dest_dir[SfileadrL], leafname[SfileadrL], sfe[5*SfileadrL];
char **eff_src_array= NULL, **eff_tgt_array= NULL;
@ -2048,8 +2048,9 @@ problem_handler:;
}
if(eff_src_array != NULL) {
ret= Xorriso_restore_sorted(xorriso, optc, eff_src_array, eff_tgt_array, 0);
if(ret <= 0)
ret= Xorriso_restore_sorted(xorriso, optc, eff_src_array, eff_tgt_array,
&problem_count, 0);
if(ret <= 0 || problem_count > 0)
was_failure= 1;
}
if(xorriso->pacifier_count>0)

View File

@ -486,7 +486,7 @@ int Xorriso_option_external_filter(struct XorrisO *xorriso,
int Xorriso_option_extract(struct XorrisO *xorriso, char *iso_path,
char *disk_path, int flag)
{
int ret;
int ret, problem_count;
char eff_origin[SfileadrL], eff_dest[SfileadrL], *ipth, *eopt[1], *edpt[1];
if(xorriso->allow_restore <= 0) {
@ -516,12 +516,13 @@ int Xorriso_option_extract(struct XorrisO *xorriso, char *iso_path,
eopt[0]= eff_origin;
edpt[0]= eff_dest;
ret= Xorriso_restore_sorted(xorriso, 1, eopt, edpt, (flag & 32 ? 33 : 0));
ret= Xorriso_restore_sorted(xorriso, 1, eopt, edpt, &problem_count,
(flag & 32 ? 33 : 0));
if(!(flag&2))
Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count,
xorriso->pacifier_total, "", 1|4);
if(ret<=0)
if(ret <= 0 || problem_count > 0)
goto ex;
if(!(flag&1)) {
@ -1346,7 +1347,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -load \"session\"|\"track\"|\"lba\"|\"sbsector\"|\"volid\"|\"auto\" id",
" Load a particular (outdated) ISO image from a -dev or",
" -indev which hosts more than one session.",
" -displacement [-]lba",
" -displacement [-]block_address",
" When loading ISO tree or reading data files compensate a",
" displacement versus the start address for which the image",
" was prepared.",

View File

@ -451,7 +451,7 @@ int Xorriso_option_map(struct XorrisO *xorriso, char *disk_path,
int Xorriso_option_map_l(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag)
{
int ret, end_idx, optc= 0, was_failure= 1, i, fret, mode;
int ret, end_idx, optc= 0, was_failure= 1, i, fret, mode, problem_count;
int ns_flag= 2|4, nt_flag= 2, opt_args_flag= 2, made_di_array= 0;
char source_prefix[SfileadrL], target_prefix[SfileadrL], *cmd, **optv= NULL;
char eff_source[SfileadrL], eff_target[SfileadrL], *source_pt, *s_wd, *t_wd;
@ -576,7 +576,10 @@ int Xorriso_option_map_l(struct XorrisO *xorriso, int argc, char **argv,
source_prefix, strlen(source_prefix) + 1, 0);
if(ret <= 0)
goto ex;
ret= Xorriso_restore_sorted(xorriso, optc, eff_src_array, eff_tgt_array, 0);
ret= Xorriso_restore_sorted(xorriso, optc, eff_src_array, eff_tgt_array,
&problem_count, 0);
if(ret <= 0 || problem_count > 0)
was_failure= 1;
}
if(mode==0)
Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count,

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.11.30.094310"
#define Xorriso_timestamP "2010.11.30.104719"