X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcomponent.cpp;h=46e9294d039abb2a4cc9ee33c0180acd595239c1;hb=4ee988cdd18d919b11355c21e5234c3f28f5d6a7;hp=a42b81cded44229d877882c535b11c2982ecfb77;hpb=2f5311c7ed2735926b6fb107a657e77ac331e4c1;p=builder.git diff --git a/source/component.cpp b/source/component.cpp index a42b81c..46e9294 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -2,9 +2,7 @@ #include #include #include -#include -#include -#include "booleanevaluator.h" +#include #include "builder.h" #include "component.h" #include "sourcepackage.h" @@ -103,8 +101,8 @@ Component::SourceList Component::collect_source_files() const for(SourceList::const_iterator j=dirs.begin(); j!=dirs.end(); ++j) { package.get_builder().get_logger().log("files", format("Traversing %s", *j)); - list sfiles = list_files(*j); - for(list::iterator k=sfiles.begin(); k!=sfiles.end(); ++k) + vector sfiles = list_files(*j); + for(vector::iterator k=sfiles.begin(); k!=sfiles.end(); ++k) { if(j!=dirs.begin()) { @@ -112,7 +110,9 @@ Component::SourceList Component::collect_source_files() const continue; overlay_files.insert(*k); } - files.push_back(*j / *k); + FS::Path fn = *j / *k; + if(!FS::is_dir(fn)) + files.push_back(fn); } } } @@ -133,10 +133,9 @@ Component::SourceList Component::collect_source_files() const Component::Loader::Loader(Component &c): - DataFile::ObjectLoader(c) + DataFile::ObjectLoader(c), + ConditionalLoader(c.package, format("%s/%s", c.package.get_name(), c.name)) { - add("if_arch", &Loader::if_arch); - add("if_feature", &Loader::if_feature); add("overlay", &Loader::overlay); add("source", &Loader::source); add("install", &Component::install); @@ -151,26 +150,6 @@ void Component::Loader::build_info() load_sub(obj.build_info); } -void Component::Loader::if_arch(const string &cond) -{ - BooleanEvaluator eval(sigc::hide<1>(sigc::mem_fun(&obj.package.get_builder().get_current_arch(), &Architecture::match_name)), false); - bool match = eval.evaluate(cond); - obj.package.get_builder().get_logger().log("configure", - format("%s/%s: arch %s %smatched", obj.package.get_name(), obj.name, cond, (match ? "" : "not "))); - if(match) - load_sub_with(*this); -} - -void Component::Loader::if_feature(const string &cond) -{ - BooleanEvaluator eval(sigc::mem_fun(&obj.package, &SourcePackage::match_feature)); - bool match = eval.evaluate(cond); - obj.package.get_builder().get_logger().log("configure", - format("%s/%s: feature %s %smatched", obj.package.get_name(), obj.name, cond, (match ? "" : "not "))); - if(match) - load_sub_with(*this); -} - void Component::Loader::install_map() { load_sub(obj.install_map, obj.package.get_source_directory());