X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpackage.cpp;h=aa9160e11b8e62ab03c16a0e961dc579bbe0894f;hb=2d765e850b2360940111cbd522af659cc3c4aef7;hp=22d19983cbc0574c5d2aae2fc68dd80cc192c5d5;hpb=70dc2ce96bd3ba878b60cbb61b2bcc1c5c570485;p=builder.git diff --git a/source/package.cpp b/source/package.cpp index 22d1998..aa9160e 100644 --- a/source/package.cpp +++ b/source/package.cpp @@ -2,7 +2,6 @@ #include #include #include "builder.h" -#include "misc.h" #include "package.h" using namespace std; @@ -22,11 +21,10 @@ void Package::prepare() if(prepared) return; - for(PackageList::const_iterator i=requires.begin(); i!=requires.end(); ++i) + for(Requirements::const_iterator i=requires.begin(); i!=requires.end(); ++i) (*i)->prepare(); - create_build_info(); - create_targets(); + do_prepare(); prepared = true; } @@ -40,9 +38,7 @@ 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); + bool match = obj.builder.get_current_arch().match_name(cond); obj.builder.get_logger().log("configure", format("%s: arch %s %smatched", obj.name, cond, (match ? "" : "not "))); if(match) load_sub_with(*this); @@ -53,4 +49,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)); }