Browse Source

Workaround for xsltproc's bug in handling spaces in file names

[SVN r32305]
Misha Bergal 20 years ago
parent
commit
ad3bffb701
1 changed files with 18 additions and 0 deletions
  1. 18 0
      tools/regression/xsl_reports/boost_wide_report.py

+ 18 - 0
tools/regression/xsl_reports/boost_wide_report.py

@@ -644,6 +644,24 @@ def make_result_pages(
         , os.path.join( output_dir, 'master.css' )
         )
 
+    fix_file_names( output_dir )
+
+
+def fix_file_names( dir ):
+    """
+    The current version of xslproc doesn't correctly handle
+    spaces on posix systems. We have to manually go through the
+    result set and correct decode encoded spaces (%20).
+    """
+    if os.name == 'posix':
+        for root, dirs, files in os.walk( dir ):
+            for file in files:
+                if file.find( "%20" ) > -1:
+                    new_name = file.replace( "%20", " " )
+                    old_file_path = os.path.join( root, file )
+                    new_file_path = os.path.join( root, new_name )
+                    print "renaming %s %s" % ( old_file_path, new_file_path )
+                    os.rename ( old_file_path, new_file_path )
 
 def build_xsl_reports( 
           locate_root_dir

粤ICP备19079148号