-rw-r--r-- | lib/sitespace.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sitespace.cc b/lib/sitespace.cc index 0406d11..d5592bf 100644 --- a/lib/sitespace.cc +++ b/lib/sitespace.cc | |||
@@ -1,39 +1,40 @@ | |||
1 | #ifdef USE_PCH | 1 | #ifdef USE_PCH |
2 | #include "pch.h" | 2 | #include "pch.h" |
3 | #else | 3 | #else |
4 | #include <cassert> | 4 | #include <cassert> |
5 | #include <konforka/util.h> | ||
5 | #include "sitecing/sitespace.h" | 6 | #include "sitecing/sitespace.h" |
6 | #include "sitecing/sitecing_util.h" | 7 | #include "sitecing/sitecing_util.h" |
7 | #endif | 8 | #endif |
8 | 9 | ||
9 | namespace sitecing { | 10 | namespace sitecing { |
10 | 11 | ||
11 | sitespace::sitespace(configuration& c) | 12 | sitespace::sitespace(configuration& c) |
12 | : config(c), factory(c) { } | 13 | : config(c), factory(c) { } |
13 | 14 | ||
14 | sitespace::~sitespace() { | 15 | sitespace::~sitespace() { |
15 | for(sentenced_t::iterator i = sentenced.begin();i!=sentenced.end();++i) { | 16 | for(sentenced_t::iterator i = sentenced.begin();i!=sentenced.end();++i) { |
16 | assert((*i)->chickens_used.empty()); | 17 | assert((*i)->chickens_used.empty()); |
17 | delete *i; | 18 | delete *i; |
18 | } | 19 | } |
19 | } | 20 | } |
20 | 21 | ||
21 | so_component sitespace::fetch(const string& c,sitecing_interface* scif) { | 22 | so_component sitespace::fetch(const string& c,sitecing_interface* scif) { |
22 | execute_sentenced(); | 23 | execute_sentenced(); |
23 | string sobase = normalize_path(c); | 24 | string sobase = konforka::normalize_path(c); |
24 | string sopath = factory.root_so+sobase+".so"; | 25 | string sopath = factory.root_so+sobase+".so"; |
25 | config_options *co_build = config.lookup_config(sobase,config_options::flag_build); | 26 | config_options *co_build = config.lookup_config(sobase,config_options::flag_build); |
26 | if( (!co_build) || co_build->build ) | 27 | if( (!co_build) || co_build->build ) |
27 | factory.make(sopath); | 28 | factory.make(sopath); |
28 | components_t::iterator i = components.find(sopath); | 29 | components_t::iterator i = components.find(sopath); |
29 | if(i!=components.end()) { | 30 | if(i!=components.end()) { |
30 | if(i->second->is_uptodate()) | 31 | if(i->second->is_uptodate()) |
31 | return so_component(i->second,scif); | 32 | return so_component(i->second,scif); |
32 | if(i->second->chickens_used.empty()) { | 33 | if(i->second->chickens_used.empty()) { |
33 | delete i->second; | 34 | delete i->second; |
34 | }else{ | 35 | }else{ |
35 | sentenced.push_back(i->second); | 36 | sentenced.push_back(i->second); |
36 | } | 37 | } |
37 | components.erase(i); | 38 | components.erase(i); |
38 | } | 39 | } |
39 | pair<components_t::iterator,bool> ins = components.insert(components_t::value_type(sopath,new component_so(sopath))); | 40 | pair<components_t::iterator,bool> ins = components.insert(components_t::value_type(sopath,new component_so(sopath))); |