]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
src/bin/sortman: Fix order of intro(*) pages for subsections
authorAlejandro Colomar <alx@kernel.org>
Tue, 22 Jul 2025 09:48:07 +0000 (11:48 +0200)
committerAlejandro Colomar <alx@kernel.org>
Tue, 22 Jul 2025 09:48:15 +0000 (11:48 +0200)
Here's what changes with this patch:

$ diff -u \
<(find man -type f | ../master/src/bin/sortman) \
<(find man -type f | ./src/bin/sortman);
--- /dev/fd/63 2025-07-22 11:47:27.982307499 +0200
+++ /dev/fd/62 2025-07-22 11:47:27.982307499 +0200
@@ -805,7 +805,6 @@
 man/man2const/VT_SETMODE.2const
 man/man2const/VT_WAITACTIVE.2const
 man/man2type/open_how.2type
-man/man3attr/intro.3attr
 man/man3/intro.3
 man/man3/a64l.3
 man/man3/abort.3
@@ -2517,6 +2516,7 @@
 man/man3/yn.3
 man/man3/ynf.3
 man/man3/ynl.3
+man/man3attr/intro.3attr
 man/man3attr/gnu::aligned.3attr
 man/man3attr/gnu::format.3attr
 man/man3const/EOF.3const

Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/bin/sortman

index 9f88dfce19f4884fc4302d73a2d5c8dce6c492d1..746dd3f590bd943ed9a587cb9ef5f7f74e4a3582 100755 (executable)
@@ -3,9 +3,10 @@
 # Copyright, the authors of the Linux man-pages project
 # SPDX-License-Identifier: GPL-3.0-or-later
 
-sed   -E '/\/intro./  s/.*\.([[:digit:]])/\10\t&/' \
+sed   -E '/\/intro./  s/.*\.([[:digit:]])$/\10\t&/' \
+| sed -E '/\/intro./  s/.*\.([[:digit:]])([[:alpha:]][[:alnum:]]*\>)/\12.\20\t&/' \
 | sed -E '/\/intro./! s/.*\.([[:digit:]])\>/\11\t&/' \
-| sed -E '/\/intro./! s/.*\.([[:digit:]])([[:alpha:]][[:alnum:]]*\>)/\12.\2\t&/' \
+| sed -E '/\/intro./! s/.*\.([[:digit:]])([[:alpha:]][[:alnum:]]*\>)/\12.\21\t&/' \
 | sed -E '            s/\t(.*)/&\n\1/' \
 | sed -E '/\t/        s/\.[[:digit:]]([[:alpha:]][[:alnum:]]*)?\>.*//' \
 | sed -E '/\t/        s/\/[_-]*/\//g' \