Working towards coordination of -compare, -update and -cut_out

This commit is contained in:
2008-03-25 17:07:58 +00:00
parent 887fdfba2e
commit c0cb462641
5 changed files with 391 additions and 71 deletions

View File

@ -1829,7 +1829,7 @@ int Xorriso_copy_implict_properties(struct XorrisO *xorriso, IsoDir *dir,
"Copied properties for %s", Text_shellsafe(ni, sfe, 0));
sprintf(xorriso->info_text+strlen(xorriso->info_text),
" from %s", Text_shellsafe(nfd, sfe, 0));
if((flag&1) && d==0)
if(!((flag&1) && d==0))
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
return(1);
}
@ -4846,11 +4846,12 @@ int Xorriso_iso_file_close(struct XorrisO *xorriso, void **stream, int flag)
int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr,
struct SplitparT **parts, int *count, int flag)
struct SplitparT **parts, int *count,
struct stat *total_stbuf, int flag)
{
int ret, i;
int partno, total_parts, first_total_parts= -1;
off_t offset, bytes, total_bytes, first_total_bytes= -1;
off_t offset, bytes, total_bytes, first_total_bytes= -1, size;
IsoImage *volume;
IsoDir *dir_node;
IsoDirIter *iter= NULL;
@ -4878,7 +4879,7 @@ cannot_iter:;
return(-1);
}
for(i= 0; iso_dir_iter_next(iter, &node) == 1; ) {
for(i= 0; iso_dir_iter_next(iter, &node) == 1; i++) {
name= (char *) iso_node_get_name(node);
ret= Splitpart__parse(name, &partno, &total_parts,
&offset, &bytes, &total_bytes, 0);
@ -4888,6 +4889,7 @@ cannot_iter:;
first_total_parts= total_parts;
first_total_bytes= total_bytes;
Xorriso_fake_stbuf(xorriso, "", &first_stbuf, &node, 1);
size= first_stbuf.st_size;
} else {
if(first_total_parts!=total_parts || first_total_bytes!=total_bytes)
{ret= 0; goto ex;}
@ -4899,7 +4901,12 @@ cannot_iter:;
first_stbuf.st_ctime != stbuf.st_ctime ||
first_stbuf.st_atime != stbuf.st_atime)
{ret= 0; goto ex;}
size= stbuf.st_size;
}
/* check for plausible size */
if(!((partno<total_parts && size==bytes) ||
(partno==total_parts && size==(total_bytes-offset) && size<=bytes)))
{ret= 0; goto ex;}
(*count)++;
}
if((*count)<=0)
@ -4914,20 +4921,27 @@ cannot_iter:;
if(ret<0)
goto cannot_iter;
for(i= 0; i<*count; i++) {
ret= iso_dir_iter_next(iter, &node);
if(ret!=1)
break;
name= (char *) iso_node_get_name(node);
ret= Splitpart__parse(name, &partno, &total_parts,
&offset, &bytes, &total_bytes, 0);
if(ret<=0)
{ret= 0; goto ex;}
Splitpart_set(parts[i], name, partno, total_parts, offset, bytes,
total_bytes, 0);
ret= Splitparts_set(*parts, i, name, partno, total_parts, offset, bytes,
total_bytes, 0);
if(ret<=0)
goto ex;
}
/* >>> ??? sort list ? */
/* >>> check for equal frequency */;
/* >>> check for disjointness */
/* >>> check for plausible size */
for(i= 0; i<*count; i++) {
/* >>> check for disjointness */;
}
memcpy(total_stbuf, &first_stbuf, sizeof(struct stat));
total_stbuf->st_size= total_bytes;
ret= 1;
ex:;
if(iter!=NULL)