bug#49503: Mention workarounds, so one could achieve the Debian version sorting algorithm

2022-02-10 Thread Paul Eggert

On 7/10/21 02:23, 積丹尼 Dan Jacobson wrote:

(info "(coreutils) Differences from the official Debian Algorithm") and
(info "(coreutils) Minus/Hyphen and Colon characters")
could mention workarounds, so one could indeed achieve the Debian
Algorithm.
Or mention the only way is to use
dpkg --compare-versions
(on pairs only.)


Thanks for mentioning that. I looked over the version-sort doc and fixed 
that problem along with some other stuff I noticed while in the 
neighborhood, by installing the attached patch.From cedf627a901e067ad3a63f0fc20f3376ed59786e Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Tue, 8 Feb 2022 10:52:10 -0800
Subject: [PATCH] doc: improve version-sort doc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* doc/coreutils.texi, doc/sort-version.texi:
Capitalize “Coreutils”.
* doc/sort-version.texi: Don’t emphasize natural sort so much,
since Coreutils has just version sort.
Use the term “lexicographic” instead of “alphabetic” or “standard”.
Suggest combining ‘V’ with ‘b’, and show why ‘b’ is needed.
Use shorter titles for sections, as GNU Emacs displays info poorly
when titles are too long to fit in a line.
Use @samp instead of @code for samples of data.
Do not use @samp{@code{...}}; @samp{...} should suffice and
double-nesting looks bad with Emacs.
Omit blank lines in examples that would not be present
in actual shell sessions.
Quote with `` and '', not with " or with '.
Mention dpkg --compare-versions more prominently.
Don’t rely on "\n" being equivalent to "\\n" in shell args.
Prefer Unicode name for hyphen-minus.
---
 doc/coreutils.texi|  14 +-
 doc/sort-version.texi | 402 +-
 2 files changed, 204 insertions(+), 212 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 75b868219..d1ad85865 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -498,9 +498,9 @@ Date input formats
 Version sorting order
 
 * Version sort overview::
-* Implementation Details::
-* Differences from the official Debian Algorithm::
-* Advanced Topics::
+* Version sort implementation::
+* Differences from Debian version sort::
+* Advanced version sort topics::
 
 Opening the software toolbox
 
@@ -3991,7 +3991,7 @@ Output extra information to stderr, like the checksum implementation being used.
 
 @item --untagged
 @opindex --untagged
-Output using the original coreutils format used by the other
+Output using the original Coreutils format used by the other
 standalone checksum utilities like @command{md5sum} for example.
 This format has the checksum at the start of the line, and may be
 more amenable to further processing by other utilities,
@@ -13922,11 +13922,11 @@ If a file being written to does not already exist, it is created.  If a
 file being written to already exists, the data it previously contained
 is overwritten unless the @option{-a} option is used.
 
-In previous versions of GNU coreutils (v5.3.0 - v8.23), a @var{file} of @samp{-}
+In previous versions of GNU Coreutils (v5.3.0 -- v8.23),
+a @var{file} of @samp{-}
 caused @command{tee} to send another copy of input to standard output.
 However, as the interleaved output was not very useful, @command{tee} now
-conforms to POSIX which explicitly mandates it to treat @samp{-} as a file
-with such name.
+conforms to POSIX and treats @samp{-} as a file name.
 
 The program accepts the following options.  Also see @ref{Common options}.
 
diff --git a/doc/sort-version.texi b/doc/sort-version.texi
index 18ddaa94a..7f76ac5bb 100644
--- a/doc/sort-version.texi
+++ b/doc/sort-version.texi
@@ -19,18 +19,17 @@
 @node Version sort overview
 @section Version sort overview
 
-@dfn{version sort} ordering (and similarly, @dfn{natural sort}
-ordering) is a method to sort items such as file names and lines of
-text in an order that feels more natural to people, when the text
+@dfn{Version sort} puts items such as file names and lines of
+text in an order that feels natural to people, when the text
 contains a mixture of letters and digits.
 
-Standard sorting usually does not produce the order that one expects
+Lexicographic sorting usually does not produce the order that one expects
 because comparisons are made on a character-by-character basis.
 
 Compare the sorting of the following items:
 
 @example
-Alphabetical sort:   Version Sort:
+Lexicographic sort:  Version Sort:
 
 a1   a1
 a120 a2
@@ -38,18 +37,19 @@ a13  a13
 a2   a120
 @end example
 
-version sort functionality in GNU coreutils is available in the @samp{ls -v},
-@samp{ls --sort=version}, @samp{sort -V}, @samp{sort --version-sort} commands.
+Version sort functionality in GNU Coreutils is available in the @samp{ls -v},
+@samp{ls --sort=version}, @samp{sort -V}, and
+@samp{sort --version-sort} commands.
 
 
 
-@node Using version sort in GNU coreutils
-@subsection Using version sort 

bug#49503: Mention workarounds, so one could achieve the Debian version sorting algorithm

2021-07-10 Thread 積丹尼 Dan Jacobson
(info "(coreutils) Differences from the official Debian Algorithm") and
(info "(coreutils) Minus/Hyphen and Colon characters")
could mention workarounds, so one could indeed achieve the Debian
Algorithm.
Or mention the only way is to use
dpkg --compare-versions
(on pairs only.)