X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpackage.cpp;h=19ee511a814cf34bf46efd20f9409c7394b5d879;hb=c51411c4b3ed4e6a0d8343b848db3dc736bc7857;hp=6cbc9328a43ba7a4556d28e7a55e43762256c969;hpb=f76c063eb9b792088e034ffb4c2f173b843e8c57;p=builder.git diff --git a/source/package.cpp b/source/package.cpp index 6cbc932..19ee511 100644 --- a/source/package.cpp +++ b/source/package.cpp @@ -1,6 +1,7 @@ #include #include #include +#include "booleanevaluator.h" #include "builder.h" #include "package.h" @@ -38,9 +39,8 @@ Package::Loader::Loader(Package &p): void Package::Loader::if_arch(const string &cond) { - const Architecture &arch = obj.builder.get_current_arch(); - bool negate = (cond[0]=='!'); - bool match = (arch.match_name(cond.substr(negate))!=negate); + BooleanEvaluator eval(sigc::hide<1>(sigc::mem_fun(&obj.builder.get_current_arch(), &Architecture::match_name)), false); + bool match = eval.evaluate(cond); obj.builder.get_logger().log("configure", format("%s: arch %s %smatched", obj.name, cond, (match ? "" : "not "))); if(match) load_sub_with(*this); @@ -51,4 +51,6 @@ void Package::Loader::require(const string &n) Package *req = obj.builder.get_package_manager().find_package(n); if(req) obj.requires.push_back(req); + else + obj.problems.push_back(format("Required package %s not found", n)); }