# # # patch "ChangeLog" # from [264e0eb46ff52904bf2376e0a671fb1145b977f5] # to [1d874fef55c9d221bc0314fd736292ee06b048be] # # patch "work.cc" # from [dae8df9b29388a8c016ac5c421c79decf8572247] # to [d8abf8091373fda63af5b8e6343d0ab7bb0a2603] # ============================================================ --- ChangeLog 264e0eb46ff52904bf2376e0a671fb1145b977f5 +++ ChangeLog 1d874fef55c9d221bc0314fd736292ee06b048be @@ -1,3 +1,10 @@ +2007-01-03 Thomas Keller + + * work.cc: classify_roster_paths: if the inodeprints cache + is enabled, unchanged and missing files are now handled + properly for use in automate inventory (before any unchanged + file was wrongly determined as missing) + 2007-01-02 Thomas Moschny * std_hooks.lua (get_netsync_connect_command): Fix a typo. ============================================================ --- work.cc dae8df9b29388a8c016ac5c421c79decf8572247 +++ work.cc d8abf8091373fda63af5b8e6343d0ab7bb0a2603 @@ -899,30 +899,39 @@ workspace::classify_roster_paths(roster_ file_path fp(sp); - if (is_dir_t(node) || inodeprint_unchanged(ipm, fp)) + // if this node is a file, check the inodeprint cache for changes + if (!is_dir_t(node) && inodeprint_unchanged(ipm, fp)) { - // dirs don't have content changes + unchanged.insert(sp); + continue; + } + + // if the node is a directory, check if it exists + // directories do not have content changes, thus are inserted in the + // unchanged set + if (is_dir_t(node)) + { if (directory_exists(fp)) unchanged.insert(sp); else missing.insert(sp); + continue; } - else + + // the node is a file, check if it exists and has been changed + file_t file = downcast_to_file_t(node); + file_id fid; + if (ident_existing_file(fp, fid, lua)) { - file_t file = downcast_to_file_t(node); - file_id fid; - if (ident_existing_file(fp, fid, lua)) - { - if (file->content == fid) - unchanged.insert(sp); - else - changed.insert(sp); - } + if (file->content == fid) + unchanged.insert(sp); else - { - missing.insert(sp); - } + changed.insert(sp); } + else + { + missing.insert(sp); + } } }