]> git.tdb.fi Git - builder.git/blobdiff - source/condition.cpp
Rewrite the architecture system
[builder.git] / source / condition.cpp
index 314d9c93688c592f80d9c07452cedb2c31be8cb7..4c7b5ed5b2d923a8b308c975e470dbfdf75041b3 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of builder
-Copyright © 2007-2009  Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2010  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -44,14 +44,15 @@ bool Condition::eval()
                unsigned start = 1;
                if(i->second[1]=='=')
                        ++start;
+               string value = i->second.substr(start);
 
-               string value;
+               bool match = false;
                if(conf.is_option(i->first))
-                       value = conf.get_option(i->first).value;
+                       match = (conf.get_option(i->first).value==value);
                else if(i->first=="arch")
-                       value = pkg.get_builder().get_current_arch().get_name();
+                       match = pkg.get_builder().get_current_arch().match_name(value);
 
-               if((value==i->second.substr(start))==neg)
+               if(match==neg)
                        result = false;
        }