]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/TeXFiles.py
Remove profiling.py
[lyx.git] / lib / scripts / TeXFiles.py
index 188f6b90ad64d6d16311a818b28d5e95c58cc081..c41d83f9a7f0e734751c26c1a9082fde38dbc355 100755 (executable)
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
 # file TeXFiles.py
 # This file is part of LyX, the document processor.
 # Licence details can be found in the file COPYING.
@@ -35,7 +33,6 @@
 # relies on python and kpsewhich (no shell command is used).
 # 
 
-from __future__ import print_function
 import os, sys, re
 
 cls_stylefile = 'clsFiles.lst'
@@ -111,20 +108,21 @@ for type in types:
     
     file_ext = '.' + type
     out = open(outfile, 'w')
+    visited = set()
     for dir in dirs.split(path_sep):
         # for each valid directory
         if not os.path.isdir(dir):
             continue
         # walk down the file hierarchy
-        visited = set()
         for root,dirs,files in os.walk(dir, followlinks=True):
             # prevent inifinite recursion
             recurse = []
             for dir in dirs:
-                st = os.stat(os.path.join(root, dir))
-                key = st.st_dev, st.st_ino
-                if key not in visited:
-                    visited.add(key)
+                dirname = os.path.join(root, dir)
+                dirname = os.path.realpath(dirname)
+                dirname = os.path.normcase(dirname)
+                if dirname not in visited:
+                    visited.add(dirname)
                     recurse.append(dir)
             dirs[:] = recurse
             # check file type