From 00a14a02a64e4874a71827c2b50537cfeec19e1c Mon Sep 17 00:00:00 2001 From: Baillette Date: Wed, 3 Oct 2018 19:13:39 +0200 Subject: [PATCH] Resolving mtime truncation issue #2412 Issue #2412 : python copy instruction doesn't preserve mtime under Debian/stretch (up to date). This results in lot of files are copied to output even if not changed (and a lot of wasted time). Proposed solution in pelican/pelican/generators.py, line 823: #return s_mtime > d_mtime return s_mtime - d_mtime > 0.000001 --- pelican/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index c7fc4a9e..2b2c02a3 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -820,7 +820,7 @@ class StaticGenerator(Generator): save_as = os.path.join(self.output_path, staticfile.save_as) s_mtime = os.path.getmtime(source_path) d_mtime = os.path.getmtime(save_as) - return s_mtime > d_mtime + return s_mtime - d_mtime > 0.000001 def _link_or_copy_staticfile(self, sc): if self.settings['STATIC_CREATE_LINKS']: