]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2157] change need_generate condition
authorYoshitaka Aharen <aharen@jprs.co.jp>
Thu, 15 Nov 2012 09:15:28 +0000 (18:15 +0900)
committerYoshitaka Aharen <aharen@jprs.co.jp>
Thu, 15 Nov 2012 09:15:28 +0000 (18:15 +0900)
regenerate the file if .pre file is updated

src/bin/auth/gen-statistics_items.py.pre.in

index e42e109ee65c5cc87161982167a21a0285dce6da..816e426811014f53fb8fc9be23355c714d5910dd 100755 (executable)
@@ -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