Browse Source

[2157] change need_generate condition

regenerate the file if .pre file is updated
Yoshitaka Aharen 12 years ago
parent
commit
c30ebf9ecc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/bin/auth/gen-statistics_items.py.pre.in

+ 3 - 1
src/bin/auth/gen-statistics_items.py.pre.in

@@ -34,7 +34,9 @@ def need_generate(filepath, mtime):
     To avoid unnecessary compilation, we skip (re)generating the file when
     the file already exists and newer than the base file.
     '''
-    if os.path.exists(filepath) and os.path.getmtime(filepath) > mtime:
+    if os.path.exists(filepath) and\
+        (os.path.getmtime(filepath) > mtime or
+         os.path.getmtime(filepath) > os.path.getmtime(filepath+pre_suffix)):
         return False
     return True