X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsourcepackage.cpp;h=f59b353d74d0c3edd5dc6e52409e61c9083fab64;hb=3e8bf5032e744b5fc3e7680af48f2abacc67addc;hp=a466089ae75aad13b049d5e5e3660a930f597ec3;hpb=8d7926359d2477a9928d7367678314bcbc1f6e81;p=builder.git diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index a466089..f59b353 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of builder -Copyright © 2007-2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include #include #include @@ -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();