]> git.tdb.fi Git - builder.git/blobdiff - source/sourcepackage.cpp
Rename BuildInfo::add to update_from
[builder.git] / source / sourcepackage.cpp
index a466089ae75aad13b049d5e5e3660a930f597ec3..f59b353d74d0c3edd5dc6e52409e61c9083fab64 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of builder
-Copyright © 2007-2010  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include <cstdlib>
 #include <msp/io/print.h>
 #include <msp/strings/lexicalcast.h>
@@ -76,7 +69,7 @@ LibMode SourcePackage::get_library_mode() const
        else if(mode=="none")
                return DYNAMIC;
        else
-               throw Exception("Unknown library mode");
+               throw runtime_error("unknown library mode");
 }
 
 string SourcePackage::expand_string(const string &str) const
@@ -87,7 +80,7 @@ string SourcePackage::expand_string(const string &str) const
        while((dollar = result.find('$'))!=string::npos)
        {
                if(n>1000)
-                       throw Exception("Too much variable expansions");
+                       throw bad_expansion("nested too deep");
 
                string::size_type end;
                string var;
@@ -95,7 +88,7 @@ string SourcePackage::expand_string(const string &str) const
                {
                        end = result.find('}', dollar+2);
                        if(end==string::npos)
-                               throw Exception("Unterminated variable reference");
+                               throw bad_expansion("unterminated variable reference");
                        var = result.substr(dollar+2, end-dollar-2);
                        ++end;
                }
@@ -188,7 +181,7 @@ void SourcePackage::init_config()
 
 void SourcePackage::create_build_info()
 {
-       build_info.add(builder.get_current_arch().get_build_info());
+       build_info.update_from(builder.get_current_arch().get_build_info());
 
        // XXX Currently, a package-specific settings will override cmdline.  This might or might not be desirable.
        const StringList &warnings = builder.get_warnings();
@@ -223,7 +216,7 @@ void SourcePackage::create_build_info()
 
        for(ConditionList::iterator i=conditions.begin(); i!=conditions.end(); ++i)
                if(i->eval())
-                       build_info.add(i->get_build_info());
+                       build_info.update_from(i->get_build_info());
 
        build_info.unique();