summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2005-04-03 13:07:33 (UTC)
committer Michael Krelin <hacker@klever.net>2005-04-03 13:07:33 (UTC)
commit197174ead5e273bd0c8684d92752e1e8599d6656 (patch) (side-by-side diff)
tree7f464c0fd17593e723b13766307c54ceb0ee326f
parentf2ddc6833252f106cf9aa589bc13216ba25ee4e6 (diff)
downloadsitecing-197174ead5e273bd0c8684d92752e1e8599d6656.zip
sitecing-197174ead5e273bd0c8684d92752e1e8599d6656.tar.gz
sitecing-197174ead5e273bd0c8684d92752e1e8599d6656.tar.bz2
yet another fix to handling dependencies
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--include/sitecing/component_factory.h4
-rw-r--r--lib/component_factory.cc25
2 files changed, 25 insertions, 4 deletions
diff --git a/include/sitecing/component_factory.h b/include/sitecing/component_factory.h
index a208ed1..9ddf70d 100644
--- a/include/sitecing/component_factory.h
+++ b/include/sitecing/component_factory.h
@@ -54,6 +54,10 @@ namespace sitecing {
* @overload file_factory::build()
*/
virtual void build(const string& dst);
+ /**
+ * @overload file_factory::make()
+ */
+ virtual void make(const string& dst);
/**
* Helper function for executing external command.
diff --git a/lib/component_factory.cc b/lib/component_factory.cc
index 5c18bb7..b5e95af 100644
--- a/lib/component_factory.cc
+++ b/lib/component_factory.cc
@@ -115,7 +115,6 @@ namespace sitecing {
bool component_factory::is_uptodate(const string& dst,file_list_t *deps) {
string dp = normalize_path(dst,strip_trailing_slash);
- // XXX: or just compare it off, instead of throwing things around.
try {
string noro = strip_prefix(dp,root_intermediate);
for(int ppt=0;(ppt+1)<sizeof(pp_targets)/sizeof(*pp_targets);ppt++) {
@@ -127,6 +126,7 @@ namespace sitecing {
bool rv = file_factory::is_uptodate(dst,deps);
return rv;
}catch(utility_no_prefix& unp) { }
+ // XXX: or just compare it off, instead of throwing things around.
try {
strip_prefix(dp,root_so);
return file_factory::is_uptodate(dst,deps);
@@ -147,6 +147,7 @@ namespace sitecing {
string noso = strip_suffix(dp,".so");
string noro = strip_prefix(noso,root_so);
string o = root_intermediate+noro+".o";
+ cerr << "Linking " << noro << endl;
if(access(o.c_str(),R_OK))
throw konforka::exception(CODEPOINT,string("can't access compiled component code (")+o+")");
make_path(dir_name(root_so+noro),0755);
@@ -191,6 +192,7 @@ namespace sitecing {
string nos = strip_suffix(noro,cc_targets[cct]);
string cc = root_intermediate+nos+".cc";
string o = root_intermediate+nos+".o";
+ cerr << "Compiling " << nos << endl;
if(access(cc.c_str(),R_OK))
throw konforka::exception(CODEPOINT,string("can't access preprocessed component code (")+cc+")");
make_path(dir_name(cc),0755);
@@ -230,6 +232,7 @@ namespace sitecing {
try {
string nos = strip_suffix(noro,pp_targets[ppt]);
string src = root_source+nos;
+ cerr << "Preprocessing " << nos << endl;
if(access(src.c_str(),R_OK))
throw konforka::exception(CODEPOINT,string("can't access component source (")+src+")");
make_path(dir_name(root_intermediate+nos),0755);
@@ -264,17 +267,31 @@ namespace sitecing {
cerr << "ignoring build request for " << dp << endl;
}
+ void component_factory::make(const string& dst) {
+ string dp = normalize_path(dst,strip_trailing_slash);
+ try {
+ string noso = strip_suffix(dp,".so");
+ string noro = strip_prefix(noso,root_so);
+ file_list_t a;
+ get_ancestors(noro,a);
+ for(file_list_t::const_iterator i=a.begin();i!=a.end();++i) {
+ make(root_so+*i+".so");
+ }
+ }catch(utility_no_affix& una) { }
+ file_factory::make(dst);
+ }
+
int component_factory::execute(const string& cmd, const list<string>& args,int stdo,int stde) {
// XXX: is it right that we do stdio/stderr tricks outside of the function?
- cerr << "executing: " << cmd;
+ // cerr << "executing: " << cmd;
vector<const char*> argv(args.size()+2);
argv[0]=cmd.c_str();
int an = 1;
for(list<string>::const_iterator i=args.begin();i!=args.end();i++) {
- cerr << " " << *i ;
+ // cerr << " " << *i ;
argv[an++] = i->c_str();
}
- cerr << endl;
+ // cerr << endl;
argv[an++]=NULL;
pid_t pid = vfork();
if(pid==-1) {