From 9976a7bdf0e53966dce4bc828a37eb42de0223e3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 18 Oct 2006 10:24:25 +0000 Subject: [PATCH] Implement --build-all Don't count virtual targets when reporting the number of targets to be built Make the Copy action behave correctly in a dry run Report the number of out-of-date targets per package with --verbose --- source/action.cpp | 2 +- source/builder.cpp | 20 ++++++++++++++------ source/builder.h | 2 ++ source/copy.cpp | 3 +++ source/target.cpp | 4 +++- source/target.h | 2 +- source/virtualtarget.cpp | 5 +++++ source/virtualtarget.h | 1 + 8 files changed, 30 insertions(+), 9 deletions(-) diff --git a/source/action.cpp b/source/action.cpp index 7ed0da1..9ec8087 100644 --- a/source/action.cpp +++ b/source/action.cpp @@ -9,7 +9,7 @@ void Action::announce(const string &pkg, const string &tool, const string &tgt) { ostringstream line; line<second->get_buildable()) cout<<'*'; unsigned count=0; + unsigned ood_count=0; for(TargetMap::iterator j=targets.begin(); j!=targets.end(); ++j) if(j->second->get_package()==i->second) + { ++count; - cout<<" ("<second->get_rebuild()) + ++ood_count; + } + if(count) + { + cout<<" ("< &); @@ -64,6 +65,7 @@ private: std::list what_if; bool chrome; bool conf_all; + bool build_all; int load_build_file(const Msp::Path::Path &); int create_targets(); diff --git a/source/copy.cpp b/source/copy.cpp index 8d18ec8..0607b5d 100644 --- a/source/copy.cpp +++ b/source/copy.cpp @@ -26,7 +26,10 @@ Copy::Copy(Builder &b, const Package &pkg, const Path::Path &s, const Path::Path int Copy::check() { if(!worker) + { + signal_done.emit(); return 0; + } if(worker->get_done()) { diff --git a/source/target.cpp b/source/target.cpp index 04d9260..d552022 100644 --- a/source/target.cpp +++ b/source/target.cpp @@ -87,7 +87,9 @@ void Target::check_rebuild() if(!buildable) return; - if(!mtime) + if(builder.get_build_all()) + mark_rebuild("Rebuilding everything"); + else if(!mtime) mark_rebuild("Does not exist"); else { diff --git a/source/target.h b/source/target.h index ab9134a..890f123 100644 --- a/source/target.h +++ b/source/target.h @@ -26,7 +26,7 @@ public: virtual void prepare(); virtual Action *build()=0; void reset_count() { counted=false; } - unsigned count_rebuild(); + virtual unsigned count_rebuild(); void touch(); virtual ~Target() { } protected: diff --git a/source/virtualtarget.cpp b/source/virtualtarget.cpp index d3f80df..e44eecc 100644 --- a/source/virtualtarget.cpp +++ b/source/virtualtarget.cpp @@ -9,3 +9,8 @@ void VirtualTarget::check_rebuild() if((*i)->get_rebuild()) mark_rebuild(Msp::Path::basename((*i)->get_name())+" needs rebuilding"); } + +unsigned VirtualTarget::count_rebuild() +{ + return Target::count_rebuild()-rebuild; +} diff --git a/source/virtualtarget.h b/source/virtualtarget.h index 5cd62f2..4f064ba 100644 --- a/source/virtualtarget.h +++ b/source/virtualtarget.h @@ -9,6 +9,7 @@ public: VirtualTarget(Builder &b, const std::string &n): Target(b,0,n) { } const char *get_type() const { return "VirtualTarget"; } Action *build() { rebuild=false; return 0; } + unsigned count_rebuild(); private: void check_rebuild(); }; -- 2.43.0