X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcondition.cpp;fp=source%2Fcondition.cpp;h=136b852fccd30c6e2b6ed2f7701ca8004e771c50;hb=699493ee7346c578537f4e310702c57012686c22;hp=4c7b5ed5b2d923a8b308c975e470dbfdf75041b3;hpb=49ee08bb6f63f6b3a8cdd3b7cf032dea9b2cba8a;p=builder.git diff --git a/source/condition.cpp b/source/condition.cpp index 4c7b5ed..136b852 100644 --- a/source/condition.cpp +++ b/source/condition.cpp @@ -25,9 +25,9 @@ Condition::Condition(SourcePackage &p, const string &expr): string::size_type token = i->find_first_of("=!"); if(token==string::npos) - expression.insert(StringMap::value_type(*i, "!0")); + expression.insert(StringMap::value_type(*i, "=")); else if(token==0 && (*i)[0]=='!') - expression.insert(StringMap::value_type(*i, "=0")); + expression.insert(StringMap::value_type(*i, "!")); else expression.insert(StringMap::value_type(i->substr(0, token), i->substr(token))); } @@ -48,7 +48,12 @@ bool Condition::eval() bool match = false; if(conf.is_option(i->first)) - match = (conf.get_option(i->first).value==value); + { + if(value.empty()) + match = lexical_cast(conf.get_option(i->first).value); + else + match = (conf.get_option(i->first).value==value); + } else if(i->first=="arch") match = pkg.get_builder().get_current_arch().match_name(value);