]> git.tdb.fi Git - builder.git/blobdiff - source/config.cpp
Fix include and library search order
[builder.git] / source / config.cpp
index 74c3741466ae33131aa58d76551467c174f25dd6..2e3741e2a2a5120ab1d8e3bddfe573e2fc3ce21a 100644 (file)
@@ -6,17 +6,17 @@ Distributed under the LGPL
 */
 
 #include <fstream>
-#include <msp/core/error.h>
+#include <msp/core/except.h>
 #include <msp/path/utils.h>
 #include <msp/time/utils.h>
 #include "builder.h"
 #include "config.h"
-#include "package.h"
+#include "sourcepackage.h"
 
 using namespace std;
 using namespace Msp;
 
-Config::Config(Package &p):
+Config::Config(SourcePackage &p):
        package(p),
        freeze_mtime(false)
 { }
@@ -171,7 +171,7 @@ void Config::finish()
 
 void Config::save() const
 {
-       Path::Path fn=package.get_source()/".options.cache";
+       Path fn=package.get_source()/".options.cache";
 
        OptionMap::const_iterator i=options.find("profile");
        if(i!=options.end())
@@ -201,7 +201,7 @@ bool Config::set_option(const string &opt, const string &val)
 
 void Config::load()
 {
-       Path::Path fn=package.get_source()/".options.cache";
+       Path fn=package.get_source()/".options.cache";
 
        OptionMap::iterator i=options.find("profile");
        if(i!=options.end())
@@ -210,9 +210,7 @@ void Config::load()
        ifstream in(fn.str().c_str());
        if(!in) return;
 
-       struct stat st;
-       Path::stat(fn, st);
-       mtime=Time::TimeStamp::from_unixtime(st.st_mtime);
+       mtime=Time::TimeStamp::from_unixtime(stat(fn).st_mtime);
 
        DataFile::Parser parser(in, fn.str());
        Loader loader(*this);