# # # patch "ChangeLog" # from [cef599f53ec924444fa3b57f106bff8360be01a8] # to [2a9e5696c19bebec7c4ba7d2d02452eb5f75e44a] # # patch "inodeprint.cc" # from [dd5f47f5b2c42a9b9f681335ed293645abde5ace] # to [d09988264265346e90128dab3c9a549930a2b478] # ============================================================ --- ChangeLog cef599f53ec924444fa3b57f106bff8360be01a8 +++ ChangeLog 2a9e5696c19bebec7c4ba7d2d02452eb5f75e44a @@ -1,5 +1,13 @@ 2006-06-08 Matt Johnston
+ * inodeprint.cc: convert to basic_io format. + Silently skips reading old format files, then writes + out the new format as per usual. Old mtn versions + have no format checking so will read the (nonsensical) + new format file without errors. + +2006-06-08 Matt Johnston + * boost/format/feed_args.hpp: 0 needs to be unsigned. * vocab.cc: #undef EXTERN before #defining it again ============================================================ --- inodeprint.cc dd5f47f5b2c42a9b9f681335ed293645abde5ace +++ inodeprint.cc d09988264265346e90128dab3c9a549930a2b478 @@ -19,61 +19,83 @@ #include "sanity.hh" #include "platform.hh" #include "constants.hh" +#include "basic_io.hh" using std::ostream; using std::ostringstream; using std::string; // this file defines the inodeprint_map structure, and some operations on it. -// it is currently heavily based on the old manifest.cc. +namespace +{ + namespace syms + { + // roster symbols + symbol const format_version("format_version"); + symbol const file("file"); + symbol const print("print"); + } +} // reading inodeprint_maps void read_inodeprint_map(data const & dat, inodeprint_map & ipm) { - string::size_type pos = 0; - while (pos != dat().size()) + // don't bomb out if it's just an old-style inodeprints file + string start = dat().substr(0, syms::format_version().size()); + if (start != syms::format_version()) { - // whenever we get here, pos points to the beginning of a inodeprint - // line - // inodeprint file has 40 characters hash, then 2 characters space, then - // everything until next \n is filename. - string ident = dat().substr(pos, constants::idlen); - string::size_type file_name_begin = pos + constants::idlen + 2; - pos = dat().find('\n', file_name_begin); - string file_name; - if (pos == string::npos) - file_name = dat().substr(file_name_begin); - else - file_name = dat().substr(file_name_begin, pos - file_name_begin); - ipm.insert(inodeprint_entry(file_path_internal(file_name), - hexenc