changed = true;
}
+bool DependencyCache::has_deps(const string &tgt) const
+{
+ return deps.count(tgt);
+}
+
const StringList &DependencyCache::get_deps(const string &tgt) const
{
return get_item(deps, tgt);
void DependencyCache::save() const
{
- if(deps.empty() || !changed || package.get_builder().get_dry_run())
+ if(deps.empty() || !changed)
return;
- IO::BufferedFile out((package.get_source()/".deps").str(), IO::M_WRITE);
+ FS::Path fn = package.get_source_directory()/".deps";
+ package.get_builder().get_logger().log("files", format("Writing %s", fn));
+ IO::BufferedFile out(fn.str(), IO::M_WRITE);
for(DepsMap::const_iterator i=deps.begin(); i!=deps.end(); ++i)
{
void DependencyCache::load()
{
- string fn = (package.get_source()/".deps").str();
+ FS::Path fn = package.get_source_directory()/".deps";
if(FS::Stat st = FS::stat(fn))
{
- IO::BufferedFile in(fn);
+ package.get_builder().get_logger().log("files", format("Reading %s", fn));
+ IO::BufferedFile in(fn.str());
string line;
while(in.getline(line))