#include <msp/fs/dir.h>
+#include <msp/fs/stat.h>
#include <msp/fs/utils.h>
#include <msp/strings/format.h>
#include <msp/strings/regex.h>
FileTarget(b, c.get_package(), p)
{
component = &c;
+
+ if(FS::Stat st = FS::lstat(FS::dirname(path)))
+ dir_mtime = st.get_modify_time();
}
void DataTransform::find_dependencies()
{
list<string> files;
Cache &cache = component->get_package().get_cache();
- // XXX Should check directory mtime as well
- if(mtime<cache.get_mtime() && cache.has_key(this, "files"))
+ const Time::TimeStamp &cache_mtime = cache.get_mtime();
+ if(mtime<cache_mtime && dir_mtime<cache_mtime && cache.has_key(this, "files"))
files = cache.get_values(this, "files");
else
{
class DataTransform: public FileTarget
{
+private:
+ Msp::Time::TimeStamp dir_mtime;
+
public:
DataTransform(Builder &, const Component &, const Msp::FS::Path &);