about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rwxr-xr-xDocumentation/common.perl14
-rwxr-xr-xDocumentation/txt2pre6
-rw-r--r--Makefile.PL11
3 files changed, 15 insertions, 16 deletions
diff --git a/Documentation/common.perl b/Documentation/common.perl
index 5fdbe8da..3a6617c4 100755
--- a/Documentation/common.perl
+++ b/Documentation/common.perl
@@ -34,11 +34,15 @@ L<http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/>
                         ^AUTO-GENERATED-SEARCH-TERMS-END\n
                         !search_terms()!emsx;
         $s =~ s/[ \t]+$//sgm;
-        next if $s eq $orig;
-        seek($fh, 0, SEEK_SET) or die "seek: $!";
-        truncate($fh, 0) or die "truncate: $!";
-        print $fh $s or die "print: $!";
-        close $fh or die "close: $!";
+        if ($s eq $orig) {
+                my $t = time;
+                utime($t, $t, $fh);
+        } else {
+                seek($fh, 0, SEEK_SET) or die "seek: $!";
+                truncate($fh, 0) or die "truncate: $!";
+                print $fh $s or die "print: $!";
+                close $fh or die "close: $!";
+        }
 }
 
 sub search_terms {
diff --git a/Documentation/txt2pre b/Documentation/txt2pre
index 04bc3b0e..3ecd9100 100755
--- a/Documentation/txt2pre
+++ b/Documentation/txt2pre
@@ -177,9 +177,3 @@ print '<html><head>',
   "<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);
-}
diff --git a/Makefile.PL b/Makefile.PL
index c0aef488..cde6194b 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -23,7 +23,7 @@ push @dtxt, @{$v->{txt}};
 for my $txt (@dtxt) {
         my $html = $txt;
         $html =~ s/\.txt\z/.html/ or $html .= '.html';
-        $t->{"$html : $txt"} = [ "\$(txt2pre) <$txt" ];
+        $t->{"$html : $txt"} = [ "\$(txt2pre) <$txt", "touch -r $txt \$@" ];
 }
 $v->{t_slash_star_dot_t} = [ grep(m!\At/.*\.t\z!, @manifest) ];
 my @scripts = qw(scripts/ssoma-replay); # legacy
@@ -74,9 +74,10 @@ for my $i (@sections) {
                 my $txt = "Documentation/$m.txt";
                 $t->{"$m.$i : $pod"} = [ "\$(podman) -s$i $pod \$@" ];
                 $t->{"$txt : $m.$i"} = [ "\$(man2text) ./$m.$i >\$\@+",
-                                        "touch -r $pod \$\@+",
+                                        "touch -r $pod \$\@+ ./$m.$i",
                                         "mv \$\@+ \$@" ];
-                $t->{"Documentation/$m.html : $txt"} = [ "\$(txt2pre) <$txt" ];
+                $t->{"Documentation/$m.html : $txt"} = [ "\$(txt2pre) <$txt",
+                                                        "touch -r $txt \$@" ];
                 $t->{".$m.cols : $m.$i"} = [
                         "\@echo CHECK80 $m.$i;".
                         "COLUMNS=80 \$(MAN) ./$m.$i | \$(check_man)",
@@ -91,13 +92,13 @@ for my $i (@sections) {
         push @{$v->{manuals}}, @$manuals;
         push @{$v->{mantxt}}, map { "Documentation/$_.txt" } @$ary;
 }
-push @dtxt, @{$v->{mantxt}};
+push @dtxt;
 $v->{docs} = [ @dtxt, 'NEWS' ];
 $v->{docs_html} = [ map {;
                 my $x = $_;
                 $x =~ s/\.txt\z//;
                 "$x.html"
-        } @{$v->{docs}} ];
+        } (@{$v->{docs}}, @{$v->{mantxt}}) ];
 $v->{gz_docs} = [ map { "$_.gz" } (@{$v->{docs}},@{$v->{docs_html}}) ];
 $v->{rsync_docs} = [ @{$v->{gz_docs}}, @{$v->{docs}},
         @{$v->{docs_html}}, qw(NEWS.atom NEWS.atom.gz)];