workaround for not building on Linux version of Travis.

pull/497/head
dteviot 10 years ago
parent f6128a85b2
commit 931c95d0b1

@ -883,16 +883,23 @@ void MwIniImporter::setInputEncoding(const ToUTF8::FromType &encoding)
std::time_t MwIniImporter::lastWriteTime(const boost::filesystem::path& filename, std::time_t defaultTime) std::time_t MwIniImporter::lastWriteTime(const boost::filesystem::path& filename, std::time_t defaultTime)
{ {
std::time_t writeTime(defaultTime); std::time_t writeTime(defaultTime);
boost::filesystem::path resolved = boost::filesystem::canonical(filename); if (boost::filesystem::exists(filename))
if (boost::filesystem::exists(resolved))
{ {
// FixMe: remove #if when Boost on Travis Linux updated
// Travis seems to be using older version of boost for Linux
// This should allow things to build until fixed
#if BOOST_FILESYSTEM_VERSION == 3
boost::filesystem::path resolved = boost::filesystem::canonical(filename);
#else
boost::filesystem::path resolved = filename;
#endif
writeTime = boost::filesystem::last_write_time(resolved); writeTime = boost::filesystem::last_write_time(resolved);
std::cout << "content file: " << resolved << " timestamp = (" << writeTime << std::cout << "content file: " << resolved << " timestamp = (" << writeTime <<
") " << asctime(localtime(&writeTime)) << std::endl; ") " << asctime(localtime(&writeTime)) << std::endl;
} }
else else
{ {
std::cout << "content file: " << resolved << " not found" << std::endl; std::cout << "content file: " << filename << " not found" << std::endl;
} }
return writeTime; return writeTime;
} }
Loading…
Cancel
Save