-/* $Id$
-
-This file is part of builder
-Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#include <msp/core/maputils.h>
#include <msp/fs/stat.h>
#include <msp/io/file.h>
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);
{
string fn = (package.get_source()/".deps").str();
- try
+ if(FS::Stat st = FS::stat(fn))
{
IO::BufferedFile in(fn);
deps[parts[0]] = StringList(parts.begin()+1, parts.end());
}
- mtime = FS::stat(fn).get_modify_time();
+ mtime = st.get_modify_time();
}
- catch(const IO::file_not_found &)
- { }
}