]> git.tdb.fi Git - builder.git/blobdiff - source/dependencycache.cpp
Adjust to library changes
[builder.git] / source / dependencycache.cpp
index b2ba4e8ce953e9b92bd41d4c66443bf24c749237..7505e9889a15154b35a05313f8ed13b7e8db0e13 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of builder
-Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2009  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -22,25 +22,21 @@ DependencyCache::DependencyCache(SourcePackage &p):
        changed(false)
 { }
 
+void DependencyCache::set_deps(const string &tgt, const StringList &d)
+{
+       deps[tgt] = d;
+       changed = true;
+}
+
 const StringList &DependencyCache::get_deps(const string &tgt) const
 {
-       DepsMap::const_iterator i=deps.find(tgt);
+       DepsMap::const_iterator i = deps.find(tgt);
        if(i==deps.end())
                throw KeyError("Unknown dependencies", tgt);
 
        return i->second;
 }
 
-void DependencyCache::set_deps(const string &tgt, const StringList &d)
-{
-       deps[tgt]=d;
-       changed=true;
-}
-
-/**
-Saves the depencency cache.  If there are no cached dependencies or they
-haven't been changed, does nothing.
-*/
 void DependencyCache::save() const
 {
        if(deps.empty() || !changed || package.get_builder().get_dry_run())
@@ -59,7 +55,7 @@ void DependencyCache::save() const
 
 void DependencyCache::load()
 {
-       string fn=(package.get_source()/".deps").str();
+       string fn = (package.get_source()/".deps").str();
 
        try
        {
@@ -68,12 +64,12 @@ void DependencyCache::load()
                string line;
                while(in.getline(line))
                {
-                       vector<string> parts=split(line, '|');
-                       deps[parts[0]]=StringList(parts.begin()+1, parts.end());
+                       vector<string> parts = split(line, '|');
+                       deps[parts[0]] = StringList(parts.begin()+1, parts.end());
                }
 
-               mtime=Time::TimeStamp::from_unixtime(FS::stat(fn).st_mtime);
+               mtime = Time::TimeStamp::from_unixtime(FS::stat(fn).st_mtime);
        }
-       catch(const IO::FileNotFound &)
+       catch(const IO::file_not_found &)
        { }
 }