New -find actions update_merge, rm_merge, clear_merge. -cp_clone now merges.

This commit is contained in:
2011-02-12 17:14:23 +00:00
parent 2c37215969
commit 7f01cfd5dc
18 changed files with 435 additions and 116 deletions

View File

@ -1361,6 +1361,9 @@ int Xorriso_option_uid(struct XorrisO *xorriso, char *uid, int flag)
bit2= do not issue pacifier messages at all
bit3= recursive: -update_r
bit4= do not establish and dispose xorriso->di_array
bit5= do not delete files which are not found under
disk_path, but rather mark visited files and mark
files which were found.
*/
int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path,
char *iso_path, int flag)
@ -1447,7 +1450,10 @@ int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path,
if(ret >= 0) {
argv[0]= eff_dest;
argv[1]= "-exec";
argv[2]= "update";
if(flag & 32)
argv[2]= "update_merge";
else
argv[2]= "update";
argv[3]= eff_origin;
zero= 0;
ret= Xorriso_option_find(xorriso, 4, argv, &zero,
@ -1468,7 +1474,18 @@ int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path,
argv[3]= eff_dest;
zero= 0;
ret= Xorriso_option_find(xorriso, 4, argv, &zero, 1|2); /* -findx */
if(ret>0 && !xorriso->do_follow_mount) {
if(ret>0 && (!xorriso->do_follow_mount) && !(flag & 32)) {
/* >>> ??? what about mount points with (flag & 32) ?
empty_iso_dir shall delete those which already existed
and are freshly excluded. (E.g. by mounting at a non-empty
directory, or by new follow rules.)
This deletion does not match the idea of merging.
For determining the foreign files in a directory which is
target of a mount point, one would have to enter that mount
point directory. Somewhat contrary to do-not-follow.
*/
argv[0]= eff_origin;
argv[1]= "-type";
argv[2]= "m";
@ -1495,13 +1512,17 @@ int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path,
ret= -1;
}
} else {
if(flag & 32)
xorriso->update_flags|= 1; /* Enter update_merge mode for node adding */
/* compare ctime too, no filename reporting, eventually silent */
follow_links= (xorriso->do_follow_links || xorriso->do_follow_param) <<28;
ret= Xorriso_compare_2_files(xorriso, eff_origin, eff_dest, "", &result,
2 | follow_links | ((flag&4)<<27) | (3<<30));
if(ret==0) {
uret= Xorriso_update_interpreter(xorriso, NULL, result, eff_origin,
eff_dest, 0);
if(ret == 0 || (ret > 0 && (flag & 32))) {
if(ret > 0)
result= 0;
uret= Xorriso_update_interpreter(xorriso, NULL, NULL, result, eff_origin,
eff_dest, (!!(flag & 32)) << 1);
if(uret<=0)
ret= -1;
if(uret==3)