Hi Brian, On 2023-08-13 22:47, Alejandro Colomar wrote: > Hi Brian, > > On 2023-08-13 22:30, Brian Inglis wrote: > [...] > >> UI: I also noticed, while looking for tables to compare, that pages are ordered >> by filename not like rpmvercmp/ls -v/RPM::VersionSort e.g ISO_8859-2 is after >> ISO_8859-16 which may not be as expected. >> Used rpmvercmp in last line of perl sub sortman and works as expected. > > Hmm, I'll update the scripts/sortman script in the man-pages repo to tuse sort -V. > I intend that script (among Makefile code) to replace Deri's perl, as I don't > speak perl. > I didn't try your sort, but while implementing my own shell version of it, I found that version sort wasn't good enough, as it makes some cases be worse. I suggest you test it against my own script, and see if you get the same ordering. If not, you'll need to tweak it. The most important thing is that _exit(2) should go next to exit(2). Here's what I did: <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=aab14503ef101d918046aeaa941f226685fe7bf5> #!/bin/sh # Copyright 2023, Alejandro Colomar <alx@xxxxxxxxxx> # SPDX-License-Identifier: GPL-3.0-or-later sed -E '/\/intro./ s/.*\.([[:digit:]])/\10\t&/' \ | sed -E '/\/intro./! s/.*\.([[:digit:]])\>/\11\t&/' \ | sed -E '/\/intro./! s/.*\.([[:digit:]])([[:alnum:]]+)/\12.\2\t&/' \ | sed -E ' s/\t(.*)/&\n\1/' \ | sed -E '/\t/ s/([^[:digit:]])[_-]([^[:digit:]])/\1\2/g' \ | sed -E '/\t/ s/[_-]/_/g' \ | sed -E '/\t/ {N;s/\n/\t/;}' \ | sort -fV \ | cut -f3; Cheers, Alex -- <http://www.alejandro-colomar.es/> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature