]> git.tdb.fi Git - builder.git/commitdiff
More reporting about reading and writing files and traversing directories
authorMikko Rasa <tdb@tdb.fi>
Sun, 15 Jul 2012 19:27:11 +0000 (22:27 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 15 Jul 2012 19:27:11 +0000 (22:27 +0300)
source/component.cpp
source/config.cpp
source/dependencycache.cpp
source/packagemanager.cpp

index 9262af3320c97245318351acf01fbdf177285fe5..93d450b4a47372297e6da6c797006837b4c4e277 100644 (file)
@@ -223,6 +223,7 @@ PathList Component::collect_source_files() const
                FS::Path path(*i);
                if(FS::is_dir(path))
                {
+                       pkg.get_builder().get_logger().log("files", format("Traversing %s", path));
                        list<string> sfiles = list_files(path);
                        for(list<string>::iterator j=sfiles.begin(); j!=sfiles.end(); ++j)
                                files.push_back(path / *j);
index 194bf0d184f7a2922ee2c172fc49ec480fe7f7d0..5b43fe3e68e01aef7521f56610e2b98b134ce289 100644 (file)
@@ -62,6 +62,7 @@ void Config::save() const
 
        FS::Path fn = package.get_source()/".config";
 
+       package.get_builder().get_logger().log("files", format("Writing %s", fn));
        IO::BufferedFile out(fn.str(), IO::M_WRITE);
 
        for(OptionMap::const_iterator i=options.begin(); i!=options.end(); ++i)
@@ -90,6 +91,7 @@ void Config::load()
        FS::Stat stat = FS::stat(fn);
        if(stat)
        {
+               package.get_builder().get_logger().log("files", format("Reading %s", fn));
                IO::BufferedFile in(fn.str());
 
                mtime = stat.get_modify_time();
index 15abf0858b054f7df80563f887dc63c54a344679..e91bdbc91da0e0e8f59c5ec3cf4b010b8b41a793 100644 (file)
@@ -36,7 +36,9 @@ void DependencyCache::save() const
        if(deps.empty() || !changed)
                return;
 
-       IO::BufferedFile out((package.get_source()/".deps").str(), IO::M_WRITE);
+       FS::Path fn = package.get_source()/".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)
        {
@@ -49,11 +51,12 @@ void DependencyCache::save() const
 
 void DependencyCache::load()
 {
-       string fn = (package.get_source()/".deps").str();
+       FS::Path fn = package.get_source()/".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))
index 5cc768a648c6d607507342cf977b2879191bd416..01c9e09c1959de54b6408fcd71e46cbce173c7fa 100644 (file)
@@ -123,6 +123,7 @@ FS::Path PackageManager::get_package_location(const string &name)
        {
                for(list<FS::Path>::const_iterator i=pkg_path.begin(); i!=pkg_path.end(); ++i)
                {
+                       builder.get_logger().log("files", format("Traversing %s", *i));
                        list<string> files = list_files(*i);
                        for(list<string>::const_iterator j=files.begin(); j!=files.end(); ++j)
                        {