summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-11-24 12:51:04 +0100
committerAlejandro Colomar <alx@kernel.org>2023-11-24 12:51:38 +0100
commit843961575420ca8b1651a29796ce160e2b0a5b81 (patch)
tree34e17a23fb778306381d9cdc710219c33d4b909b /scripts
parentdaa0261bbaac7ba89f02096c414a584eeec7acb8 (diff)
scripts/LinuxManBook/prepare_linux_man_book.pl: Add new function BuildSec()
The intention is to move some code from BuildPage() into this function, reducing the complexity of that inner function. As a side effect, just by adding this function, I've already noticed an optimization of 0.3 s. The reason, I guess, is that it starts processing pages without waiting for the entire sort to complete, which reduces the latency of the script. Cc: Deri James <deri@chuzzlewit.myzen.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/LinuxManBook/prepare_linux_man_book.pl11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/LinuxManBook/prepare_linux_man_book.pl b/scripts/LinuxManBook/prepare_linux_man_book.pl
index 0a79df4e5..5a4aad429 100755
--- a/scripts/LinuxManBook/prepare_linux_man_book.pl
+++ b/scripts/LinuxManBook/prepare_linux_man_book.pl
@@ -88,7 +88,16 @@ sub BuildBook
{
print ".pdfpagenumbering D . 1\n";
- foreach my $fn (sort sortman glob("$dir/man*/*")) {
+ foreach my $fn (sort glob("$dir/man*")) {
+ BuildSec($fn);
+ }
+}
+
+sub BuildSec
+{
+ my $manSdir=shift;
+
+ foreach my $fn (sort sortman glob("$manSdir/*")) {
BuildPage($fn);
}
}