From: Mikko Rasa Date: Tue, 1 May 2012 11:19:43 +0000 (+0300) Subject: Rename Target::get_rebuild to needs_rebuild X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4f5571c3098953378253234b476a5a2b07974065;p=builder.git Rename Target::get_rebuild to needs_rebuild --- diff --git a/source/analyzer.cpp b/source/analyzer.cpp index 70f5f20..98e71a8 100644 --- a/source/analyzer.cpp +++ b/source/analyzer.cpp @@ -66,7 +66,7 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth) if(const ObjectFile *obj = dynamic_cast(&tgt)) return build_depend_table(obj->get_source(), depth); } - else if(mode==REBUILD && !tgt.get_rebuild() && !real->get_rebuild()) + else if(mode==REBUILD && !tgt.needs_rebuild() && !real->needs_rebuild()) /* All targets that depend on to-be-built targets will be rebuilt themselves, so we can stop here. */ return; @@ -94,7 +94,7 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth) else row.push_back(""); - if(tgt.get_rebuild()) + if(tgt.needs_rebuild()) { if(tgt.get_rebuild_reason().empty()) row.push_back("Yes (no reason)"); diff --git a/source/builder.cpp b/source/builder.cpp index 6623c2d..1bff876 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -269,7 +269,7 @@ int Builder::main() if(j->second->get_package()==i->second) { ++count; - if(j->second->get_rebuild()) + if(j->second->needs_rebuild()) ++to_be_built; } if(count) @@ -565,7 +565,7 @@ int Builder::do_build() unsigned total = 0; for(map::const_iterator i=targets.begin(); i!=targets.end(); ++i) - if(i->second->is_buildable() && i->second->get_rebuild()) + if(i->second->is_buildable() && i->second->needs_rebuild()) ++total; if(!total) diff --git a/source/filetarget.cpp b/source/filetarget.cpp index 054be81..f04e310 100644 --- a/source/filetarget.cpp +++ b/source/filetarget.cpp @@ -44,12 +44,12 @@ void FileTarget::check_rebuild() FileTarget *ft = dynamic_cast(*i); if(ft && ft->get_mtime()>mtime) mark_rebuild((*i)->get_name()+" has changed"); - else if((*i)->get_rebuild()) + else if((*i)->needs_rebuild()) mark_rebuild((*i)->get_name()+" needs rebuilding"); else { Target *real = ft->get_real_target(); - if(real->get_rebuild()) + if(real->needs_rebuild()) mark_rebuild(real->get_name()+" needs rebuilding"); } } diff --git a/source/installedfile.cpp b/source/installedfile.cpp index 24ba6e1..5ed3139 100644 --- a/source/installedfile.cpp +++ b/source/installedfile.cpp @@ -37,7 +37,7 @@ void InstalledFile::check_rebuild() mark_rebuild("Does not exist"); else if(source.get_mtime()>mtime || source.get_size()!=size) mark_rebuild(source.get_name()+" has changed"); - else if(source.get_rebuild()) + else if(source.needs_rebuild()) mark_rebuild(source.get_name()+" needs rebuilding"); } diff --git a/source/target.cpp b/source/target.cpp index adde0cd..65d801f 100644 --- a/source/target.cpp +++ b/source/target.cpp @@ -35,7 +35,7 @@ Target *Target::get_buildable_target() Target *tgt = (*i)->get_buildable_target(); if(tgt) return tgt; - else if((*i)->get_rebuild()) + else if((*i)->needs_rebuild()) self_ok = false; } diff --git a/source/target.h b/source/target.h index 2df56a4..2c14ea1 100644 --- a/source/target.h +++ b/source/target.h @@ -67,7 +67,7 @@ public: const Tool *get_tool() const { return tool; } bool is_buildable() const { return tool!=0; } - bool get_rebuild() const { return rebuild; } + bool needs_rebuild() const { return rebuild; } const std::string &get_rebuild_reason() const { return rebuild_reason; } bool is_installable() const { return !install_location.empty(); } const std::string &get_install_location() const { return install_location; } diff --git a/source/virtualtarget.cpp b/source/virtualtarget.cpp index e3974d5..5d388de 100644 --- a/source/virtualtarget.cpp +++ b/source/virtualtarget.cpp @@ -14,6 +14,6 @@ void VirtualTarget::check_rebuild() { // Virtual targets are only rebuilt if their dependencies need rebuilding. for(Dependencies::iterator i=depends.begin(); (i!=depends.end() && !rebuild); ++i) - if((*i)->get_rebuild()) + if((*i)->needs_rebuild()) mark_rebuild((*i)->get_name()+" needs rebuilding"); }