From f349c77a421ef1082eb0b22e8f71304df610fa6b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 9 Nov 2021 00:20:50 +0000 Subject: build: do not repeatedly build some docs Text versions of manpages do not need to be generated for normal installations, they're only used for generating HTML and our amazing, award-winning homepage. We'll also rely on touch(1) instead of Perl utime to benefit users w/o git-set-file-times in txt2pre. Perl numeric values cannot represent nanosecond resolution accurately even with Time::HiRes; which causes nanosecond-aware make(1) implementations to repeatedly rebuild. --- Documentation/common.perl | 14 +++++++++----- Documentation/txt2pre | 6 ------ 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'Documentation') 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 ^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 '', "$title", "
",  $str , '
'; 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); -} -- cgit v1.2.3-24-ge0c7