Thanks! It looks much better. I've merged it with the original patch.
On Friday 13 March 2009 11:27:55 Jim Meyering wrote:
> > +This functionality is implemented using the @code{fileverscmp} function
> > +from gnulib. One result of that implementation decision is that @code{ls
> > -v} +and @code{sort -V} does not use the locale category,
> > @env{LC_COLLATE}. +As a result, non-numeric prefixes are sorted as if
> > @env{LC_COLLATE} were set +to @code{C}.
s/fileverscmp/filevercmp/
(introduced by me in the original patch)
Kamil
From 82d4e8fc847a5ca4362f7ac334a1bacf4b768b73 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <[email protected]>
Date: Fri, 13 Mar 2009 11:44:52 +0100
Subject: [PATCH] update info documentation about version sort
* doc/coreutils.texi: Reflect current filevercmp behavior.
---
doc/coreutils.texi | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 0bf978a..6f8c197 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -6661,21 +6661,27 @@ foo.zml-25.gz foo.zml-25.gz
foo.zml-6.gz foo.zml-100.gz
@end example
-Note also that numeric parts with leading zeros are considered as
-fractional one:
+Version-sorted strings are compared such that if @var{ver1} and @var{ver2}
+are version numbers and @var{prefix} and @var{suffix} (@var{suffix} matching
+the regular expression @samp{(\.[A-Za-z][A-Za-z0-9]*)*}) are strings then
+...@var{ver1} < @var{ver2} implies that the name composed of
+...@var{prefix} @var{ver1} @var{suffix}'' sorts before
+...@var{prefix} @var{ver2} @var{suffix}''.
+
+Note also that leading zeros of numeric parts are ignored:
@example
$ ls -1 $ ls -1v
-abc-1.007.tgz abc-1.007.tgz
-abc-1.012b.tgz abc-1.01a.tgz
+abc-1.007.tgz abc-1.01a.tgz
+abc-1.012b.tgz abc-1.007.tgz
abc-1.01a.tgz abc-1.012b.tgz
@end example
-This functionality is implemented using the @code{strverscmp} function.
-...@xref{string/Array Comparison, , , libc, The GNU C Library Reference Manual}.
-One result of that implementation decision is that @code{ls -v} does not
-use the locale category, @env{LC_COLLATE}. As a result, non-numeric prefixes
-are sorted as if @env{LC_COLLATE} were set to @code{C}.
+This functionality is implemented using gnulib's @code{filevercmp} function.
+One result of that implementation decision is that @samp{ls -v}
+and @samp{sort -V} do not use the locale category, @env{LC_COLLATE},
+which means non-numeric prefixes are sorted as if @env{LC_COLLATE} were set
+to @samp{C}.
@node General output formatting
@subsection General output formatting
--
1.6.1.2
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils