using support::FileName;
using support::ltrim;
-using support::makeAbsPath;
using support::onlyFilename;
using support::suffixIs;
using support::sum;
dep_info di;
di.crc_prev = 0;
if (upd) {
- lyxerr[Debug::DEPEND] << " CRC..." << flush;
+ LYXERR(Debug::DEPEND) << " CRC..." << flush;
di.crc_cur = sum(f);
- lyxerr[Debug::DEPEND] << "done." << endl;
+ LYXERR(Debug::DEPEND) << "done." << endl;
struct stat f_info;
stat(f.toFilesystemEncoding().c_str(), &f_info);
di.mtime_cur = f_info.st_mtime;
}
deplist[f] = di;
} else {
- lyxerr[Debug::DEPEND] << " Already in DepTable" << endl;
+ LYXERR(Debug::DEPEND) << " Already in DepTable" << endl;
}
}
void DepTable::update()
{
- lyxerr[Debug::DEPEND] << "Updating DepTable..." << endl;
+ LYXERR(Debug::DEPEND) << "Updating DepTable..." << endl;
time_type const start_time = current_time();
DepList::iterator itr = deplist.begin();
if (stat(itr->first.toFilesystemEncoding().c_str(), &f_info) == 0) {
if (di.mtime_cur == f_info.st_mtime) {
di.crc_prev = di.crc_cur;
- lyxerr[Debug::DEPEND] << itr->first << " same mtime" << endl;
+ LYXERR(Debug::DEPEND) << itr->first << " same mtime" << endl;
} else {
di.crc_prev = di.crc_cur;
- lyxerr[Debug::DEPEND] << itr->first << " CRC... " << flush;
+ LYXERR(Debug::DEPEND) << itr->first << " CRC... " << flush;
di.crc_cur = sum(itr->first);
- lyxerr[Debug::DEPEND] << "done" << endl;
+ LYXERR(Debug::DEPEND) << "done" << endl;
}
} else {
// file doesn't exist
// remove stale files - if it's re-created, it
// will be re-inserted by deplog.
- lyxerr[Debug::DEPEND] << itr->first
+ LYXERR(Debug::DEPEND) << itr->first
<< " doesn't exist. removing from DepTable." << endl;
DepList::iterator doomed = itr++;
deplist.erase(doomed);
++itr;
}
time_type const time_sec = current_time() - start_time;
- lyxerr[Debug::DEPEND] << "Finished updating DepTable ("
+ LYXERR(Debug::DEPEND) << "Finished updating DepTable ("
<< time_sec << " sec)." << endl;
}
DepList::const_iterator cit = deplist.begin();
DepList::const_iterator end = deplist.end();
for (; cit != end; ++cit) {
- if (lyxerr.debugging(Debug::DEPEND)) {
- // Store the second (most recently calculated)
- // CRC value.
- // The older one is effectively set to 0 upon re-load.
- lyxerr << "Write dep: "
- << cit->second.crc_cur << ' '
- << cit->second.mtime_cur << ' '
- << cit->first << endl;
- }
+ // Store the second (most recently calculated)
+ // CRC value.
+ // The older one is effectively set to 0 upon re-load.
+ LYXERR(Debug::DEPEND) << "Write dep: "
+ << cit->second.crc_cur << ' '
+ << cit->second.mtime_cur << ' '
+ << cit->first << endl;
+
ofs << cit->second.crc_cur << ' '
<< cit->second.mtime_cur << ' '
<< cit->first << endl;
while (ifs >> di.crc_cur >> di.mtime_cur && getline(ifs, nome)) {
nome = ltrim(nome);
- if (lyxerr.debugging(Debug::DEPEND)) {
- lyxerr << "Read dep: "
- << di.crc_cur << ' '
- << di.mtime_cur << ' '
- << nome << endl;
- }
+
+ LYXERR(Debug::DEPEND) << "Read dep: "
+ << di.crc_cur << ' ' << di.mtime_cur << ' ' << nome << endl;
+
deplist[FileName(nome)] = di;
}
return deplist.size();