changeset 129:efd3df0de93a

Canonicalize path names so that comparison works. Fixes #37.
author cmlenz
date Fri, 12 Aug 2005 13:27:45 +0000
parents 4e3373472318
children 091ead7d2876
files bitten/build/pythontools.py bitten/recipe.py
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/build/pythontools.py
+++ b/bitten/build/pythontools.py
@@ -65,7 +65,7 @@
                 match = msg_re.search(line)
                 if match:
                     type = msg_types.get(match.group('type'))
-                    filename = match.group('file')
+                    filename = os.path.realpath(match.group('file'))
                     if filename.startswith(ctxt.basedir):
                         filename = filename[len(ctxt.basedir) + 1:]
                     lineno = int(match.group('line'))
@@ -96,7 +96,7 @@
             for summary_line in summary_file:
                 match = summary_line_re.search(summary_line)
                 if match:
-                    filename = match.group(4)
+                    filename = os.path.realpath(match.group(4))
                     modname = match.group(3)
                     cov = int(match.group(2))
                     if filename.startswith(ctxt.basedir):
@@ -138,8 +138,10 @@
             results = xmlio.Fragment()
             for child in xmlio.parse(fd).children():
                 filename = child.attr.get('file')
-                if filename and filename.startswith(ctxt.basedir):
-                    child.attr['file'] = filename[len(ctxt.basedir) + 1:]
+                if filename:
+                    filename = os.path.realpath(filename)
+                    if filename.startswith(ctxt.basedir):
+                        child.attr['file'] = filename[len(ctxt.basedir) + 1:]
                 results.append(child)
             ctxt.report(results)
         finally:
--- a/bitten/recipe.py
+++ b/bitten/recipe.py
@@ -19,7 +19,7 @@
 # Author: Christopher Lenz <cmlenz@gmx.de>
 
 import logging
-import os.path
+import os
 import time
 
 from bitten.build import BuildError
@@ -41,7 +41,7 @@
     current_function = None
 
     def __init__(self, basedir):
-        self.basedir = basedir
+        self.basedir = os.path.realpath(basedir)
         self.output = []
 
     def log(self, xml_elem):
Copyright (C) 2012-2017 Edgewall Software