From ca1a2e56e920ceb286dbd5880d9abfba89bcae10 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 27 Jun 2011 16:09:13 +0000 Subject: [PATCH] Bug fix: -update_r scheduled non-existing files for hardlink update --- libisoburn/trunk/xorriso/opts_p_z.c | 31 +++++++++++++------- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/libisoburn/trunk/xorriso/opts_p_z.c b/libisoburn/trunk/xorriso/opts_p_z.c index 8176aa7b..db389f6e 100644 --- a/libisoburn/trunk/xorriso/opts_p_z.c +++ b/libisoburn/trunk/xorriso/opts_p_z.c @@ -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); diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index b6199876..108b629e 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2011.06.18.173208" +#define Xorriso_timestamP "2011.06.27.160728"