#ifdef USE_PCH #include "pch.h" #else #include #include #include #include using namespace std; #include "sitecing/file_factory.h" #endif namespace sitecing { bool file_factory::is_uptodate(const string& dst,file_list_t* deps) { file_list_t deplist; file_list_t *fl = deps?deps:&deplist; get_dependencies(dst,*fl); struct stat stdst; if(stat(dst.c_str(),&stdst)) return false; for(file_list_t::const_iterator i=fl->begin();i!=fl->end();++i) { struct stat stdep; if(stat(i->c_str(),&stdep)) return false; if(stdst.st_mtime25) throw konforka::exception(CODEPOINT,"recursed too deeply."); file_list_t deps; if(!is_uptodate(dst,&deps)) { for(file_list_t::const_iterator i=deps.begin();i!=deps.end();i++) make(*i); if(!is_uptodate(dst,&deps)) build(dst); } depth--; }catch(konforka::exception& ke) { depth--; ke.see(CODEPOINT); throw; }catch(...) { depth--; throw; } } }