X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdependencycache.cpp;h=8582e583a7ad1d3bcf01c7750a9f7138c881153e;hb=8932cbfa8cdb0b9edf9894bd4c56980dab0a2f4b;hp=08d8af7538630f69cf1873672eed289b3a9d8d8e;hpb=242c55b17e6608b29a77ca17a5b677e202a3ca90;p=builder.git diff --git a/source/dependencycache.cpp b/source/dependencycache.cpp index 08d8af7..8582e58 100644 --- a/source/dependencycache.cpp +++ b/source/dependencycache.cpp @@ -1,12 +1,5 @@ -/* $Id$ - -This file is part of builder -Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - +#include #include -#include #include #include #include @@ -24,17 +17,13 @@ DependencyCache::DependencyCache(SourcePackage &p): void DependencyCache::set_deps(const string &tgt, const StringList &d) { - deps[tgt]=d; - changed=true; + deps[tgt] = d; + changed = true; } const StringList &DependencyCache::get_deps(const string &tgt) const { - DepsMap::const_iterator i=deps.find(tgt); - if(i==deps.end()) - throw KeyError("Unknown dependencies", tgt); - - return i->second; + return get_item(deps, tgt); } void DependencyCache::save() const @@ -55,7 +44,7 @@ void DependencyCache::save() const void DependencyCache::load() { - string fn=(package.get_source()/".deps").str(); + string fn = (package.get_source()/".deps").str(); try { @@ -64,12 +53,12 @@ void DependencyCache::load() string line; while(in.getline(line)) { - vector parts=split(line, '|'); - deps[parts[0]]=StringList(parts.begin()+1, parts.end()); + vector parts = split(line, '|'); + deps[parts[0]] = StringList(parts.begin()+1, parts.end()); } - mtime=Time::TimeStamp::from_unixtime(FS::stat(fn).st_mtime); + mtime = FS::stat(fn).get_modify_time(); } - catch(const IO::FileNotFound &) + catch(const IO::file_not_found &) { } }