]> git.tdb.fi Git - builder.git/commitdiff
Disallow empty rebuild reason
authorMikko Rasa <tdb@tdb.fi>
Wed, 9 May 2012 16:27:34 +0000 (19:27 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jul 2012 21:08:51 +0000 (00:08 +0300)
source/analyzer.cpp
source/target.cpp

index 15386784e690353ac751ccf54aea38d56c98770e..58c2b9035ee82e8589086f1e83aa1a7283e463a9 100644 (file)
@@ -95,12 +95,7 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth)
                row.push_back("");
 
        if(tgt.needs_rebuild())
-       {
-               if(tgt.get_rebuild_reason().empty())
-                       row.push_back("Yes (no reason)");
-               else
-                       row.push_back(tgt.get_rebuild_reason());
-       }
+               row.push_back(tgt.get_rebuild_reason());
 
        table.push_back(row);
 
index 44a758f888d152e543b9c489904760d3dd070dd3..297ae3f4211b9a4b3be3b2f68e1fd2ab43dc2ec5 100644 (file)
@@ -97,6 +97,9 @@ Task *Target::build()
 
 void Target::mark_rebuild(const std::string &reason)
 {
+       if(reason.empty())
+               throw invalid_argument("No reason given for rebuilding "+name);
+
        state = REBUILD;
        rebuild_reason = reason;
 }