bug#53982: date (GNU coreutils) 8.30 bug report "17 april 2022 + 37 week 5pm"

2022-02-13 Thread Stéphane Archer
Hi,
I hope this is the right place to do my bug report.
please see the following shell input-output:
```
$ date -d "17 april 2022 + 36 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
2022-12-25T17:00:00.0Z
$ date -d "17 april 2022 + 37 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
2022-01-01T17:00:00.0Z
$ date -d "17 april 2022 + 38 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
2023-01-08T17:00:00.0Z
```
as you can see the input "17 april 2022 + 37 week 5pm" makes date return
the wrong output for some unknown reason.

Do I do something wrong?
I use the following version: date (GNU coreutils) 8.30

-- 
Best Regards,

Stephane Archer


bug#53977: Improve markup in man pages

2022-02-13 Thread Mario Blättermann
Hello,

the SEE ALSO sections in the man pages contain links which will be
pulled in from *.x files by help2man. While help2man evaluates the
Groff markup from --help and --version output, it doesn't bother with
the markup in the *.x files. See the attached patch. The bold
formatting of the links is especially useful in HTML output (but also
in terminal output); the links become clickable and point to the
respective man page in online collections [1]. You can test the
behavior in the German version, where the links are already properly
formatted [2].

[1] https://man.archlinux.org/man/cat.1
[2] https://man.archlinux.org/man/cat.1.de

Best Regards,
Mario
diff --git a/man/arch.x b/man/arch.x
index 0a310b41f..487318207 100644
--- a/man/arch.x
+++ b/man/arch.x
@@ -3,4 +3,5 @@ arch \- print machine hardware name (same as uname -m)
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-uname(1), uname(2)
+.BR uname (1),
+.BR uname (2)
diff --git a/man/b2sum.x b/man/b2sum.x
index 5a857ca15..bb5cabb5b 100644
--- a/man/b2sum.x
+++ b/man/b2sum.x
@@ -3,4 +3,4 @@ b2sum \- compute and check BLAKE2 message digest
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-cksum(1)
+.BR cksum (1)
diff --git a/man/basename.x b/man/basename.x
index e91ee57ee..a6554c217 100644
--- a/man/basename.x
+++ b/man/basename.x
@@ -3,4 +3,5 @@ basename \- strip directory and suffix from filenames
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-dirname(1), readlink(1)
+.BR dirname (1),
+.BR readlink (1)
diff --git a/man/cat.x b/man/cat.x
index 9eb38cf05..e6eb90e38 100644
--- a/man/cat.x
+++ b/man/cat.x
@@ -3,4 +3,4 @@ cat \- concatenate files and print on the standard output
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-tac(1)
+.BR tac (1)
diff --git a/man/chgrp.x b/man/chgrp.x
index a61f3089e..a3d10bc27 100644
--- a/man/chgrp.x
+++ b/man/chgrp.x
@@ -3,4 +3,5 @@ chgrp \- change group ownership
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-chown(1), chown(2)
+.BR chown (1),
+.BR chown (2)
diff --git a/man/chmod.x b/man/chmod.x
index 3ab8ed055..847ba9234 100644
--- a/man/chmod.x
+++ b/man/chmod.x
@@ -115,4 +115,4 @@ quickly when run; this is called the
 .IR "sticky bit" .
 .SH OPTIONS
 [SEE ALSO]
-chmod(2)
+.BR chmod (2)
diff --git a/man/chown.x b/man/chown.x
index ee79d1b7d..22564bd6d 100644
--- a/man/chown.x
+++ b/man/chown.x
@@ -27,4 +27,4 @@ If only a colon is given, or if the entire operand is empty, neither the
 owner nor the group is changed.
 .SH OPTIONS
 [SEE ALSO]
