# # # patch "file_io.cc" # from [1edaa600f491b3cddb7628be8f0ab5d218971815] # to [60011f929084283e969ee8a5b9d591d43edb86af] # # patch "file_io.hh" # from [a9c4eac0ba8fd78a612dc775dcef76424769e2be] # to [2c7717337282a9f47e587ae7095b07d11b602f9c] # # patch "work.cc" # from [9b78a7cb064436d0eed809eaa14c46b548b46096] # to [776774635a7ac315d0f22c8386145569e5813cdb] # ============================================================ --- file_io.cc 1edaa600f491b3cddb7628be8f0ab5d218971815 +++ file_io.cc 60011f929084283e969ee8a5b9d591d43edb86af @@ -556,7 +556,13 @@ ident_existing_file(file_path const & p, bool ident_existing_file(file_path const & p, file_id & ident) { - switch (get_path_status(p)) + return ident_existing_file(p, ident, get_path_status(p)); +} + +bool +ident_existing_file(file_path const & p, file_id & ident, path::status status) +{ + switch (status) { case path::nonexistent: return false; ============================================================ --- file_io.hh a9c4eac0ba8fd78a612dc775dcef76424769e2be +++ file_io.hh 2c7717337282a9f47e587ae7095b07d11b602f9c @@ -13,6 +13,7 @@ #include "vocab.hh" #include "paths.hh" #include "sanity.hh" +#include "platform.hh" // this layer deals with talking to the filesystem, loading and saving // files, walking trees, etc. @@ -116,6 +117,8 @@ bool ident_existing_file(file_path const bool ident_existing_file(file_path const & p, file_id & ident); +bool ident_existing_file(file_path const & p, file_id & ident, path::status status); + void calculate_ident(file_path const & file, hexenc & ident); ============================================================ --- work.cc 9b78a7cb064436d0eed809eaa14c46b548b46096 +++ work.cc 776774635a7ac315d0f22c8386145569e5813cdb @@ -1179,14 +1179,16 @@ workspace::update_current_roster_from_fi ros.get_name(nid, sp); file_path fp(sp); + const path::status status(get_path_status(fp)); + if (is_dir_t(node)) { - if (!path_exists(fp)) + if (status == path::nonexistent) { W(F("missing directory '%s'") % (fp)); missing_items++; } - else if (!directory_exists(fp)) + else if (status != path::directory) { W(F("not a directory '%s'") % (fp)); missing_items++; @@ -1199,19 +1201,19 @@ workspace::update_current_roster_from_fi if (inodeprint_unchanged(ipm, fp)) continue; - if (!path_exists(fp)) + if (status == path::nonexistent) { W(F("missing file '%s'") % (fp)); missing_items++; } - else if (!file_exists(fp)) + else if (status != path::file) { W(F("not a file '%s'") % (fp)); missing_items++; } file_t file = downcast_to_file_t(node); - ident_existing_file(fp, file->content); + ident_existing_file(fp, file->content, status); } }