X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fconfig.cpp;h=a83a641a5bcaa66dbfcf2eda1ee477ab13648306;hb=afed9d3a6326790b77b786cbc1e76b725a14dbe5;hp=4cc9149efe6deb4f672e29e0cfc5ed9e01f4a525;hpb=bdc8b6638b486aa668b4a9c6c5cce5f6b5f18222;p=builder.git diff --git a/source/config.cpp b/source/config.cpp index 4cc9149..a83a641 100644 --- a/source/config.cpp +++ b/source/config.cpp @@ -7,10 +7,11 @@ Distributed under the LGPL #include #include +#include +#include #include #include #include -#include #include #include "builder.h" #include "config.h" @@ -65,7 +66,7 @@ void Config::select_last_profile() { try { - IO::File in((package.get_source()/".profile.cache").str()); + IO::File in((package.get_source()/".profile").str()); string profile; in.getline(profile); set_option("profile", profile); @@ -90,7 +91,7 @@ void Config::select_profile(const string &profile) if(!package.get_builder().get_dry_run()) { - IO::File out((package.get_source()/".profile.cache").str(), IO::M_WRITE); + IO::File out((package.get_source()/".profile").str(), IO::M_WRITE); IO::print(out, "%s\n", profile); } @@ -177,7 +178,7 @@ void Config::finish() void Config::save() const { - Path fn=package.get_source()/".options.cache"; + FS::Path fn=package.get_source()/".options.cache"; OptionMap::const_iterator i=options.find("profile"); if(i!=options.end()) @@ -206,18 +207,14 @@ bool Config::set_option(const string &opt, const string &val) void Config::load() { - Path fn=package.get_source()/".options.cache"; - - OptionMap::iterator i=options.find("profile"); - if(i!=options.end()) - fn=package.get_source()/(".options."+i->second.value+".cache"); + FS::Path fn=package.get_source()/(".options."+get_option("profile").value); try { IO::File inf(fn.str()); IO::Buffered in(inf); - mtime=Time::TimeStamp::from_unixtime(stat(fn).st_mtime); + mtime=Time::TimeStamp::from_unixtime(FS::stat(fn).st_mtime); DataFile::Parser parser(in, fn.str()); Loader loader(*this);