-chown(2)
+.BR chown (2)
diff --git a/man/chroot.x b/man/chroot.x
index fc1be5286..c21336d52 100644
--- a/man/chroot.x
+++ b/man/chroot.x
@@ -3,4 +3,4 @@ chroot \- run command or interactive shell with special root directory
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-chroot(2)
+.BR chroot (2)
diff --git a/man/comm.x b/man/comm.x
index d4d8e00da..b7ab4478e 100644
--- a/man/comm.x
+++ b/man/comm.x
@@ -3,4 +3,5 @@ comm \- compare two sorted files line by line
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-join(1), uniq(1)
+.BR join (1),
+.BR uniq (1)
diff --git a/man/dirname.x b/man/dirname.x
index 09c46e4fe..3062f220b 100644
--- a/man/dirname.x
+++ b/man/dirname.x
@@ -3,4 +3,5 @@ dirname \- strip last component from file name
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-basename(1), readlink(1)
+.BR basename (1),
+.BR readlink (1)
diff --git a/man/echo.x b/man/echo.x
index 61a36706b..be65d1640 100644
--- a/man/echo.x
+++ b/man/echo.x
@@ -3,4 +3,4 @@ echo \- display a line of text
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-printf(1)
+.BR printf (1)
diff --git a/man/env.x b/man/env.x
index c2cafbaa8..6c0a0035e 100644
--- a/man/env.x
+++ b/man/env.x
@@ -64,4 +64,6 @@ cooperating) programs."
 .RE
 
 [SEE ALSO]
-sigaction(2), sigprocmask(2), signal(7)
+.BR sigaction (2),
+.BR sigprocmask (2),
+.BR signal (7)
diff --git a/man/expand.x b/man/expand.x
index 06c538882..00f12a091 100644
--- a/man/expand.x
+++ b/man/expand.x
@@ -3,4 +3,4 @@ expand \- convert tabs to spaces
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-unexpand(1)
+.BR unexpand (1)
diff --git a/man/groups.x b/man/groups.x
index fad68455f..dab30d276 100644
--- a/man/groups.x
+++ b/man/groups.x
@@ -3,4 +3,4 @@ groups \- print the groups a user is in
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-getent(1)
+.BR getent (1)
diff --git a/man/head.x b/man/head.x
index 53d2662de..953a2ab75 100644
--- a/man/head.x
+++ b/man/head.x
@@ -3,4 +3,4 @@ head \- output the first part of files
 [DESCRIPTION]
 .\" Add any additional description here
 [SEE ALSO]
-tail(1)
+.BR tail (1)
diff --git a/man/hostid.x b/man/hostid.x
index 767a3e2b0..df82fb412 100644
--- a/man/hostid.x
+++ b/man/hostid.x
@@ -3,4 +3,4 @@ hostid \- print the numeric identifier for the current host
 [DESCRIPTION]
 .\" Add any additio

bug#49239: Unexpected results with sort -V

2022-02-13 Thread Pádraig Brady

On 13/02/2022 05:31, Paul Eggert wrote:

On 6/28/21 10:54, Kamil Dudka wrote:

You are right.  The matching algorithm was not implemented correctly and
the patch you attached fixes it.


I looked into Bug#49239 and found some more places where the
documentation disagreed with the code. I installed the attached patches
into Gnulib and Coreutils, respectively, which should bring the two into
agreement and should fix the bugs that Michael reported albeit in a
different way than his proposed patch. Briefly:

* The code didn't allow file name suffixes to be the entire file name,
but the documentation did. Here I went with the documentation. I could
be talked into the other way; it shouldn't matter much either way.

* The code did the preliminary test (without suffixes) using strcmp, the
documentation said it should use version comparison. Here I went with
the documentation.

* As Michael mentioned, sort -V mishandled NUL. I fixed this by adding a
Gnulib function filenvercmp that treats NUL as just another character.

* As Michael also mentioned, filevercmp fell back on strcmp if version
sort found no difference, which meant sort's --stable flag was
ineffective. I fixed this by not having filevercmp fall back on strcmp.

* I fixed the two-consecutive dot and trailing-dot bugs Michael
mentioned, by rewriting the suffix finder to not have that confusing
READ_ALPHA state variable, and to instead implement the regular
expression's nested * operators in the usual way with nested loops.

Thanks, Michael, for reporting the problem. I'm boldly closing the
Coreutils bug report as fixed.


A very thorough analysis.
All looks good.

thank you!
Pádraig