Bug fix: -update_r scheduled non-existing files for hardlink update

This commit is contained in:
Thomas Schmitt 2011-06-27 16:09:13 +00:00
parent cb3a532165
commit 966ffe7e66
2 changed files with 21 additions and 12 deletions

View File

@ -1470,7 +1470,7 @@ int Xorriso_option_uid(struct XorrisO *xorriso, char *uid, int flag)
int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path,
char *iso_path, int flag)
{
int ret, mem_pci, zero= 0, result, uret, follow_links, do_register= 1;
int ret, mem_pci, zero= 0, result, uret, follow_links, do_register= 0;
int not_in_iso= 0, not_on_disk= 0, made_di_array= 0;
double mem_lut= 0.0, start_time;
char *ipth, *argv[6];
@ -1530,6 +1530,7 @@ int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path,
goto ex;
}
if(xorriso->di_array != NULL) {
do_register= 1;
if(!(flag & 8)) {
/* If directory with -update : do not register di_*_paths */
ret= lstat(eff_origin, &stbuf);
@ -1537,16 +1538,6 @@ int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path,
if(S_ISDIR(stbuf.st_mode))
do_register= 0;
}
if(do_register) {
ret= Xorriso_lst_new(&(xorriso->di_disk_paths), eff_origin,
xorriso->di_disk_paths, 1);
if(ret <= 0)
goto ex;
ret= Xorriso_lst_new(&(xorriso->di_iso_paths), eff_dest,
xorriso->di_iso_paths, 1);
if(ret <= 0)
goto ex;
}
}
}
@ -1643,11 +1634,29 @@ report_outcome:;
if(ret>0) {
sprintf(xorriso->info_text,
"No file object needed update.");
do_register= 0;
} else if(ret==0) {
sprintf(xorriso->info_text, "Differences detected and updated.");
} else {
sprintf(xorriso->info_text,
"Not ok. Comparison or update failed due to error.");
do_register= 0;
}
if(do_register) {
ret= Xorriso_iso_lstat(xorriso, eff_dest, &stbuf, 0);
if(ret < 0)
do_register= 0;
}
if(do_register) {
ret= Xorriso_lst_new(&(xorriso->di_disk_paths), eff_origin,
xorriso->di_disk_paths, 1);
if(ret <= 0)
goto ex;
ret= Xorriso_lst_new(&(xorriso->di_iso_paths), eff_dest,
xorriso->di_iso_paths, 1);
if(ret <= 0)
goto ex;
}
sprintf(xorriso->info_text+strlen(xorriso->info_text),
" (runtime %.1f s)\n", Sfile_microtime(0)-start_time);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.06.18.173208"
#define Xorriso_timestamP "2011.06.27.160728"