Parcourir la source

[2157] change need_generate condition

regenerate the file if .pre file is updated
Yoshitaka Aharen il y a 12 ans
Parent
commit
c30ebf9ecc
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  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