Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56031 - trunk/tools/build/v2/build
From: ghost_at_[hidden]
Date: 2009-09-05 07:10:15


Author: vladimir_prus
Date: 2009-09-05 07:10:14 EDT (Sat, 05 Sep 2009)
New Revision: 56031
URL: http://svn.boost.org/trac/boost/changeset/56031

Log:
Various fixes. example/libraries now runs, though the includes are messed
Text files modified:
   trunk/tools/build/v2/build/project.py | 33 ++++++++++++++++++++++++---------
   trunk/tools/build/v2/build/property.py | 2 +-
   2 files changed, 25 insertions(+), 10 deletions(-)

Modified: trunk/tools/build/v2/build/project.py
==============================================================================
--- trunk/tools/build/v2/build/project.py (original)
+++ trunk/tools/build/v2/build/project.py 2009-09-05 07:10:14 EDT (Sat, 05 Sep 2009)
@@ -255,7 +255,7 @@
                 self.dir2jamfile[dir] = jamfile
             jamfile_glob = jamfile
 
- if len(jamfile_glob):
+ if len(jamfile_glob) > 1:
             # Multiple Jamfiles found in the same place. Warn about this.
             # And ensure we use only one of them.
             # As a temporary convenience measure, if there's Jamfile.v2 amount
@@ -266,8 +266,10 @@
             if len(v2_jamfiles) == 1:
                 jamfile_glob = v2_jamfiles
             else:
- print """warning: Found multiple Jamfiles at '%s'!
-Loading the first one: '%s'.""" % (dir, jamfile_glob[0])
+ print """warning: Found multiple Jamfiles at '%s'!""" % (dir)
+ for j in jamfile_glob:
+ print " -", j
+ print "Loading the first one"
     
         # Could not find it, error.
         if not no_errors and not jamfile_glob:
@@ -390,7 +392,7 @@
         self.module2attributes[module_name] = attributes
 
         if location:
- attributes.set("source-location", location, exact=1)
+ attributes.set("source-location", [location], exact=1)
         else:
             attributes.set("source-location", "", exact=1)
 
@@ -510,12 +512,22 @@
         """Returns the value of the specified attribute in the
         specified jamfile module."""
         return self.module2attributes[project].get(attribute)
+ try:
+ return self.module2attributes[project].get(attribute)
+ except:
+ print "Sucks", project, attribute
+ raise "Sucks"
+
+ def attributeDefault(self, project, attribute, default):
+ """Returns the value of the specified attribute in the
+ specified jamfile module."""
+ return self.module2attributes[project].getDefault(attribute, default)
 
     def target(self, project_module):
         """Returns the project target corresponding to the 'project-module'."""
- if not self.module2target[project_module]:
+ if not self.module2target.has_key(project_module):
             self.module2target[project_module] = \
- ProjectTarget(project_module, project_module,
+ b2.build.targets.ProjectTarget(project_module, project_module,
                               self.attribute(project_module, "requirements"))
         
         return self.module2target[project_module]
@@ -524,12 +536,12 @@
         # Use/load a project.
         saved_project = self.current_project
         project_module = self.load(location)
- declared_id = self.attribute(project_module, "id")
+ declared_id = self.attributeDefault(project_module, "id", "")
 
         if not declared_id or declared_id != id:
             # The project at 'location' either have no id or
             # that id is not equal to the 'id' parameter.
- if self.id2module[id] and self.id2module[id] != project_module:
+ if self.id2module.has_key(id) and self.id2module[id] != project_module:
                 self.manager.errors()(
 """Attempt to redeclare already existing project id '%s'""" % id)
             self.id2module[id] = project_module
@@ -743,6 +755,9 @@
     def get(self, attribute):
         return self.__dict__[attribute]
 
+ def getDefault(self, attribute, default):
+ return self.__dict__.get(attribute, default)
+
     def dump(self):
         """Prints the project attributes."""
         id = self.get("id")
@@ -905,7 +920,7 @@
         # See comment in 'load' for explanation why we record the
         # parameters as opposed to loading the project now.
         m = self.registry.current().project_module();
- self.registry.used_projects[m].append((id, where))
+ self.registry.used_projects[m].append((id[0], where[0]))
         
     def build_project(self, dir):
         assert(isinstance(dir, list))

Modified: trunk/tools/build/v2/build/property.py
==============================================================================
--- trunk/tools/build/v2/build/property.py (original)
+++ trunk/tools/build/v2/build/property.py 2009-09-05 07:10:14 EDT (Sat, 05 Sep 2009)
@@ -162,7 +162,7 @@
 
             t = [os.path.join(path, v) for v in values]
             t = '&&'.join (t)
- tp = backslashes_to_slashes (replace_grist (t, get_grist (p)))
+ tp = replace_grist (t, get_grist (p)).replace("\\", "/")
             result.append (condition + tp)
             
         else:


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk