Re: building old coreutils versions on new glibc systems

2019-08-10 Thread Assaf Gordon
Hello,

On Sat, Aug 10, 2019 at 03:19:57PM +0200, Bernhard Voelker wrote:
> On 8/7/19 6:04 PM, Jim Meyering wrote:
> > Since it is something that may contribute to binaries I build (with
> > the handy related build target), it feels like it belongs in
> > version-control

> okay, fine.  Both variants have advantages and disadvantages, so let's
> go for the variant easier to maintain.
>
> I'll reply wrt/ the patch in the other email.

Thanks for the improved script, the suggestion and the testing.

Attached updated patch. changes are:
- moved to ./script/build-older-versions
- trimmed whitespace from patches
- used your version of the script
- added permissive license to the script
- added a short blurb at the end of the script, showing PATHs.

Comments welcomed,
 -assaf


0001-scripts-document-how-to-build-older-versions-on-newe.patch.gz
Description: application/gunzip


Re: parse-datetime.y - Military Timezones are inverted from the correct sense

2019-08-10 Thread Assaf Gordon
On Sat, Aug 10, 2019 at 01:05:23PM -0700, Paul Eggert wrote:
> > The attached patch-set includes this fix,
> > and the updated NEWS wording.
> > (I'll wait until gnulib is updated with the additional fix,
> > then create a new coreutil patch with the latest gnulib.)
>
> Thanks here too; it all sounds good.

Attached latest version (with updated gnulib, and Bernhard's
syntax-check fix).

I'll push tomorrow unless other issues pop up.

-assaf
>From 961d668eea9c94beddd309d81f65c32a133a3260 Mon Sep 17 00:00:00 2001
From: Assaf Gordon 
Date: Fri, 9 Aug 2019 19:51:42 -0600
Subject: [PATCH 1/3] gnulib: update to latest

---
 gnulib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnulib b/gnulib
index c7d0b4506..8524167df 16
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit c7d0b4506574887be5835ae9ae892d365afbb98c
+Subproject commit 8524167df6555c38079e9d041044dc59a9ddbeee
-- 
2.20.1


>From 3cbddd58fde11c911134bdfe79fc3f2579ba58e1 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker 
Date: Mon, 22 Jul 2019 08:53:28 +0200
Subject: [PATCH 2/3] maint: add lib/argmatch.h to po/POTFILES.in

* po/POTFILES.in (lib/argmatch.h): Add to avoid sc_po_check error:
"maint.mk: you have changed the set of files with translatable \
 diagnostics;"
---
 po/POTFILES.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 60c5124ac..4231f56c4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,6 +3,7 @@
 
 # These are nominally temporary...
 lib/argmatch.c
+lib/argmatch.h
 lib/closein.c
 lib/closeout.c
 lib/copy-acl.c
-- 
2.20.1


>From 725c8d6bed902a181da867a5d38efd01f62d8c9a Mon Sep 17 00:00:00 2001
From: Assaf Gordon 
Date: Fri, 9 Aug 2019 20:16:06 -0600
Subject: [PATCH 3/3] date: mention military timezone changes from gnulib

Gnulib commits f1f10d47be8762e4ca17c8957a0520b08d28abfb and
0673d8ab42c9bb0cf618a21b537cdd8fb976fb73 negated the meaning of
military timezones parsed in gnu date.
See https://lists.gnu.org/r/bug-gnulib/2019-08/msg5.html and
https://lists.gnu.org/r/coreutils/2019-08/msg00021.html

* NEWS: Mention this user-visible change.
* tests/misc/date.pl: Add tests for the new behavior.
---
 NEWS   | 13 +
 tests/misc/date.pl | 10 ++
 2 files changed, 23 insertions(+)

diff --git a/NEWS b/NEWS
index 97c9d18bd..6719e504d 100644
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,19 @@ GNU coreutils NEWS-*- 
outline -*-
   coherency of file system attributes, useful on network file systems.
 
 
+** Changes in behavior
+
+  date now parses military time zones in accordance with common usage:
+"A" to "M"  are equivalent to UTC+1 to UTC+12
+"N" to "Y"  are equivalent to UTC-1 to UTC-12
+"Z" is "zulu" time (UTC).
+  For example, 'date -d "09:00B" is now equivalent to 9am in UTC+2 time zone.
+  Previously, military time zones were parsed according to the obsolete
+  rfc822, with their value negated (e.g., "B" was equivalent to UTC-2).
+  [The old behavior was introduced in sh-utils 2.0.15 ca. 1999, predating
+  coreutils package.]
+
+
 * Noteworthy changes in release 8.31 (2019-03-10) [stable]
 
 ** Bug fixes
diff --git a/tests/misc/date.pl b/tests/misc/date.pl
index 9ba3d3983..92755b1f2 100755
--- a/tests/misc/date.pl
+++ b/tests/misc/date.pl
@@ -300,6 +300,16 @@ my @Tests =
 
  # https://bugs.gnu.org/34608
  ['date-century-plus', '-d @0 +.%+4C.', {OUT => '.+019.'}],
+
+
+ # Military time zones, new behavior (since 8.32)
+ # https://lists.gnu.org/r/bug-gnulib/2019-08/msg5.html
+ ['mtz1', '-u -d "09:00B" +%T', {OUT => '07:00:00'}],
+ ['mtz2', '-u -d "09:00L" +%T', {OUT => '22:00:00'}],
+ ['mtz3', '-u -d "09:00N" +%T', {OUT => '10:00:00'}],
+ ['mtz4', '-u -d "09:00T" +%T', {OUT => '16:00:00'}],
+ ['mtz5', '-u -d "09:00X" +%T', {OUT => '20:00:00'}],
+ ['mtz6', '-u -d "09:00Z" +%T', {OUT => '09:00:00'}],
 );
 
 # Repeat the cross-dst test, using Jan 1, 2005 and every interval from 1..364.
-- 
2.20.1



Re: parse-datetime.y - Military Timezones are inverted from the correct sense

2019-08-10 Thread Paul Eggert

Assaf Gordon wrote:


Attached suggested follow-up patch for gnulib.


Thanks for catching that; I installed it into Gnulib after updating the 
ChangeLog entry slightly (and commit message to match).



The attached patch-set includes this fix,
and the updated NEWS wording.
(I'll wait until gnulib is updated with the additional fix,
then create a new coreutil patch with the latest gnulib.)


Thanks here too; it all sounds good.



Re: parse-datetime.y - Military Timezones are inverted from the correct sense

2019-08-10 Thread Assaf Gordon
Hello,

(adding bug-gnulib again :) )

Thank you both for the review and suggestions.

On 2019-08-10 1:46 a.m., Paul Eggert wrote:
> Assaf Gordon wrote:
>> I suggest the attached patch for coreutils.
>
> OK, except I'd remove "in accordance with rfc5322" since RFC 5322
> recommends treating all these zones as if they were UTC. Also, "T"
> continues to have its military meaning (i.e., between "S" and "U") if
> it's used properly.

Good point about 'T'.
After adding an additional test for it, I realized the gnulib fix wasn't
complete because it didn't negate the 'T' value from UTC+7 to UTC-7.
Attached suggested follow-up patch for gnulib.

On Sat, Aug 10, 2019 at 05:40:30PM +0200, Bernhard Voelker wrote:
> On 8/10/19 4:26 AM, Assaf Gordon wrote:
> > This results in a user-visible change for gnu date,
> > I suggest the attached patch for coreutils.
> 
> The gnulib update requires the attached to calm down sc_po_check.
> You may squash that into your gnulib update commit (or leave it separate).

Good catch.
The attached patch-set includes this fix,
and the updated NEWS wording.
(I'll wait until gnulib is updated with the additional fix,
then create a new coreutil patch with the latest gnulib.)

regards,
 - assaf

>From 9f464d51d8311f33340942c76e758454fa59042d Mon Sep 17 00:00:00 2001
From: Assaf Gordon 
Date: Sat, 10 Aug 2019 13:17:49 -0600
Subject: [PATCH] parse-datetime: fix 'T' military timezone handling

follow-up to the previous commit: the 'T' case is handled outside the
conversion table (used as either military timezone UTC-7 or ISO8601
separator). Change it from "HOUR(7)" to "-HOUR(7)" to match other
timezone letters.

* lib/parse-datetime.y: Change 'T' value from UTC+7 yo UTC-7.
* ChangeLog: Mention the change.
---
 ChangeLog| 8 
 lib/parse-datetime.y | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7616b5efd..7c25c53e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-08-10  Assaf Gordon 
+
+   parse-datetime: fix 'T' military timezone handling
+   follow-up to the previous commit: the 'T' case is handled outside the
+   conversion table (used as either military timezone UTC-7 or ISO8601
+   separator). Change it from "HOUR(7)" to "-HOUR(7)" to match other
+   timezone letters.
+
 2019-08-09  Paul Eggert  
 
parse-datetime: fix military timezone letters
diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y
index d371b9cb1..218e3dc5b 100644
--- a/lib/parse-datetime.y
+++ b/lib/parse-datetime.y
@@ -754,14 +754,14 @@ zone:
 tZONE
   { pc->time_zone = $1; }
   | 'T'
-  { pc->time_zone = HOUR (7); }
+  { pc->time_zone = -HOUR (7); }
   | tZONE relunit_snumber
   { pc->time_zone = $1;
 if (! apply_relative_time (pc, $2, 1)) YYABORT;
 debug_print_relative_time (_("relative"), pc);
   }
   | 'T' relunit_snumber
-  { pc->time_zone = HOUR (7);
+  { pc->time_zone = -HOUR (7);
 if (! apply_relative_time (pc, $2, 1)) YYABORT;
 debug_print_relative_time (_("relative"), pc);
   }
-- 
2.20.1

>From 19f7eab06af234641a2927514c03570c07a311db Mon Sep 17 00:00:00 2001
From: Assaf Gordon 
Date: Fri, 9 Aug 2019 19:51:42 -0600
Subject: [PATCH 1/3] gnulib: update to latest

---
 gnulib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnulib b/gnulib
index c7d0b4506..f1f10d47b 16
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit c7d0b4506574887be5835ae9ae892d365afbb98c
+Subproject commit f1f10d47be8762e4ca17c8957a0520b08d28abfb
-- 
2.20.1


>From 673a0360b9dd96cfe0df017febb40980843cbb84 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker 
Date: Mon, 22 Jul 2019 08:53:28 +0200
Subject: [PATCH 2/3] maint: add lib/argmatch.h to po/POTFILES.in

* po/POTFILES.in (lib/argmatch.h): Add to avoid sc_po_check error:
"maint.mk: you have changed the set of files with translatable \
 diagnostics;"
---
 po/POTFILES.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 60c5124ac..4231f56c4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,6 +3,7 @@
 
 # These are nominally temporary...
 lib/argmatch.c
+lib/argmatch.h
 lib/closein.c
 lib/closeout.c
 lib/copy-acl.c
-- 
2.20.1


>From 0c552fac1991f49ef2db347adaed7bd82b935d70 Mon Sep 17 00:00:00 2001
From: Assaf Gordon 
Date: Fri, 9 Aug 2019 20:16:06 -0600
Subject: [PATCH 3/3] date: mention military timezone changes from gnulib

Gnulib commit f1f10d47be8762e4ca17c8957a0520b08d28abfb (based on
https://lists.gnu.org/r/bug-gnulib/2019-08/msg5.html) negated the
meaning of military timezones parsed in gnu date.

* NEWS: Mention this user-visible change.
* tests/misc/date.pl: Add tests for the new behavior.
---
 NEWS   | 13 +
 tests/misc/date.pl | 10 ++
 2 files changed, 23 insertions(+)

diff --git a/NEWS b/NEWS
index 97c9d18bd..6719e504d 100644
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,19 @@ GNU coreutils NEWS   

Re: parse-datetime.y - Military Timezones are inverted from the correct sense

2019-08-10 Thread Bernhard Voelker
[removing bug-gnulib]

On 8/10/19 4:26 AM, Assaf Gordon wrote:
> This results in a user-visible change for gnu date,
> I suggest the attached patch for coreutils.

Thanks, the tests look good.

The gnulib update requires the attached to calm down sc_po_check.
You may squash that into your gnulib update commit (or leave it separate).

Have a nice day,
Berny
>From 7f7ad9de6e79889253dcf4bb4626d24c644b6eab Mon Sep 17 00:00:00 2001
From: Bernhard Voelker 
Date: Mon, 22 Jul 2019 08:53:28 +0200
Subject: [PATCH] maint: add lib/argmatch.h to po/POTFILES.in

* po/POTFILES.in (lib/argmatch.h): Add to avoid sc_po_check error:
"maint.mk: you have changed the set of files with translatable \
 diagnostics;"
---
 po/POTFILES.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 60c5124ac..4231f56c4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,6 +3,7 @@
 
 # These are nominally temporary...
 lib/argmatch.c
+lib/argmatch.h
 lib/closein.c
 lib/closeout.c
 lib/copy-acl.c
-- 
2.22.0



Re: building old coreutils versions on new glibc systems

2019-08-10 Thread Bernhard Voelker
On 8/7/19 6:04 PM, Jim Meyering wrote:
> Since it is something that may contribute to binaries I build (with
> the handy related build target), it feels like it belongs in
> version-control. Otherwise, if downloading from some web site, we'd
> have to verify the patches via gpg-signature or checksum before using
> them to build new binaries.

okay, fine.  Both variants have advantages and disadvantages, so let's
go for the variant easier to maintain.

I'll reply wrt/ the patch in the other email.

Have a nice day,
Berny



Re: building old coreutils versions on new glibc systemsy

2019-08-10 Thread Bernhard Voelker
On 8/3/19 4:30 AM, Assaf Gordon wrote:
> Attached a patch to add these (+ README + build script)
> to a new 'contrib' directory.
> 
> NOTE:
> I had to disable the 'commit-msg' hook (for the 'contrib' prefix)
> and the 'precommit' hook (because the patch files contains spaces at
> end of lines, and lines longer than 80 characters).

The whole stuff could go into 'scripts' instead of a new 'contrib'.

> Not sure if this is valid, or will cause troubles later on.
> An alternative might be to gzip the patches before commiting?
> Ideas welcomed.

Of course, I immediately tried to build and install all versions
which are possible with it since 5.0. ;-)

My observation was that the locale data and the info files were
overwritten by each next version being installed.
Earlier versions' configure script have a slightly different
set of options to control where those files go.  Therefore,
I suggest to simply install each version in it's own
directory beneath PREFIX, e.g. $PREFIX/coreutils-5.0, and
then add symlinks to the executables and manpages to common
$PREFIX/{bin,man} directories which one could add to PATH/MANPATH.
WDYT - the attached does this.

Furthermore, it:
- allows builds of newer versions which don't need a patch (>=8.30).
- adds error handling to trivial cd/mkdir commands,
- builds and installs PDF documentation.

Have a nice day,
Berny


build-older-versions.sh.tar.xz
Description: application/xz


Re: parse-datetime.y - Military Timezones are inverted from the correct sense

2019-08-10 Thread Paul Eggert

Assaf Gordon wrote:

I suggest the attached patch for coreutils.


OK, except I'd remove "in accordance with rfc5322" since RFC 5322 recommends 
treating all these zones as if they were UTC. Also, "T" continues to have its 
military meaning (i.e., between "S" and "U") if it's used properly.