]> git.tdb.fi Git - builder.git/commitdiff
Re-stat FileTargets after a successful build
authorMikko Rasa <tdb@tdb.fi>
Tue, 17 Jul 2012 11:31:14 +0000 (14:31 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 17 Jul 2012 11:31:14 +0000 (14:31 +0300)
source/filetarget.cpp
source/filetarget.h

index 21c2bbf2019bc9fb64bbd80a2f48408d239400ea..7de9b797761717ce968649931e29ea6a32b8920c 100644 (file)
@@ -30,6 +30,11 @@ void FileTarget::init(const SourcePackage *p)
 
        builder.get_vfs().register_path(path, this);
 
+       stat();
+}
+
+void FileTarget::stat()
+{
        if(FS::Stat st = FS::lstat(path))
        {
                mtime = st.get_modify_time();
@@ -90,3 +95,11 @@ Task *FileTarget::build()
 
        return Target::build();
 }
+
+void FileTarget::build_finished(bool success)
+{
+       if(success)
+               stat();
+
+       Target::build_finished(success);
+}
index 2319066b05acbb6994cc2082365ad8fd06449091..30cd3df3ec3fae9486761e8cf403c8df582dc9ce 100644 (file)
@@ -20,6 +20,7 @@ protected:
        FileTarget(Builder &, const SourcePackage &, const Msp::FS::Path &);
 private:
        void init(const SourcePackage *);
+       void stat();
        static std::string generate_name(Builder &, const SourcePackage *, const Msp::FS::Path &);
 
 public:
@@ -40,6 +41,9 @@ protected:
 
 public:
        virtual Task *build();
+
+protected:
+       virtual void build_finished(bool);
 };
 
 #endif