Made -update_r and -compare_r obey disabling of -follow "mount"
This commit is contained in:
@ -2405,7 +2405,8 @@ struct FindjoB {
|
||||
16= not_in_iso
|
||||
17= update
|
||||
18= add_missing
|
||||
>>>19= empty_iso_dir
|
||||
19= empty_iso_dir
|
||||
20= is_full_in_iso
|
||||
*/
|
||||
int action;
|
||||
char *target;
|
||||
@ -6143,7 +6144,7 @@ int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job,
|
||||
action= 0;
|
||||
if(action<0)
|
||||
action= 0;
|
||||
if(action==15 || action==16 || action==18 || action==19) {
|
||||
if(action==15 || action==16 || action==18 || action==19 || action==20) {
|
||||
/* in_iso , not_in_iso, add_missing */
|
||||
Findjob_get_start_path(job, &disk_prefix, 0);
|
||||
if(strncmp(abs_path, disk_prefix, strlen(disk_prefix))!=0)
|
||||
@ -6197,6 +6198,23 @@ int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job,
|
||||
Text_shellsafe(iso_path, sfe, 0));
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0);
|
||||
}
|
||||
} else if(action==20) { /* is_full_in_iso */
|
||||
ret= Xorriso_iso_lstat(xorriso, iso_path, &stbuf, 0);
|
||||
if(ret==-1)
|
||||
return(1);
|
||||
if(!S_ISDIR(stbuf.st_mode))
|
||||
return(1);
|
||||
strcpy(sfe, xorriso->wdi);
|
||||
strcpy(xorriso->wdi, iso_path);
|
||||
ret= Xorriso_ls(xorriso, 4|8);
|
||||
strcpy(xorriso->wdi, sfe);
|
||||
if(ret>0) {
|
||||
sprintf(xorriso->result_line,
|
||||
"d %s (ISO) : non-empty directory (would not match mount point)\n",
|
||||
Text_shellsafe(iso_path, sfe, 0));
|
||||
Xorriso_result(xorriso,0);
|
||||
}
|
||||
return(1);
|
||||
} else {
|
||||
sprintf(xorriso->result_line, "%s\n", Text_shellsafe(show_path, sfe, 0));
|
||||
Xorriso_result(xorriso, 0);
|
||||
@ -7925,7 +7943,7 @@ int Xorriso_option_compare(struct XorrisO *xorriso, char *disk_path,
|
||||
{
|
||||
int ret, mem_pci, zero= 0, result, follow_links;
|
||||
double mem_lut= 0.0;
|
||||
char *ipth, *argv[4];
|
||||
char *ipth, *argv[6];
|
||||
|
||||
ipth= iso_path;
|
||||
if(ipth[0]==0)
|
||||
@ -7953,6 +7971,16 @@ int Xorriso_option_compare(struct XorrisO *xorriso, char *disk_path,
|
||||
argv[3]= ipth;
|
||||
zero= 0;
|
||||
ret= Xorriso_option_find(xorriso, 4, argv, &zero, 1|2); /* -findx */
|
||||
if(ret>0 && !xorriso->do_follow_mount) {
|
||||
argv[0]= disk_path;
|
||||
argv[1]= "-type";
|
||||
argv[2]= "m";
|
||||
argv[3]= "-exec";
|
||||
argv[4]= "is_full_in_iso";
|
||||
argv[5]= ipth;
|
||||
zero= 0;
|
||||
ret= Xorriso_option_find(xorriso, 6, argv, &zero, 1|2); /* -findx */
|
||||
}
|
||||
if(ret>0)
|
||||
ret= xorriso->find_compare_result;
|
||||
else
|
||||
@ -8561,7 +8589,8 @@ not_enough_arguments:;
|
||||
} else if(strcmp(cpt, "in_iso")==0 ||
|
||||
strcmp(cpt, "not_in_iso")==0 ||
|
||||
strcmp(cpt, "add_missing")==0 ||
|
||||
strcmp(cpt, "empty_iso_dir")==0) {
|
||||
strcmp(cpt, "empty_iso_dir")==0 ||
|
||||
strcmp(cpt, "is_full_in_iso")==0) {
|
||||
if(i+1>=end_idx)
|
||||
goto not_enough_arguments;
|
||||
i++;
|
||||
@ -8575,6 +8604,8 @@ not_enough_arguments:;
|
||||
action= 18;
|
||||
else if(strcmp(cpt, "empty_iso_dir")==0)
|
||||
action= 19;
|
||||
else if(strcmp(cpt, "is_full_in_iso")==0)
|
||||
action= 20;
|
||||
else
|
||||
action= 16;
|
||||
Findjob_set_action_target(job, action, other_path_start, 0);
|
||||
@ -10046,7 +10077,7 @@ int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path,
|
||||
{
|
||||
int ret, mem_pci, zero= 0, result, uret, follow_links;
|
||||
double mem_lut= 0.0, start_time;
|
||||
char *ipth, *argv[4];
|
||||
char *ipth, *argv[6];
|
||||
struct stat stbuf;
|
||||
|
||||
start_time= Sfile_microtime(0);
|
||||
@ -10083,6 +10114,16 @@ int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path,
|
||||
argv[3]= ipth;
|
||||
zero= 0;
|
||||
ret= Xorriso_option_find(xorriso, 4, argv, &zero, 1|2); /* -findx */
|
||||
if(ret>0 && !xorriso->do_follow_mount) {
|
||||
argv[0]= disk_path;
|
||||
argv[1]= "-type";
|
||||
argv[2]= "m";
|
||||
argv[3]= "-exec";
|
||||
argv[4]= "empty_iso_dir";
|
||||
argv[5]= ipth;
|
||||
zero= 0;
|
||||
ret= Xorriso_option_find(xorriso, 6, argv, &zero, 1|2); /* -findx */
|
||||
}
|
||||
if(ret>0)
|
||||
ret= xorriso->find_compare_result;
|
||||
else
|
||||
|
Reference in New Issue
Block a user