]> git.tdb.fi Git - builder.git/commitdiff
Add a convenience function for saving caches in PackageManager
authorMikko Rasa <tdb@tdb.fi>
Tue, 7 May 2013 18:43:11 +0000 (21:43 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 7 May 2013 18:43:11 +0000 (21:43 +0300)
source/buildercli.cpp
source/packagemanager.cpp
source/packagemanager.h

index c470f047f6a930653f2d3ddb63dd0b86d3f8eef5..629231814a0012a152a0222b29800dd4765b267c 100644 (file)
@@ -315,11 +315,7 @@ bool BuilderCLI::prepare_build()
                build_graph.force_full_rebuild();
 
        if(!dry_run)
-       {
-               const PackageManager::PackageMap &packages = package_manager.get_packages();
-               for(PackageManager::PackageMap::const_iterator i=packages.begin(); i!=packages.end(); ++i)
-                       i->second->save_caches();
-       }
+               package_manager.save_all_caches();
 
        return true;
 }
index f840ea22d4edb929624097f3c47fad0a896bf1ae..0e2d8a0f578805c4fc0427cc3d87a5433658a16d 100644 (file)
@@ -244,3 +244,9 @@ FS::Path PackageManager::get_binary_package_file(const string &name)
 
        return FS::Path();
 }
+
+void PackageManager::save_all_caches() const
+{
+       for(PackageMap::const_iterator i=packages.begin(); i!=packages.end(); ++i)
+               i->second->save_caches();
+}
index 9b4f3476d7a2ae821650bdd5118434d1a0546d10..b168d723e174739c3c652f376f7f1cefe407cda2 100644 (file)
@@ -71,6 +71,9 @@ private:
        /** Determines the file containing a binary package.  The file is expected
        to be named after the package. */
        Msp::FS::Path get_binary_package_file(const std::string &);
+
+public:
+       void save_all_caches() const;
 };
 
 #endif