Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64464 - in trunk/tools/build/v2: . build
From: ghost_at_[hidden]
Date: 2010-07-30 06:34:03


Author: vladimir_prus
Date: 2010-07-30 06:34:02 EDT (Fri, 30 Jul 2010)
New Revision: 64464
URL: http://svn.boost.org/trac/boost/changeset/64464

Log:
Improve reporting of 'duplicate virtual target'.

Text files modified:
   trunk/tools/build/v2/build/virtual_target.py | 26 +++++++++++++++-----------
   trunk/tools/build/v2/build_system.py | 5 ++++-
   2 files changed, 19 insertions(+), 12 deletions(-)

Modified: trunk/tools/build/v2/build/virtual_target.py
==============================================================================
--- trunk/tools/build/v2/build/virtual_target.py (original)
+++ trunk/tools/build/v2/build/virtual_target.py 2010-07-30 06:34:02 EDT (Fri, 30 Jul 2010)
@@ -77,6 +77,8 @@
 
 import b2.build.property as property
 
+from b2.manager import get_manager
+
 __re_starts_with_at = re.compile ('^@(.*)')
 
 class VirtualTargetRegistry:
@@ -213,17 +215,19 @@
                 if not properties_added: properties_added = "none"
 
             # FIXME: Revive printing of real location.
- raise BaseException ("Duplicate name of actual target: '%s'\n"
- "previous virtual target '%s'\n"
- "created from '%s'\n"
- "another virtual target '%s'\n"
- "created from '%s'\n"
- "added properties: '%s'\n"
- "removed properties: '%s'\n" % (actual_name,
- self.actual_ [actual_name], "loc", #cmt1.location (),
- virtual_target,
- "loc", #cmt2.location (),
- properties_added, properties_removed))
+ get_manager().errors()(
+ "Duplicate name of actual target: '%s'\n"
+ "previous virtual target '%s'\n"
+ "created from '%s'\n"
+ "another virtual target '%s'\n"
+ "created from '%s'\n"
+ "added properties: '%s'\n"
+ "removed properties: '%s'\n"
+ % (actual_name,
+ self.actual_ [actual_name], "loc", #cmt1.location (),
+ virtual_target,
+ "loc", #cmt2.location (),
+ properties_added, properties_removed))
 
         else:
             self.actual_ [actual_name] = virtual_target

Modified: trunk/tools/build/v2/build_system.py
==============================================================================
--- trunk/tools/build/v2/build_system.py (original)
+++ trunk/tools/build/v2/build_system.py 2010-07-30 06:34:02 EDT (Fri, 30 Jul 2010)
@@ -441,7 +441,10 @@
         stats.sort_stats('time', 'calls')
         stats.print_callers(20)
     else:
- return main_real()
+ try:
+ return main_real()
+ except ExceptionWithUserContext, e:
+ e.report()
 
 def main_real():
 


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