]> git.tdb.fi Git - builder.git/blobdiff - source/externalaction.cpp
Use package directory as work dir for ExternalActions and make filename arguments...
[builder.git] / source / externalaction.cpp
index bde453f8c18b7321d0835ad54ce3913f93e0dfce..54c9acc1274fed39f2b01c79aafeabdaa8d6d4bd 100644 (file)
@@ -7,6 +7,7 @@ Distributed under the LGPL
 
 #include <sys/wait.h>
 #include <iostream>
+#include <msp/path/utils.h>
 #include "builder.h"
 #include "externalaction.h"
 
@@ -69,6 +70,8 @@ void ExternalAction::launch()
                                argv_[j++]=strdup(i->c_str());
                        argv_[j]=0;
 
+                       if(!work_dir.empty())
+                               chdir(work_dir);
                        execvp(argv_[0], argv_);
                        cout<<"Couldn't execute "<<argv.front()<<'\n';
                        exit(1);