]> Sergey Matveev's repositories - public-inbox.git/blobdiff - Documentation/txt2pre
search: {version} => {ibx_ver}
[public-inbox.git] / Documentation / txt2pre
index 9a81a24a007a5e861bbd59d33a46876476e76384..cb6a76138131a8d0abd3593d013860d523b1f1fa 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright (C) 2014-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2014-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # Stupid script to make HTML from preformatted, utf-8 text versions,
@@ -22,3 +22,10 @@ print '<html><head>',
   qq(<meta\nhttp-equiv="Content-Type"\ncontent="text/html; charset=utf-8"\n/>),
   "<title>$title</title>",
   "</head><body><pre>",  $str , '</pre></body></html>';
+STDOUT->flush;
+
+# keep mtime on website consistent so clients can cache
+if (-f STDIN && -f STDOUT) {
+       my @st = stat(STDIN);
+       utime($st[8], $st[9], \*STDOUT);
+}