X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdependencycache.cpp;h=11b200d9983a1ae20056495e101a5f35fe8e2e25;hb=ca18323d45d67243773b03668e79c715aa976441;hp=f691d540190f65da3444ec97823562b3fb05afcd;hpb=0458300fda4f345f865a7f3ee4fc0f2020a91983;p=builder.git diff --git a/source/dependencycache.cpp b/source/dependencycache.cpp index f691d54..11b200d 100644 --- a/source/dependencycache.cpp +++ b/source/dependencycache.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of builder -Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include #include #include @@ -28,6 +21,11 @@ void DependencyCache::set_deps(const string &tgt, const StringList &d) changed = true; } +bool DependencyCache::has_deps(const string &tgt) const +{ + return deps.count(tgt); +} + const StringList &DependencyCache::get_deps(const string &tgt) const { return get_item(deps, tgt); @@ -53,7 +51,7 @@ void DependencyCache::load() { string fn = (package.get_source()/".deps").str(); - try + if(FS::Stat st = FS::stat(fn)) { IO::BufferedFile in(fn); @@ -64,8 +62,6 @@ void DependencyCache::load() deps[parts[0]] = StringList(parts.begin()+1, parts.end()); } - mtime = FS::stat(fn).get_modify_time(); + mtime = st.get_modify_time(); } - catch(const IO::file_not_found &) - { } }