Re: Optimize script for generating LinuxManBook.pdf

Deri
2023-11-22T17:34:44Z

On Wednesday, 22 November 2023 14:58:56 GMT Alejandro Colomar wrote:
> Hi Deri,
>
> I've optimized from 18.5 s down to 16.3 s the script, by splitting the
> pipeline with this wrapper (and slightly reducing the perl script to
> just print the pages to stdout). BTW, now it can be run from any
> directory. And every step can be debugged by just introducing
>
> | tee /dev/tty \
>
> wherever you want to debug. It's all pushed to master.
>
> The PDF is now printed to stdout, to avoid hard-coding file names.
>
> I still need to split a bit more and reduce the longest lines. How does
> this script look to you?
>
> Cheers,
> Alex :-)
>
>
> $ cat scripts/LinuxManBook/build_linux_man_book.sh
> #!/bin/sh
> # Copyright 2023, Alejandro Colomar <alx@kernel.org>
> # SPDX-License-Identifier: GPL-3.0-or-later
>
> (
> "$(dirname "$0")"/prepare_linux_man_book.pl "$1" \
>
> | groff -z -dPDF.EXPORT=1 -dLABEL.REFS=1 -dpaper=a4 -Tpdf -k -pet \
>
> -M"$(dirname "$0")" -mandoc -manmark \
> -F"$(dirname "$0")" -P-pa4 \-rC1 -rCHECKSTYLE=3 2>&1 \
>
> | LC_ALL=C grep '^\. *ds ';
>
> "$(dirname "$0")"/prepare_linux_man_book.pl "$1";
> ) \
>
> | preconv \
> | tbl \
> | eqn -Tpdf \
> | (
>
> troff -Tpdf -ms <"$(dirname "$0")"/LMBfront.ms;
> troff -Tpdf -M"$(dirname "$0")" -mandoc -manmark \
> -F"$(dirname "$0")" -dpaper=a4;
> ) \
>
> | gropdf -F"$(dirname "$0")" -pa4;

Hi Alex,

Is there a git address I can clone to see the changes "in the round” and give
it a go?

Cheers

Deri