CVS commit: src/tests/sbin/gpt

2022-11-21 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Nov 21 16:06:00 UTC 2022

Modified Files:
src/tests/sbin/gpt: t_gpt.sh

Log Message:
Adapt to recent gpt(8) change which now issues a message when
the secondary GPT header is moved.   Do it this way rather than
just using -q to suppress the message, so the test verifies that
the appropriate action was taken.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/sbin/gpt/t_gpt.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/sbin/gpt

2022-11-21 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Nov 21 16:06:00 UTC 2022

Modified Files:
src/tests/sbin/gpt: t_gpt.sh

Log Message:
Adapt to recent gpt(8) change which now issues a message when
the secondary GPT header is moved.   Do it this way rather than
just using -q to suppress the message, so the test verifies that
the appropriate action was taken.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/sbin/gpt/t_gpt.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/gpt/t_gpt.sh
diff -u src/tests/sbin/gpt/t_gpt.sh:1.16 src/tests/sbin/gpt/t_gpt.sh:1.17
--- src/tests/sbin/gpt/t_gpt.sh:1.16	Wed Mar 22 19:13:40 2017
+++ src/tests/sbin/gpt/t_gpt.sh	Mon Nov 21 16:06:00 2022
@@ -1,4 +1,4 @@
-# $NetBSD: t_gpt.sh,v 1.16 2017/03/22 19:13:40 martin Exp $
+# $NetBSD: t_gpt.sh,v 1.17 2022/11/21 16:06:00 kre Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -239,7 +239,7 @@ resize_2part_head() {
 resize_2part_body() {
 	prepare_2part
 	zerodd seek="$newsize" count=1
-	silence gpt resizedisk "$disk"
+	match 'Moving secondary GPT header' gpt resizedisk "$disk"
 	file "$src/gpt.resizedisk.show.normal" gpt show "$disk"
 	match "$(partresmsg 2 1058 19390)" gpt resize -i 2 "$disk"
 	file "$src/gpt.resizepart.show.normal" gpt show "$disk"



CVS commit: src/external/public-domain/tz/dist

2022-10-30 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 10:00:16 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: backward

Log Message:
Add missing backward compat links that were in the tzdata2022f
release, but didn't make it into the tzdata2022fgtz fork that
we use - and nor did the original zone data come back.

Links seem adequate for these (and were all some of them ever were).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/public-domain/tz/dist/backward

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/public-domain/tz/dist/backward
diff -u src/external/public-domain/tz/dist/backward:1.5 src/external/public-domain/tz/dist/backward:1.6
--- src/external/public-domain/tz/dist/backward:1.5	Wed Sep 28 12:34:50 2022
+++ src/external/public-domain/tz/dist/backward	Sun Oct 30 10:00:16 2022
@@ -72,10 +72,13 @@ Link	America/Sao_Paulo	Brazil/East
 Link	America/Manaus		Brazil/West
 Link	America/Halifax		Canada/Atlantic
 Link	America/Winnipeg	Canada/Central
+Link	America/Winnipeg	America/Rainy_River
 # This line is commented out, as the name exceeded the 14-character limit
 # and was an unused misnomer.
 #Link	America/Regina		Canada/East-Saskatchewan
 Link	America/Toronto		Canada/Eastern
+Link	America/Toronto		America/Nipigon
+Link	America/Toronto		America/Thunder_Bay
 Link	America/Edmonton	Canada/Mountain
 Link	America/St_Johns	Canada/Newfoundland
 Link	America/Vancouver	Canada/Pacific
@@ -125,6 +128,7 @@ Link	Asia/Taipei		ROC
 Link	Asia/Seoul		ROK
 Link	Asia/Singapore		Singapore
 Link	Europe/Istanbul		Turkey
+Link	Europe/Istanbul		Asia/Istanbul
 Link	Etc/UTC			UCT
 Link	America/Anchorage	US/Alaska
 Link	America/Adak		US/Aleutian
@@ -142,3 +146,9 @@ Link	Etc/UTC			UTC
 Link	Etc/UTC			Universal
 Link	Europe/Moscow		W-SU
 Link	Etc/UTC			Zulu
+Link	Etc/GMT			Etc/GMT+0
+Link	Etc/GMT			Etc/GMT-0
+Link	Etc/GMT			Etc/GMT0
+Link	Etc/GMT			Etc/Greenwich
+Link	Etc/UTC			Etc/Universal
+Link	Etc/UTC			Etc/Zulu



CVS commit: src/external/public-domain/tz/dist

2022-10-30 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 10:00:16 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: backward

Log Message:
Add missing backward compat links that were in the tzdata2022f
release, but didn't make it into the tzdata2022fgtz fork that
we use - and nor did the original zone data come back.

Links seem adequate for these (and were all some of them ever were).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/public-domain/tz/dist/backward

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-10-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 01:46:17 UTC 2022

Modified Files:
src/bin/sh: jobs.c

Log Message:
PR bin/57053 is related (peripherally) here.

sh has been remembering the process group of a job for a while now, but
using that for almost nothing.

The old way to resume a job, was to try each pid in the job with a
SIGCONT (using it as the process group identifier via killpg()) until
one worked (or none did, in which case resuming would be impossible,
but that never actually happened).   This wasn't as bad as it seems,
as in practice the first process attempted was *always* the correct
one.  Why the loop was considered necessary I am not sure.  Nothing
but the first could possibly work.

This worked until a fix for an obscure possible bug was added a
while ago - now a process which has already finished, and had its
zombie collected via wait*() is no longer ever considered to have
a pid which is a candidate for use in any system call.  That's
because the kernel might have reassigned that pid for some newly
created process (we have no idea how much time might have passed
since the pid was returned to the kernel for reuse, it might have
happened weeks ago).

This is where the example in bin/57053 revealed a problem.

That PR is really about a quite different problem in zsh (from pksrc)
and should be pkg/57053, but as the test case also hit the problem
here, it was assumed (by some) they were the same issue.

The example is (in a small directory)
ls | less
which is then suspended (^Z), and resumed (fg).   Since the directory
is small, ls will be finished, and reaped by sh - so the code would
now refuse to use its pid for the killpg() call to send the SIGCONT.
The (useless) loop would attempt to use less's pid for this purpose
(it is still alive at this point) but that would fail, as that pid
is not a process group identifier, of anything.   Hence the job
could not be resumed.

Before the PR (or preceding mailing list discussion) the change here
had already been made (part of a much bigger set of changes, some of
which might follow - sometime).   We now actually use the job's
remembered process group identifier when we want the process group
identifier, instead of trying to guess which pid it happens to be
(which actually never took any guessing, it was, and is always the
pid of the first process created for the job).   A couple of minor
fixes to how the pgrp is obtained, and used, accompany the changes
to use it when appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/bin/sh/jobs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/jobs.c
diff -u src/bin/sh/jobs.c:1.116 src/bin/sh/jobs.c:1.117
--- src/bin/sh/jobs.c:1.116	Mon Apr 18 06:02:27 2022
+++ src/bin/sh/jobs.c	Sun Oct 30 01:46:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.116 2022/04/18 06:02:27 kre Exp $	*/
+/*	$NetBSD: jobs.c,v 1.117 2022/10/30 01:46:16 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c	8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.116 2022/04/18 06:02:27 kre Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.117 2022/10/30 01:46:16 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -267,11 +267,7 @@ do_fgcmd(const char *arg_ptr)
 	out1c('\n');
 	flushall();
 
-	for (i = 0; i < jp->nprocs; i++)
-	if (tcsetpgrp(ttyfd, jp->ps[i].pid) != -1)
-		break;
-
-	if (i >= jp->nprocs) {
+	if (tcsetpgrp(ttyfd, jp->pgrp) == -1) {
 		error("Cannot set tty process group (%s) at %d",
 		strerror(errno), __LINE__);
 	}
@@ -376,6 +372,9 @@ restartjob(struct job *jp)
 
 	if (jp->state == JOBDONE)
 		return;
+	if (jp->pgrp == 0)
+		error("Job [%d] does not have a process group", JNUM(jp));
+
 	INTOFF;
 	for (e = i = 0; i < jp->nprocs; i++) {
 		/*
@@ -390,13 +389,16 @@ restartjob(struct job *jp)
 		 * Otherwise tell it to continue, if it worked, we're done
 		 * (we signal the whole process group)
 		 */
-		if (killpg(jp->ps[i].pid, SIGCONT) != -1)
+		if (killpg(jp->pgrp, SIGCONT) != -1)
 			break;
-		if (e == 0 && errno != ESRCH)
-			e = errno;
+		e = errno;
+		break;		/* no point trying again */
 	}
-	if (i >= jp->nprocs)
-		error("Cannot continue job (%s)", strerror(e ? e : ESRCH));
+
+	if (e != 0)
+		error("Cannot continue job (%s)", strerror(e));
+	else if (i >= jp->nprocs)
+		error("Job [%d] has no stopped processes", JNUM(jp));
 
 	/*
 	 * Now change state of all stopped processes in the job to running
@@ -436,8 +438,8 @@ showjob(struct output *out, struct job *
 
 #if JOBS
 	if (mode & SHOW_PGID) {
-		/* just output process (group) id of pipeline */
-		outfmt(out, "%ld\n", (long)jp->ps->pid);
+		/* output only the process group ID (lead process ID) */
+		outfmt(out, "%ld\n", (long)jp->pgrp);
 		return;
 	}
 #endif
@@ -1206,14 +1208,19 @@ forkshell(struct job *jp, union node *n,
 int
 

CVS commit: src/bin/sh

2022-10-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 01:46:17 UTC 2022

Modified Files:
src/bin/sh: jobs.c

Log Message:
PR bin/57053 is related (peripherally) here.

sh has been remembering the process group of a job for a while now, but
using that for almost nothing.

The old way to resume a job, was to try each pid in the job with a
SIGCONT (using it as the process group identifier via killpg()) until
one worked (or none did, in which case resuming would be impossible,
but that never actually happened).   This wasn't as bad as it seems,
as in practice the first process attempted was *always* the correct
one.  Why the loop was considered necessary I am not sure.  Nothing
but the first could possibly work.

This worked until a fix for an obscure possible bug was added a
while ago - now a process which has already finished, and had its
zombie collected via wait*() is no longer ever considered to have
a pid which is a candidate for use in any system call.  That's
because the kernel might have reassigned that pid for some newly
created process (we have no idea how much time might have passed
since the pid was returned to the kernel for reuse, it might have
happened weeks ago).

This is where the example in bin/57053 revealed a problem.

That PR is really about a quite different problem in zsh (from pksrc)
and should be pkg/57053, but as the test case also hit the problem
here, it was assumed (by some) they were the same issue.

The example is (in a small directory)
ls | less
which is then suspended (^Z), and resumed (fg).   Since the directory
is small, ls will be finished, and reaped by sh - so the code would
now refuse to use its pid for the killpg() call to send the SIGCONT.
The (useless) loop would attempt to use less's pid for this purpose
(it is still alive at this point) but that would fail, as that pid
is not a process group identifier, of anything.   Hence the job
could not be resumed.

Before the PR (or preceding mailing list discussion) the change here
had already been made (part of a much bigger set of changes, some of
which might follow - sometime).   We now actually use the job's
remembered process group identifier when we want the process group
identifier, instead of trying to guess which pid it happens to be
(which actually never took any guessing, it was, and is always the
pid of the first process created for the job).   A couple of minor
fixes to how the pgrp is obtained, and used, accompany the changes
to use it when appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/bin/sh/jobs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-10-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 01:19:08 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Note in the description of "jobs -p" that the process id returned is
also the process group identifier (that's a requirement from POSIX, and
is what we have always done - just not been explicit about in sh.1).
Add a note that this value and $! are not necessarily the same (currently,
and perhaps forever, never the same in a pipeline with 2 or more elements).


To generate a diff of this commit:
cvs rdiff -u -r1.250 -r1.251 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-10-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 01:19:08 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Note in the description of "jobs -p" that the process id returned is
also the process group identifier (that's a requirement from POSIX, and
is what we have always done - just not been explicit about in sh.1).
Add a note that this value and $! are not necessarily the same (currently,
and perhaps forever, never the same in a pipeline with 2 or more elements).


To generate a diff of this commit:
cvs rdiff -u -r1.250 -r1.251 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.250 src/bin/sh/sh.1:1.251
--- src/bin/sh/sh.1:1.250	Sun Sep 18 06:03:19 2022
+++ src/bin/sh/sh.1	Sun Oct 30 01:19:08 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.250 2022/09/18 06:03:19 kre Exp $
+.\"	$NetBSD: sh.1,v 1.251 2022/10/30 01:19:08 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -3310,7 +3310,11 @@ status of each process, rather than the 
 With the
 .Fl p
 flag, the output contains only the process identifier of the lead
-process.
+process (which is also the process group identifier).
+Note that this is not necessarily the same process identifier as
+reported in the special parameter
+.Dv \&!
+when a background job is started.
 .Pp
 With the
 .Fl Z



CVS commit: src/doc

2022-10-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 01:05:47 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note tzdata 2022f update (via 2022fgtz)


To generate a diff of this commit:
cvs rdiff -u -r1.1897 -r1.1898 src/doc/3RDPARTY
cvs rdiff -u -r1.2927 -r1.2928 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1897 src/doc/3RDPARTY:1.1898
--- src/doc/3RDPARTY:1.1897	Sat Oct 29 13:57:38 2022
+++ src/doc/3RDPARTY	Sun Oct 30 01:05:47 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1897 2022/10/29 13:57:38 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1898 2022/10/30 01:05:47 kre Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1424,7 +1424,7 @@ Location:	external/bsd/tradcpp
 Notes:
 
 Package:	tz
-Version:	tzcode2022f / tzdata2022egtz
+Version:	tzcode2022f / tzdata2022fgtz
 Current Vers:	tzcode2022f / tzdata2022f
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2927 src/doc/CHANGES:1.2928
--- src/doc/CHANGES:1.2927	Sat Oct 29 13:57:38 2022
+++ src/doc/CHANGES	Sun Oct 30 01:05:47 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2927 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2928 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -713,3 +713,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	evbarm: Update Xilinx Zynq-7000 SoC support to use FDT based
 		configuration. [jmcneill 20221028]
 	tzcode: Updated to 2022f. [christos 20221029]
+	tzdata: updated to 2022f (using the 2022fgtz fork) [kre 20221030]



CVS commit: src/doc

2022-10-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 01:05:47 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note tzdata 2022f update (via 2022fgtz)


To generate a diff of this commit:
cvs rdiff -u -r1.1897 -r1.1898 src/doc/3RDPARTY
cvs rdiff -u -r1.2927 -r1.2928 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/public-domain/tz/dist

2022-10-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 01:03:46 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: TZDATA_VERSION

Log Message:
Merge tzdata2022f


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/external/public-domain/tz/dist/TZDATA_VERSION

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/public-domain/tz/dist/TZDATA_VERSION
diff -u src/external/public-domain/tz/dist/TZDATA_VERSION:1.30 src/external/public-domain/tz/dist/TZDATA_VERSION:1.31
--- src/external/public-domain/tz/dist/TZDATA_VERSION:1.30	Thu Oct 13 11:25:52 2022
+++ src/external/public-domain/tz/dist/TZDATA_VERSION	Sun Oct 30 01:03:46 2022
@@ -1 +1 @@
-tzdata-2022e
+tzdata-2022f



CVS commit: src/external/public-domain/tz/dist

2022-10-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 01:03:46 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: TZDATA_VERSION

Log Message:
Merge tzdata2022f


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/external/public-domain/tz/dist/TZDATA_VERSION

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS import: src/external/public-domain/tz/dist

2022-10-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 01:03:08 UTC 2022

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv13088

Log Message:
Import tzdata2022f from
   
https://github.com/JodaOrg/global-tz/releases/download/2022fgtz/tzdata2022fgtz.tar.gz

Summary of changes in tzdata2022f (2022-10-28 18:04:57 -0700):
  * Mexico will no longer observe DST after 2022, except for areas
near the US border that continue to observe US DST rules.
  * Fiji will not observe DST in 2022/3.
  * Simplify four Ontario zones, as most of the post-1970 differences
seem to have been imaginary.

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2022FGTZ

U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/SECURITY
U src/external/public-domain/tz/dist/theory.html
C src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
C src/external/public-domain/tz/dist/asia
C src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
C src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
U src/external/public-domain/tz/dist/leap-seconds.list
U src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk

4 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA 
src/external/public-domain/tz/dist



CVS import: src/external/public-domain/tz/dist

2022-10-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 30 01:03:08 UTC 2022

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv13088

Log Message:
Import tzdata2022f from
   
https://github.com/JodaOrg/global-tz/releases/download/2022fgtz/tzdata2022fgtz.tar.gz

Summary of changes in tzdata2022f (2022-10-28 18:04:57 -0700):
  * Mexico will no longer observe DST after 2022, except for areas
near the US border that continue to observe US DST rules.
  * Fiji will not observe DST in 2022/3.
  * Simplify four Ontario zones, as most of the post-1970 differences
seem to have been imaginary.

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2022FGTZ

U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/SECURITY
U src/external/public-domain/tz/dist/theory.html
C src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
C src/external/public-domain/tz/dist/asia
C src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
C src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
U src/external/public-domain/tz/dist/leap-seconds.list
U src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk

4 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA 
src/external/public-domain/tz/dist



Re: CVS commit: src/lib/libc/time

2022-10-26 Thread Robert Elz
Date:Wed, 26 Oct 2022 10:42:15 -0400
From:Jan Schaumann 
Message-ID:  

  | New proposal:

That looks better (it needs some minor wording changes,
there are too many indefinite articles ('a') which aren't
needed, and there midnight should be just that, no hyphen
or space -- but that's all trivia).

kre



CVS commit: src/lib/libc/time

2022-10-25 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Oct 25 08:07:08 UTC 2022

Modified Files:
src/lib/libc/time: strftime.3

Log Message:
Fix a merge or conversion problem (probably) - a .SH BUGS
(meaningless macro in mdoc) followed by the first line of the
real BUGS section somehow ended up inserted after the first
word of the STANDARDS section.   Delete the noise.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/time/strftime.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/strftime.3
diff -u src/lib/libc/time/strftime.3:1.36 src/lib/libc/time/strftime.3:1.37
--- src/lib/libc/time/strftime.3:1.36	Fri Oct  9 18:38:48 2020
+++ src/lib/libc/time/strftime.3	Tue Oct 25 08:07:07 2022
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)strftime.3	5.12 (Berkeley) 6/29/91
-.\"	$NetBSD: strftime.3,v 1.36 2020/10/09 18:38:48 christos Exp $
+.\"	$NetBSD: strftime.3,v 1.37 2022/10/25 08:07:07 kre Exp $
 .\"
 .Dd October 9, 2020
 .Dt STRFTIME 3
@@ -264,8 +264,6 @@ in a
 .Xr tm 3
 .Sh STANDARDS
 The
-.SH BUGS
-There is no conversion specification for the phase of the moon.
 .Fn strftime
 function
 conforms to



CVS commit: src/lib/libc/time

2022-10-25 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Oct 25 08:07:08 UTC 2022

Modified Files:
src/lib/libc/time: strftime.3

Log Message:
Fix a merge or conversion problem (probably) - a .SH BUGS
(meaningless macro in mdoc) followed by the first line of the
real BUGS section somehow ended up inserted after the first
word of the STANDARDS section.   Delete the noise.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/time/strftime.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/lib/libc/time

2022-10-24 Thread Robert Elz
Date:Sun, 23 Oct 2022 13:53:01 -0400
From:Jan Schaumann 
Message-ID:  

  | Hmm, maybe something like this?

I think there is still too much there, you don't have
to explain everything (or almost anything), but it is
in the right direction I think.

  | For example, consider a struct tm initialized with a
  | tm_year = 122, tm_mon = 11, tm_mday = 30, tm_hour =
  | 22, tm_min = 57, and a tm_sec = 0, using UTC,
  | representing 2022‐12‐31T22:57:00Z.

That last bit (the ISO format spec of the time) isn't
really needed, but doesn't hurt either - but I would avoid
an example that touches anywhere near midnight Dec 31, UTC,
(which this one does later, if not here) as that's exactly
where leap seconds start to appear, and (as illustrated in
the side-discussion in this thread) that's where things get messy.
Best to just avoid that  (Avoid June 30 for the same reason.)

  | Incrementing
  | tm_min by 13 and calling mktime() would yield a time_t
  | with value 1672528200,

That's irrelevant, the time_t returned isn't what's really
interesting here, and its binary value is way too much (useless)
information, it is the modification made to the tm that matters.
It is already clear enough in the doc (I think) that the result
from mktime() is the time_t for the normalised tm.

  | representing 2022‐12‐31T23:10:00Z,

this, or just give the adjusted tm_min and tm_hour
values, there's no need for both, and

  | as the tm_min = 70 was
  | normalized to an increment of tm_hour by one and
  | tm_min = 10.

no need for the explanation of how it was done.

  | This normalizing can lead to cascading changes: Again
  | using a struct tm initialized as in the above example
  | but with a tm_hour = 23, the same change would yield a
  | time_t with value 1672531800, representing
  | 2023‐01‐01T00:10:00Z

That's the adjustment we want to avoid, as it gets right into
what happens if we're observing leap seconds, and one was to
happen in that period.There's no need to show the year being
incremented, showing the month going up would be enough, readers
ought to be able to deduce that if the month changes from Dec to
Jan then the year would be incremented by one.

  | the normalization of tm_min incremented tm_hour,

This explanation is not needed, but if it were, that
would be correct, but

  | which lead to a normalization of tm_mday, which in
  | turn caused tm_mon to be normalized,

but not those.   Those fields (in this example) were
already within the appropriate range, they don't need
to be normalised, they're simply adjusted, or as in
this (or tm_hour above):

  | which in turn lead to the increment of tm_year.

  | In addition,

That's perhaps poor wording here, "addition" followed
immediately by "negative", it could be "Also" which
avoids this, but this lead in clause is not really
needed at all, just begin like:

  | negative values may also be normalized,
  | such that e.g., a tm_hour of −1 means 1 hour before
  | midnight, tm_mday of 0 means the day preceding the
  | current month, and tm_mon of −2 means 2 months before
  | January of tm_year.

Again, too much there, we don't need examples of everything.

I still feel though that an example with more than one adjustment
to a tm returned by localtime (though how it was originally
created is irrelevant) and which would affect Feb 29 were
it a leap year, would be worth giving (in both the leap
year and non leap year cases) so we get Feb 29 in one
case and Mar 1 in the other, from an adjustment that
affects months (and days, either directly, or as a flow on
from hours, mins, or secs) - like going back a month from
Mar 28, then forward to the next day, and sometimes still
being in Mar.

  | The fact that mktime(2) returns a time_t makes the
  | phrasing even more awkward,

Yes, as above.

  | and I suppose we could
  | leave out the actual value and say "would yield a
  | time_t representing..."?

No, nothing about the result returned at all, this should
all just be about what normalising the tm causes to happen.
Those values are not just internal, the tm passed (via ref)
is modified if needed before mktime returns.

kre



Re: CVS commit: src/lib/libc/time

2022-10-22 Thread Robert Elz
Date:Sat, 22 Oct 2022 20:17:57 -0600
From:Warner Losh 
Message-ID:  



  | On the other hand, adding a caveat that leap seconds don't exist in a POSIX
  | time_t and that's necessarily reflected in the normalization wouldn't be
  | bad.

The problem with doing that is that while we don't install it this
way, it is possible to install tzdata such that leap seconds do occur
(despite that not being posix) either unconditionally, or installing
both and leaving it up to the user by their choice of timezone to use
(which makes rather a mess).

The code works with either set of tzdata files, POSIX stretchy secs,
or UTC with leap secs - claiming that one doesn't happen, or cannot
happen, isn't really correct.

kre




Re: CVS commit: src/lib/libc/time

2022-10-22 Thread Robert Elz
Date:Sun, 23 Oct 2022 08:33:18 +0700
From:Robert Elz 
Message-ID:  <7638.1666488...@jacaranda.noi.kre.to>

  | and tm_min was incremented as tm_min+=180, and then
  | mktime() called upon the result, the struct tm would
  | now have tm_min==1 tm_hour==24 and tm_mday==20, with

That is nonsense of course, but I think you get the idea
(and being nonsense shows why the examples should be
tested )

kre


Re: CVS commit: src/lib/libc/time

2022-10-22 Thread Robert Elz
Date:Sat, 22 Oct 2022 13:42:54 -0400
From:Jan Schaumann 
Message-ID:  

  | A full set of examples strikes me as too much here

A full set would be yes, but I think we could handle 3.
They don't need to be C code examples, just something
like
if tm_year==2022 tm_mon==10 tm_mday==19
   tm_hour==23 tm_min==58 tm_sec==17 and tm_dst==-1

and tm_min was incremented as tm_min+=180, and then
mktime() called upon the result, the struct tm would
now have tm_min==1 tm_hour==24 and tm_mday==20, with
tm_isdst 0 or 1 depending upon the local time zone.
The other fields shown would not be altered in this
example, the fields of struct tm not show here would
(tm_wday, ...) would be filled in with appropriate values.

[Using tm_min rather than tm_sec to avoid needing to include
caveats about possible leap seconds, which, at least currently,
could never happen in November, but all of that is too much
to bother with.]

The other examples could be even shorter, no need to repeat
the final sentence about the other field changes or otherwise.

  | Perhaps:
  |
  | This normalization is done in order from tm_sec up to
  | tm_year,

No, that is what you cannot say, because it is wrong.

We do not always start from tm_sec, and tm_mon is *always*
normalised (with its possible flow on to tm_year) before
tm_mday - nothing else makes sense.   tm_year isn't
"normalized" at all, though it might be adjusted.

But all of this is what we already agreed is too much
to explain.   And no matter how simple it makes things,
the man pages cannot (deliberately) lie.

  | possibly leading to cascading values.  That
  | is, a tm_sec value of e.g., 185 with a tm_min value of
  | 58 could lead to an increment of tm_min by three, and
  | thus further incrementing tm_hour by one, and so on.

This is more explaining how it works, which if we do at all,
we need to do correctly.   That's where a few examples can
be better, they allow the reader to deduce what probably
happens, the weird one is there to show that the results
will not always be what is expected at first glance, but
that they always are correct.

  | As with most things relating to
  | time, dates, and calendars, the full details of these
  | side effects are often non‐obvious, and it may be best
  | to avoid such scenarios.

And that part is just useless, unless you mean that non-normalised
values should never be used, perhaps just in some fields (and it
isn't that anyway, a big enough increment of tm_sec is the same
as an increment of tm_mday or tm_mon) in which case we should just
say that.   If not that, then hinting that it is sometimes odd,
and those cases, which ones we refuse to tell you, should be
avoided is a complete waste of time.   Which scenarios should be
avoided?   The answer really is none of them, the answer is
always correct, it just might not be what the user expected.

kre



Re: CVS commit: src/lib/libc/time

2022-10-22 Thread Robert Elz
Date:Fri, 21 Oct 2022 15:00:41 -0400
From:Jan Schaumann 
Message-ID:  

  | I believe that it's useful for people to know that
  | values outside the normal ranges are normalized,

Agreed.

  | as well as what that might look like.

The problem with trying to specify that, as we have
discovered, is that it is not easy.   The problem with
only doing half of the job here, is that sometime later
someone will read it, see what it says happens, and
what it doesn't say, and then expect the code to do
that - when it probably doesn't.

I'll come back to the rest of your message a bit lower,
but first a brief interlude ...

jo...@bec.de said:
  | I'd actually weasle out a bit

Yes, I would too, but

jo...@bec.de continued:
  | and just declare that normalisation is best effort and we
  | don't guarantee behavior for values that are very much outside
  | the range of the corresponding field. E.g. anything where
  | numerical overflow can happen in a component.

that isn't really the problem.  tzcode is very careful with arithmetic
to avoid those kinds of problems - if there's anywhere that it isn't
(which is still possible) that would be fixed if pointed out.

The problem is just the complexity of specifying what does happen,
in a way that fits the manual page in a way that is easier to
follow that simply reading the source (which isn't all that easy).

Now we return to the originally scheduelled e-mail:

jscha...@netmeister.org said:
  | That helps a lot when trying to determine _why_ the
  | output of mktime(3) [...]

  | Noting that values may cascade is useful [...]

I wonder if rather than attempting to specify what happens,
it might be better in this case to give examples of using
struct tm alterations, followed by mktime(), to alter the time,
and what the results are.

I'm not generally much in favour of examples in man pages,
I prefer specification, and leave it up to the reader to
determine how to use things to achieve the desired result,
as while giving an example or two (or three) of what can be
done is great for people who want to do one of those exact
things (and so can just copy the example) but is useless for
someone whose needs are different than any of the examples,
and is left trying to guess what will happen.

But here a two or three good examples of what happens might
just be a sane solution, perhaps two fairly simple ones, but
which demonstrate what happens with addition, and subtraction
- using just one field modification, but having that result in
a cascade through a few of the other fields - perhaps the 180
seconds forward, starting at 23:58 on the last day of some
month, and 32 hours backwards starting at 01:15 on the second
of a month.Those should both produce entirely reasonable
and understandable results.

The third should show multiple modifications, in a way that produces,
or can do, a surprising result, perhaps 14 days forward, also
2 months forward, and some irrelevant small number of minutes backward
(that just to show that multiple fields can be altered, and they don't
need to all go in the same direction) starting at 13:27 on Dec 15 - where
the result can be Feb 29, or Mar 1 (at something a bit earlier than 13:27,
perhaps even make the number of minutes subtracted > 27 in that example)
depending upon whether the year is a leap year or not.   (Or make it
6 months forward (plus...) starting from August).  This one should be
one full example, with something like "if the starting year had been
 then the result would have been" added to show the difference
between leap years and others.

If this is done, the examples should all be tested to verify the
claimed results, but the man page should not need a lot of explanation
of why the result shown is achieved, just the input, the modification
made, and the result.

kre



Re: CVS commit: src/lib/libc/time

2022-10-21 Thread Robert Elz
Date:Fri, 21 Oct 2022 11:54:08 -0400
From:Jan Schaumann 
Message-ID:  

  | Right, but all that strikes me as too much to put into
  | the manual page here.

I agree, which is why I wondered if we should be giving any
details about how it is done at all.

  | I think what matters in this context is that there is
  | an order and that there is a cascading effect.

Perhaps, but

  | "This normalization is done in order from tm_sec to
  | tm_mon (inclusive), possibly leading to cascading
  | values."

As a generic order, that's backwards.   Really we need to
go from year (which is always OK) to month (which can always
be corrected simply, assuming the Gregorian calendar is in
effect, which we assume it is, even for years before that
calendar was created).   Once we know the year and month,
but not before, the day of month can be corrected (which
might then affect the month and year, but only once).

The code doesn't do it in quite that order, it does the
secs mins hours first, but doing it that way ensures that
the hours correction cannot affect the day, after it has
been corrected, the day(of month) always gets set last
(leap seconds excepted).

It really is moderately complicated - trying to explain it
at all risks being simply wrong, or so vague as to be
completely useless.I'm not sure that what was there
before (no details at all, just (in other words) "it gets
fixed") wasn't as good as is reasonable to expect.

kre



Re: CVS commit: src/lib/libc/time

2022-10-21 Thread Robert Elz
Date:Fri, 21 Oct 2022 10:36:23 -0400
From:Jan Schaumann 
Message-ID:  


  | Perhaps like this?

Like that, yes, but as you wrote it isn't how it is actually
done I believe.

The order looks to be secs, mins, hours, month, day(of month).

There's no normalisation of the year (no invalid values to correct)
though the year can be adjusted when the month is adjusted.

That order is assuming that the system is using posix stretchy seconds,
rather than UTC (with leap seconds), but almost all NetBSD systems
work that way - if UTC is being used, then secs cannot be done first,
as until the rest of the data/time is known, it is unknown whether
the number of seconds permitted is 59 60 or 61.   With POSIX seconds
the secs/mins/hours correction order doesn't really matter, as there
are always 0..59 secs, 0..59 mins, and 0..23 hours, the rest of the
fields have no impact at all.

kre



Re: CVS commit: src/lib/libc/time

2022-10-21 Thread Robert Elz
Date:Fri, 21 Oct 2022 03:05:15 +
From:"Jan Schaumann" 
Message-ID:  <20221021030515.cdc9df...@cvs.netbsd.org>

  | Note normalizing behavior of mktime(3) using language from FreeBSD.

If we are going to start specifying what happens (how the struct tm
is normalised) then we really also need to specify in which order
the fields are corrected.   It makes a difference.

kre



CVS commit: src/crypto/external/bsd/openssh/dist

2022-10-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Oct 18 06:46:51 UTC 2022

Modified Files:
src/crypto/external/bsd/openssh/dist: auth2.c

Log Message:
Avoid sending banner (if configured) twice.   Apparent merge error.
Patch from RVP (issue noticed by John D. Baker).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/crypto/external/bsd/openssh/dist/auth2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/openssh/dist/auth2.c
diff -u src/crypto/external/bsd/openssh/dist/auth2.c:1.25 src/crypto/external/bsd/openssh/dist/auth2.c:1.26
--- src/crypto/external/bsd/openssh/dist/auth2.c:1.25	Wed Feb 23 19:07:20 2022
+++ src/crypto/external/bsd/openssh/dist/auth2.c	Tue Oct 18 06:46:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: auth2.c,v 1.25 2022/02/23 19:07:20 christos Exp $	*/
+/*	$NetBSD: auth2.c,v 1.26 2022/10/18 06:46:51 kre Exp $	*/
 /* $OpenBSD: auth2.c,v 1.164 2022/02/23 11:18:13 djm Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: auth2.c,v 1.25 2022/02/23 19:07:20 christos Exp $");
+__RCSID("$NetBSD: auth2.c,v 1.26 2022/10/18 06:46:51 kre Exp $");
 
 #include 
 #include 
@@ -158,7 +158,7 @@ userauth_send_banner(struct ssh *ssh, co
 	(r = sshpkt_put_cstring(ssh, msg)) != 0 ||
 	(r = sshpkt_put_cstring(ssh, "")) != 0 ||	/* language, unused */
 	(r = sshpkt_send(ssh)) != 0)
-		fatal("%s: %s", __func__, ssh_err(r));
+		fatal_fr(r, "send packet");
 	debug("%s: sent", __func__);
 }
 
@@ -166,7 +166,6 @@ static void
 userauth_banner(struct ssh *ssh)
 {
 	char *banner = NULL;
-	int r;
 
 	if (options.banner == NULL)
 		return;
@@ -175,12 +174,6 @@ userauth_banner(struct ssh *ssh)
 		goto done;
 	userauth_send_banner(ssh, banner);
 
-	if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_BANNER)) != 0 ||
-	(r = sshpkt_put_cstring(ssh, banner)) != 0 ||
-	(r = sshpkt_put_cstring(ssh, "")) != 0 ||	/* language, unused */
-	(r = sshpkt_send(ssh)) != 0)
-		fatal_fr(r, "send packet");
-	debug("userauth_banner: sent");
 done:
 	free(banner);
 }



CVS commit: src/crypto/external/bsd/openssh/dist

2022-10-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Oct 18 06:46:51 UTC 2022

Modified Files:
src/crypto/external/bsd/openssh/dist: auth2.c

Log Message:
Avoid sending banner (if configured) twice.   Apparent merge error.
Patch from RVP (issue noticed by John D. Baker).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/crypto/external/bsd/openssh/dist/auth2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-10-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct 13 11:27:52 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Update dzdata to 2022e (2022egtz).


To generate a diff of this commit:
cvs rdiff -u -r1.1889 -r1.1890 src/doc/3RDPARTY
cvs rdiff -u -r1.2918 -r1.2919 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-10-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct 13 11:27:52 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Update dzdata to 2022e (2022egtz).


To generate a diff of this commit:
cvs rdiff -u -r1.1889 -r1.1890 src/doc/3RDPARTY
cvs rdiff -u -r1.2918 -r1.2919 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1889 src/doc/3RDPARTY:1.1890
--- src/doc/3RDPARTY:1.1889	Wed Oct 12 14:46:17 2022
+++ src/doc/3RDPARTY	Thu Oct 13 11:27:52 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1889 2022/10/12 14:46:17 taca Exp $
+#	$NetBSD: 3RDPARTY,v 1.1890 2022/10/13 11:27:52 kre Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1422,8 +1422,8 @@ Location:	external/bsd/tradcpp
 Notes:
 
 Package:	tz
-Version:	tzcode2022c / tzdata2022dgtz
-Current Vers:	tzcode2022d / tzdata2022d
+Version:	tzcode2022c / tzdata2022egtz
+Current Vers:	tzcode2022e / tzdata2022e
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2918 src/doc/CHANGES:1.2919
--- src/doc/CHANGES:1.2918	Tue Oct 11 02:58:52 2022
+++ src/doc/CHANGES	Thu Oct 13 11:27:52 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2918 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2919 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -698,3 +698,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	OpenSSH: Import 9.1. [christos 20221005]
 	postfix(1): Import version 3.7.3. [christos 20221008]
 	ntp: Import ntp 4.2.8p15. [christos 20221009]
+	tzdata: updated to 2022e (using the 2022egtz fork) [kre 20221013]



CVS commit: src/external/public-domain/tz/dist

2022-10-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct 13 11:25:52 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: TZDATA_VERSION

Log Message:
Merge tzdata2022e


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/public-domain/tz/dist/TZDATA_VERSION

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/public-domain/tz/dist/TZDATA_VERSION
diff -u src/external/public-domain/tz/dist/TZDATA_VERSION:1.29 src/external/public-domain/tz/dist/TZDATA_VERSION:1.30
--- src/external/public-domain/tz/dist/TZDATA_VERSION:1.29	Wed Sep 28 11:06:25 2022
+++ src/external/public-domain/tz/dist/TZDATA_VERSION	Thu Oct 13 11:25:52 2022
@@ -1 +1 @@
-tzdata-2022d
+tzdata-2022e



CVS commit: src/external/public-domain/tz/dist

2022-10-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct 13 11:25:52 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: TZDATA_VERSION

Log Message:
Merge tzdata2022e


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/public-domain/tz/dist/TZDATA_VERSION

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS import: src/external/public-domain/tz/dist

2022-10-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct 13 11:25:12 UTC 2022

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv16144

Log Message:
Import tzdata2022e from 
https://github.com/JodaOrg/global-tz/releases/download/2022egtz/tzdata2022egtz.tar.gz

Summary of changes in tzdata2022e (2022-10-11 11:13:02 -0700):
  * Jordan and Syria are abandoning the DST regime and are changing to
permanent +03, so they will not fall back from +03 to +02 on
2022-10-28.
  * On 1922-01-01 Tijuana adopted standard time at 00:00, not 01:00.

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2022EGTZ

U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/SECURITY
U src/external/public-domain/tz/dist/theory.html
C src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
C src/external/public-domain/tz/dist/asia
U src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
U src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
U src/external/public-domain/tz/dist/leap-seconds.list
U src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk

2 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA 
src/external/public-domain/tz/dist



CVS import: src/external/public-domain/tz/dist

2022-10-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct 13 11:25:12 UTC 2022

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv16144

Log Message:
Import tzdata2022e from 
https://github.com/JodaOrg/global-tz/releases/download/2022egtz/tzdata2022egtz.tar.gz

Summary of changes in tzdata2022e (2022-10-11 11:13:02 -0700):
  * Jordan and Syria are abandoning the DST regime and are changing to
permanent +03, so they will not fall back from +03 to +02 on
2022-10-28.
  * On 1922-01-01 Tijuana adopted standard time at 00:00, not 01:00.

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2022EGTZ

U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/SECURITY
U src/external/public-domain/tz/dist/theory.html
C src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
C src/external/public-domain/tz/dist/asia
U src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
U src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
U src/external/public-domain/tz/dist/leap-seconds.list
U src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk

2 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA 
src/external/public-domain/tz/dist



Re: CVS commit: src/usr.bin/make

2022-10-10 Thread Robert Elz
Date:Mon, 10 Oct 2022 17:33:35 +
From:"Roland Illig" 
Message-ID:  <20221010173335.c3cccf...@cvs.netbsd.org>

  | Document only the POSIX requirement for now, as I didn't find
  | information about _which_ ancient UNIX systems would corrupt the
  | filesystem on unlinking a directory.

Everthinng before the rename() mkdir() and rmdir() sys calls
were added, which was about 4.2bsd I think - and as I recall
the ability remained for some time after those were added.

Not sure when the UTS stream caught up, probably about the
time when Sun switched SunOS to being SysV based.

  | http://man.cat-v.org/unix-1st/2/sys-unlink (1971) says:
  | > It is also illegal to unlink a directory (except for the super-user).

That has always been true ... the function in make is for when make
is being run as root - not needed otherwise.

kre

ps: I agree that sys calls and emulations thereof should always return
non-zero (and hence true) in the error case (but not necessarily always
0 when successful).  That is simply the way they work and always have.


Re: CVS commit: src/sys/kern

2022-10-04 Thread Robert Elz
Date:Tue, 04 Oct 2022 10:09:35 -0400
From:Christos Zoulas 
Message-ID:  <8dd220d16861eb3a890461bdf02d1...@zoulas.com>

  | I always forget the O_CLOEXEC is special
  | in that regard. I wish it was not, but it is difficult to fix.

POSIX is adding O_CLOFORK in the next version (no guarantees I remembered
the symbol name spelling correctly here) which will have essentially the
same (open time) semantics (similar long term sematics as well, just
applied at a different time).

I assume we will need to add that at some point or other.

  | The question is how to find the vnode?

Not really, I assume that part will be fairly easy (probably trivial),
I just didn't have the energy to go work it out when sending that mail.
We have the file descriptor, and I suspect the file* (need to check to
make sure the right one is immediately available, but we can get it from
the fd if not), we know it refers to a vnode (it came from vn_open()),
so getting the vnode* from the file* is not something difficult, I think.

  | Perhaps it is easiest to fail the open call if O_EXLOCK or
  | O_SHLOCK are specified in a cloning open?

That would be an option, and is better than just ignoring them, but
better still would be to make them work.

Since open_setfp() does nothing (much) when none of the relevant O_xxx
flags that it tests are set (the fd open flags, as distinct from the
fp ones), and the code calls VOP_UNLOCK(vp) after it, we know that vp
is intended to be locked when open_setfp() is called (further confirmed
as when any of the O_??LOCK flags is set, open_setfp() does a VOP_UNLOCK()
and later a vn_lock() (which I am guessing is the inverse).

Maybe all that's needed is a vn_lock() call (on the vp that we still need
to fetch) and then call open_setfp() ?   But this is all beyond what I
know enough about to be sure, particularly to avoid doing anything which
might deadlock, etc.

kre

ps: if this gets done properly, then special case code to handle O_NONBLOCK
(and O_NOSIGPIPE, ...) in cloning device drivers won't be needed either,
open_setfp() is where all of that is normally added to the file* for the
fd being returned, it was not "simply happening" because that call is
missing in the cloned device case.





Re: CVS commit: src/sys/kern

2022-10-01 Thread Robert Elz
Date:Sat, 1 Oct 2022 13:00:04 -0400
From:Christos Zoulas 
Message-ID:  <8bd3a408-77fd-402c-8d6c-ad4b4a5e8...@zoulas.com>


  | This is what I meant:
  |
  | RCS file: /cvsroot/src/sys/kern/kern_descrip.c,v
  | retrieving revision 1.251
  | diff -u -u -r1.251 kern_descrip.c
  | --- kern_descrip.c  29 Jun 2021 22:40:53 -  1.251
  | +++ kern_descrip.c  1 Oct 2022 16:56:44 -
  | @@ -1162,6 +1162,7 @@
  | KASSERT(ff->ff_allocated);
  | KASSERT(fd_isused(fdp, fd));
  | KASSERT(fd >= NDFDFILE || ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
  | +   ff->ff_exclose = (fp->f_flag & O_CLOEXEC) != 0;
  |
  | /* No need to lock in order to make file initially visible. */
  | ff->ff_file = fp;

That's not going to work in the situation we're in, as nothing will have
set O_CLOEXEC in fp->f_flag (or shouldn't have anyway, right, O_CLOEXEC isn't
that kind of a flag, it belongs to the descriptor, not the file*).

f_flag is set in vfs_syscalls.c in open_setfp() - which is never called
in the cloning device case, that's the underlying problem I believe.

Even when it is called, the code is:

fp->f_flag = flags & FMASK;

where FMASK is (from fcntl.h)

#define FMASK   (FREAD|FWRITE|FCNTLFLAGS|FEXEC)

and

#define FCNTLFLAGS  (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FDSYNC|FRSYNC|FALTIO|\
 FDIRECT|FNOSIGPIPE)

which all looks exactly as it should be to me - and note that O_CLOEXEC
(which has no F equivalent name - it doesn't need one) is not there.

So, fp->f_flag isn't set at all (is probably 0), and even if it were
O_CLOEXEC would not be there, and should not be.

For the vnode actually being opened, none of this matters, as the open
lasts as long (actually not as long) as the open() sys call - when that
returns, the device being opened has been closed again, so what the
file that refers to it looks like (or would have looked like) really
doesn't matter at all, it never becomes visible.   That's my guess as
to why the open_setfp() call is missing in that case.

But what got forgotten (or deliberately was not done) was anything to
affect the modes of the clone which is opened.

  | What does it mean when the open specifies O_CLOEXEC
  | and ff->ff_exclose is false? Can that happen? Is that desirable?

It is what is currently happening whenever we open a cloning device.
(Or that is what it looks like to me).   Desirable, no idea, I didn't
define the semantics of cloning device opens, nor which of the open
flags should apply to the clone that is created.

  | I am fine with the locking to stay where it is. I guess it is probably
  | not needed after dup/clone, since the underlying vnode is shared...

Assuming you mean dup(2) (and dup2()) and clone(2) then no - those have
no way to pass the relevant locking flags, if you have a fd and want to
apply a lock, fcntl() is what does that (and the fcntl operations that
duplicate fds do not also apply locks).

The only issue is O_EXLOCK and O_SHLOCK (and O_CLOEXEC) for cloned devices.

I suspect it makes sense for O_CLOEXEC to be applied in that case, it
makes little sense for open("/dev/ptmx", O_RDWR|O_CLOEXEC) to succeed,
returning an open fd which does not have cloexec set (which is the issue,
along with O_NONBLOCK) which started all of this discussion.

The locking flags I am less sure about.   I don't see how they can fail
to succeed if applied, as the vnode for the device has just been created,
nothing else can possibly have any kind of lock on it.   Whether there's
any benefit in applying the lock so that the node is locked for later,
I don't know - but it certainly should do no harm to do that.

It seems clear to me that what we need is (something like)

Index: vfs_syscalls.c
===
RCS file: /cvsroot/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.555
diff -u -r1.555 vfs_syscalls.c
--- vfs_syscalls.c  12 Feb 2022 15:51:29 -  1.555
+++ vfs_syscalls.c  1 Oct 2022 19:27:15 -
@@ -1763,6 +1763,9 @@
error = fd_dupopen(dupfd, dupfd_move, flags, );
if (error)
return error;
+   error = open_setfp(l, fp, XXXvp, indx, flags);
+   if (error)
+   return error;
*fd = indx;
} else {
error = open_setfp(l, fp, vp, indx, flags);


where XXXvp needs to be extracted from somewhere (it isn't vp, as vp==NULL)
except that what follows in the else case is ...

if (error)
return error;
VOP_UNLOCK(vp);
*fd = indx;


That VOP_UNLOCK(vp) is what is bothering me,   It tells me that open_setfp()
is expecting to be called with vp locked - but in the first case (the cloning
case) there is no VOP_UNLOCK() call (and what's more, fd_dupopen() cannot
do it, as it has no vp arg).   That means, I 

Re: CVS commit: src/sys/kern

2022-09-30 Thread Robert Elz
Date:Fri, 30 Sep 2022 20:15:07 -0400
From:Christos Zoulas 
Message-ID:  

  | It does not need an extra flag (it looks in the file descriptor flags to
  | find if it needs to set or not.

One of us is confused.   From where in this case does anything
get the exclose flag set?   That's the whole question here.  The
flags arg that is passed around has O_CLOEXEC set in it - you used
that in the call to fd_set_exclose() in kern/tty_ptm.c ... but where
you said that would be better done in fd_affix().

That does not have access to the flags.   So from where is it going
to get the close on exec info ?

My reading of do_open() is that the O_CLOEXEC flag is never even
examined when a cloning device is opened, it doesn't get set on
the original fd (the cloner) or the cloned device (other than by
your recent modification for /dev/pmx).

Did I misread the code?

Or are you planning something different than it seemed?

  | to find other cases where we forgot to call fd_set_exclose() before calling
  | fd_affix().

My point is that it should not be necessary to call fd_set_exclose()
in every (or any) cloning device driver.  The open syscall handling
is where that should be done, just as it is for all the opens that
are not cloning devices.

Why be different?

  | It also does not need locking because the process can't access
  | the descriptor before calling fd_affix.

The locking I was referring to are the vnode locks/references in
do_open(), not anything related to the file struct or descriptor.
I just do not feel competent to get all of that correct in this
case (more complex than the normal case because of the extra vnode
involved) and would prefer if someone familiar with all of that
were to handle it - particularly in the extra error case that will
need to be handled, even if I cannot see how it would actually fire
in the case in question.

kre


Re: CVS commit: src/sys/kern

2022-09-30 Thread Robert Elz
Date:Fri, 30 Sep 2022 16:34:20 -0400
From:Christos Zoulas 
Message-ID:  <232331ad-d501-4547-b730-03590c0c9...@zoulas.com>

  | How about handling exclose there?

That would be possible, but why?   We still need higher level code to
handle the locking, which can also handle cloexec -- the problem we
have now is simply that the relevant call is missing, I don't think adding
it will be hard, but it needs to be done by someone who understands the
locking requirements, and correct exit strategy in this case if an error
occurs (failing to successfully lock a newly created clone would seem to
be a very bizarre case, but still...)   That is, I don't feel competent to
suggest the 3 or 4 lines that ought be added in do_open to fix this (for
just O_CLOEXEC it would be trivial there, as that cannot fail).

Currently fd_affix (I mistakenly made it fp_affix in the last message...)
doesn't have a flags parameter, so to do it the way you suggest, we'd need
to alter its signature, bump to 9.99.101 (and I haven't yet gotten around
to making my kernel be 98.99.100 which I'm kind of planning to do ...)
and go alter all the calls everywhere, mostly just filling in an extra
arg with a 0.

kre



Re: CVS commit: src/sys/kern

2022-09-30 Thread Robert Elz
Date:Thu, 29 Sep 2022 16:47:06 - (UTC)
From:chris...@astron.com (Christos Zoulas)
Message-ID:  

  | I think that the way to go is to:
  |
  | 1. Do the fd_set_exclose() in fd_affix(). That will remove most of the calls
  |to fd_set_exclose() *and* the open-coded versions of it.
  | 2. Move the open_setfp locking initialization code to fd_affix() and do it
  |if fp->f_type == DTYPE_VNODE. This should enable locking in all the
  |appropriate cloners.

I initially intended to reply and say that decisions where to put stuff
like that were for someone else (you, dholland, ...) rather than me, as
I haven't played around much at this level since before vnodes existed.

But I have been thinking about it, and I disagree with that approach.

fp_affix() has a job to do, and should be left to do it, without being
burdened by applying weird side effects, sometimes.   The "do one thing
and do it well" philosophy applies to more than the commands.

eg: currently fd_affix() is a void func, but to handle the lock flags
it would need to be able to fail, and return an error code.  It would
also need to be able to sleep.   That's just wrong.

O_CLOEXEC and O_??LOCK are high level open() flags, and deserve to be
handled somewhere near the upper levels of the open syscall handling,
not buried in some utility function.

kre



Re: CVS commit: src/sys/kern

2022-09-29 Thread Robert Elz
Date:Thu, 29 Sep 2022 08:18:28 -0400
From:"Christos Zoulas" 
Message-ID:  <20220929121828.06edff...@cvs.netbsd.org>

  | Log Message:
  | Add fd_set_exclose(). It is probably better to do this automatically in
  | fd_affix()...

Since that only affects /dev/ptmx I'd suggest fixing it generally for all
cloning devices (and handling O_??LOCK as well) would be a better method.

kre



Re: CVS commit: src/lib/libc/stdlib

2022-09-29 Thread Robert Elz
Date:Thu, 29 Sep 2022 08:18:49 -0400
From:Christos Zoulas 
Message-ID:  

  | Yes, I had forgotten about the need to do this explicitly...

  | > On Sep 28, 2022, at 10:23 PM, Robert Elz  wrote:
  | > 
  | > Apologies, I did not read the code closely enough, there must be a bug
  | > in the way the clone file descriptor is created.

I think I know the cause now, and it isn't anything specific to /dev/ptmx
it would affect all cloning devices.

In kern/vfs_syscalls.c do_open() we see the following:

if (vp == NULL) {
fd_abort(p, fp, indx);
error = fd_dupopen(dupfd, dupfd_move, flags, );
if (error)
return error;
*fd = indx;   
} else {
error = open_setfp(l, fp, vp, indx, flags);
if (error)
return error;
VOP_UNLOCK(vp);
*fd = indx;
fd_affix(p, fp, indx);
}

The vp==NULL case is where cloning devices are handled.   fd_dupopen()
arranges top make the duplicate happen.

It attempts to handle O_CLOEXEC thus:

error = fd_dup(fp, 0, newp, ff->ff_exclose);

where ff_exclose is the close_on_exec bit for the old file descriptor
(the one being duplicated) which is just fine for other calls of fd_dupopen().

The vp!=NULL case above is for "normal" opens, and open_setfp() is what
handles O_CLOEXEC - that's what (eventually) makes ff_exclose be true
(it also handles O_EXLOCK and O_SHLOCK.

None of that is being done in the cloning device open case, so those 3
flags simply cannot work, as the code is written currently, for these
devices.

I'm not about to go playing in this very fiddly piece of code, but I'm
kind of hoping that dholland@ might know the right magic sequence to make
this issue go away.

It probably means a call to open_setfp() with some parameters or other,
somewhere in the vp==NULL side of that if statement, though, just what
I have not attempted to work out.

kre



Re: CVS commit: src/lib/libc/stdlib

2022-09-28 Thread Robert Elz
Apologies, I did not read the code closely enough, there must be a bug
in the way the clone file descriptor is created.

kre


Re: CVS commit: src/lib/libc/stdlib

2022-09-28 Thread Robert Elz
Date:Wed, 28 Sep 2022 20:48:53 -0400
From:"David H. Gutteridge" 
Message-ID:  <9c9c8e9d9384338320b47dabfdc94...@gutteridge.ca>

   
  | (O_CLOEXEC, on the other hand, is ignored, at the moment.)

No it isn't, your test is faulty, O_CLOEXEC is a different
kind of flag, applies at a different level, and is fetched
a different way.

That's what dholland@ tried to tell you a few days ago.

kre
  |
  | $ cat open_test.c
  | #include 
  | #include 
  | #include 
  |
  | int main(int argc, char* argv[])
  | {
  | int fd, flags;
  |
  | printf("Regular file (read-only) with O_NONBLOCK | O_CLOEXEC.\n");
  | if ((fd = open("/etc/release", O_RDONLY | O_NONBLOCK | O_CLOEXEC)) < 0)
  | printf("Failed to get file handle.\n");
  | else {
  | printf("Descriptor flags: %d\n", flags = fcntl(fd, F_GETFD));
  | printf("Status flags: %d\n", flags = fcntl(fd, F_GETFL, 0));
  | close(fd);
  | }
  |
  | printf("POSIX pt cloning device with O_NONBLOCK | O_CLOEXEC.\n");
  | if ((fd = open("/dev/ptmx", O_RDWR | O_NOCTTY | O_NONBLOCK | 
  | O_CLOEXEC)) < 0)
  | printf("Failed to open /dev/ptmx.\n");
  | else {
  | printf("Descriptor flags: %d\n", flags = fcntl(fd, F_GETFD));
  | printf("Status flags: %d\n", flags = fcntl(fd, F_GETFL, 0));
  | close(fd);
  | }
  |
  | return 0;
  | }
  |
  | $ ./open_test
  | Regular file (read-only) with O_NONBLOCK | O_CLOEXEC.
  | Descriptor flags: 1
  | Status flags: 4
  | POSIX pt cloning device with O_NONBLOCK | O_CLOEXEC.
  | Descriptor flags: 0
  | Status flags: 6
  |
  | Regards,
  |
  | Dave
  |


CVS commit: src/external/public-domain/tz/dist

2022-09-28 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Sep 28 12:34:50 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: backward

Log Message:
Add links for Europe/Uzhgorod and Europe/Zaporozhye (to Europe/Kyiv)
These are gone as separate zones, but the names should remain.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/public-domain/tz/dist/backward

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/public-domain/tz/dist/backward
diff -u src/external/public-domain/tz/dist/backward:1.4 src/external/public-domain/tz/dist/backward:1.5
--- src/external/public-domain/tz/dist/backward:1.4	Wed Aug 17 12:19:41 2022
+++ src/external/public-domain/tz/dist/backward	Wed Sep 28 12:34:50 2022
@@ -89,6 +89,8 @@ Link	Europe/Dublin		Eire
 Link	Etc/UTC			Etc/UCT
 Link	Europe/London		Europe/Belfast
 Link	Europe/Kyiv		Europe/Kiev
+Link	Europe/Kyiv		Europe/Uzhgorod
+Link	Europe/Kyiv		Europe/Zaporozhye
 Link	Europe/Chisinau		Europe/Tiraspol
 Link	Europe/London		GB
 Link	Europe/London		GB-Eire



CVS commit: src/external/public-domain/tz/dist

2022-09-28 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Sep 28 12:34:50 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: backward

Log Message:
Add links for Europe/Uzhgorod and Europe/Zaporozhye (to Europe/Kyiv)
These are gone as separate zones, but the names should remain.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/public-domain/tz/dist/backward

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-09-28 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Sep 28 11:09:13 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note update to tzdata2022d (2022dgtz)


To generate a diff of this commit:
cvs rdiff -u -r1.1881 -r1.1882 src/doc/3RDPARTY
cvs rdiff -u -r1.2912 -r1.2913 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1881 src/doc/3RDPARTY:1.1882
--- src/doc/3RDPARTY:1.1881	Sat Sep 24 20:36:11 2022
+++ src/doc/3RDPARTY	Wed Sep 28 11:09:13 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1881 2022/09/24 20:36:11 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1882 2022/09/28 11:09:13 kre Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1422,8 +1422,8 @@ Location:	external/bsd/tradcpp
 Notes:
 
 Package:	tz
-Version:	tzcode2022c / tzdata2022bgtz (tzdata2022c)
-Current Vers:	tzcode2022c / tzdata2022c
+Version:	tzcode2022c / tzdata2022dgtz
+Current Vers:	tzcode2022d / tzdata2022d
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2912 src/doc/CHANGES:1.2913
--- src/doc/CHANGES:1.2912	Sat Sep 24 20:36:11 2022
+++ src/doc/CHANGES	Wed Sep 28 11:09:13 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2912 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2913 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -692,3 +692,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	nsd: Import 4.6.0. [christos 20220924]
 	unbound(8): Import 1.16.3. [christos 20220924]
 	file(1): Upgraded to 5.43. [christos 20220924]
+	tzdata: updated to 2022d (using the 2022dgtz fork) [kre 20220928]



CVS commit: src/doc

2022-09-28 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Sep 28 11:09:13 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note update to tzdata2022d (2022dgtz)


To generate a diff of this commit:
cvs rdiff -u -r1.1881 -r1.1882 src/doc/3RDPARTY
cvs rdiff -u -r1.2912 -r1.2913 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/public-domain/tz/dist

2022-09-28 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Sep 28 11:06:25 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: TZDATA_VERSION

Log Message:
Merge tzdata2022d


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/external/public-domain/tz/dist/TZDATA_VERSION

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/public-domain/tz/dist/TZDATA_VERSION
diff -u src/external/public-domain/tz/dist/TZDATA_VERSION:1.28 src/external/public-domain/tz/dist/TZDATA_VERSION:1.29
--- src/external/public-domain/tz/dist/TZDATA_VERSION:1.28	Wed Aug 17 12:19:41 2022
+++ src/external/public-domain/tz/dist/TZDATA_VERSION	Wed Sep 28 11:06:25 2022
@@ -1 +1 @@
-tzdata-2022c
+tzdata-2022d



CVS commit: src/external/public-domain/tz/dist

2022-09-28 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Sep 28 11:06:25 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: TZDATA_VERSION

Log Message:
Merge tzdata2022d


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/external/public-domain/tz/dist/TZDATA_VERSION

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS import: src/external/public-domain/tz/dist

2022-09-28 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Sep 28 11:05:44 UTC 2022

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv4345

Log Message:
Import tzdata2022d from 
https://github.com/JodaOrg/global-tz/releases/download/2022dgtz/tzdata2022dgtz.tar.gz

Summary of changes in tzdata2022d (2022-09-23 12:02:57 -0700):
  * Palestine now springs forward and falls back at 02:00 on the
first Saturday on or after March 24 and October 24, respectively.
  * Simplify three Ukraine zones to one, since the post-1970
differences seem to have been imaginary.

This is an update from 2022b to 2022d, there were no tzdata changes in 2022c

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2022DGTZ

U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/SECURITY
U src/external/public-domain/tz/dist/theory.html
C src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
C src/external/public-domain/tz/dist/asia
C src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
C src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
U src/external/public-domain/tz/dist/leap-seconds.list
U src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk

4 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA 
src/external/public-domain/tz/dist



CVS import: src/external/public-domain/tz/dist

2022-09-28 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Sep 28 11:05:44 UTC 2022

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv4345

Log Message:
Import tzdata2022d from 
https://github.com/JodaOrg/global-tz/releases/download/2022dgtz/tzdata2022dgtz.tar.gz

Summary of changes in tzdata2022d (2022-09-23 12:02:57 -0700):
  * Palestine now springs forward and falls back at 02:00 on the
first Saturday on or after March 24 and October 24, respectively.
  * Simplify three Ukraine zones to one, since the post-1970
differences seem to have been imaginary.

This is an update from 2022b to 2022d, there were no tzdata changes in 2022c

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2022DGTZ

U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/SECURITY
U src/external/public-domain/tz/dist/theory.html
C src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
C src/external/public-domain/tz/dist/asia
C src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
C src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
U src/external/public-domain/tz/dist/leap-seconds.list
U src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk

4 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA 
src/external/public-domain/tz/dist



CVS commit: src/bin/sh

2022-09-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Sep 18 17:11:33 UTC 2022

Modified Files:
src/bin/sh: var.c

Log Message:
Oops, somehow managed to commit an older version where NBSH_INVOCATION
start char was '@' rather than '!' (which meant not lexically ordered).
This is how it was intended to be (and is documented).


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/bin/sh/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/var.c
diff -u src/bin/sh/var.c:1.81 src/bin/sh/var.c:1.82
--- src/bin/sh/var.c:1.81	Sun Sep 18 06:03:19 2022
+++ src/bin/sh/var.c	Sun Sep 18 17:11:33 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.81 2022/09/18 06:03:19 kre Exp $	*/
+/*	$NetBSD: var.c,v 1.82 2022/09/18 17:11:33 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: var.c,v 1.81 2022/09/18 06:03:19 kre Exp $");
+__RCSID("$NetBSD: var.c,v 1.82 2022/09/18 17:11:33 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -538,7 +538,7 @@ setvar_invocation(int argc, char **argv)
 	 */
 
 	v = value;
-	*v++ = '@';		/* never empty, and the '-' is not first */
+	*v++ = '!';		/* never empty, and the '-' is not first */
 
 	if (argc > 0 && argv[0] != NULL && argv[0][0] == '-')
 		*v++ = '-';



CVS commit: src/bin/sh

2022-09-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Sep 18 17:11:33 UTC 2022

Modified Files:
src/bin/sh: var.c

Log Message:
Oops, somehow managed to commit an older version where NBSH_INVOCATION
start char was '@' rather than '!' (which meant not lexically ordered).
This is how it was intended to be (and is documented).


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/bin/sh/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-09-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Sep 18 06:03:19 UTC 2022

Modified Files:
src/bin/sh: main.c option.list options.c sh.1 var.c var.h

Log Message:
Add the -l option (aka -o login): be a login shell.   Meaningful only on
the command line (with both - and + forms) - overrides the presence (or
otherwise) of a '-' as argv[0][0].

Since this allows any shell to be a login shell (which simply means that
it runs /etc/profile and ~/.profile at shell startup - there are no other
side effects) add a new, always set at startup, variable NBSH_INVOCATION
which has a char string as its value, where each char has a meaning,
more or less related to how the shell was started.   See sh(1).
This is intended to allow those startup scripts to tailor their behaviour
to the nature of this particular login shell (it is possible to detect
whether a shell is a login shell merely because of -l, or whether it would
have been anyway, before the -l option was added - and more).   The
var could also be used to set different values for $ENV for different
uses of the shell.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/bin/sh/main.c
cvs rdiff -u -r1.9 -r1.10 src/bin/sh/option.list
cvs rdiff -u -r1.57 -r1.58 src/bin/sh/options.c
cvs rdiff -u -r1.249 -r1.250 src/bin/sh/sh.1
cvs rdiff -u -r1.80 -r1.81 src/bin/sh/var.c
cvs rdiff -u -r1.38 -r1.39 src/bin/sh/var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/main.c
diff -u src/bin/sh/main.c:1.88 src/bin/sh/main.c:1.89
--- src/bin/sh/main.c:1.88	Tue Oct 26 10:07:20 2021
+++ src/bin/sh/main.c	Sun Sep 18 06:03:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.88 2021/10/26 10:07:20 kre Exp $	*/
+/*	$NetBSD: main.c,v 1.89 2022/09/18 06:03:19 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.7 (Berkeley) 7/19/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.88 2021/10/26 10:07:20 kre Exp $");
+__RCSID("$NetBSD: main.c,v 1.89 2022/09/18 06:03:19 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -212,6 +212,7 @@ main(int argc, char **argv)
 	initpwd();
 	setstackmark();
 	procargs(argc, argv);
+	setvar_invocation(argc, argv);
 
 #if 0	/* This now happens (indirectly) in the procargs() just above */
 	/*
@@ -229,7 +230,7 @@ main(int argc, char **argv)
 		choose_ps1();
 #endif
 
-	if (argv[0] && argv[0][0] == '-') {
+	if (loginsh) {
 		state = 1;
 		read_profile("/etc/profile");
  state1:

Index: src/bin/sh/option.list
diff -u src/bin/sh/option.list:1.9 src/bin/sh/option.list:1.10
--- src/bin/sh/option.list:1.9	Fri Nov 23 20:40:06 2018
+++ src/bin/sh/option.list	Sun Sep 18 06:03:19 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: option.list,v 1.9 2018/11/23 20:40:06 kre Exp $ */
+/* $NetBSD: option.list,v 1.10 2022/09/18 06:03:19 kre Exp $ */
 
 /*
  * define the shell's settable options
@@ -58,6 +58,7 @@ sflag	stdin		s		# read from standard inp
 
 // non-standard options -- 'i' is just a state, not an option in standard.
 iflag	interactive	i		# interactive shell
+loginsh	login		l		# a login shell
 cdprint	cdprint# always print result of a cd
 usefork	fork		F		# use fork(2) instead of vfork(2)
 pflag	nopriv		p		# preserve privs if set[ug]id

Index: src/bin/sh/options.c
diff -u src/bin/sh/options.c:1.57 src/bin/sh/options.c:1.58
--- src/bin/sh/options.c:1.57	Sat Apr 16 14:20:45 2022
+++ src/bin/sh/options.c	Sun Sep 18 06:03:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.57 2022/04/16 14:20:45 kre Exp $	*/
+/*	$NetBSD: options.c,v 1.58 2022/09/18 06:03:19 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)options.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: options.c,v 1.57 2022/04/16 14:20:45 kre Exp $");
+__RCSID("$NetBSD: options.c,v 1.58 2022/09/18 06:03:19 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -122,6 +122,10 @@ procargs(int argc, char **argv)
 	if (debug == 2)
 		debug = 1;
 #endif
+	arg0 = argv[0];
+	if (loginsh == 2 && arg0 != NULL && arg0[0] == '-')
+		loginsh = 1;
+
 	/*
 	 * Any options not dealt with as special cases just above,
 	 * and which were not set on the command line, are set to
@@ -136,7 +140,6 @@ procargs(int argc, char **argv)
 		optlist[i].dflt = optlist[i].val;
 	}
 
-	arg0 = argv[0];
 	if (sflag == 0 && minusc == NULL) {
 		commandname = argv[0];
 		arg0 = *argptr++;

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.249 src/bin/sh/sh.1:1.250
--- src/bin/sh/sh.1:1.249	Fri Sep 16 19:25:09 2022
+++ src/bin/sh/sh.1	Sun Sep 18 06:03:19 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.249 2022/09/16 19:25:09 kre Exp $
+.\"	$NetBSD: sh.1,v 1.250 2022/09/18 06:03:19 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -31,10 +31,11 @@
 .\"
 .\"	@(#)sh.1	8.6 (Berkeley) 5/4/95
 .\"
-.Dd January 7, 2022
+.\" RIP Noi, 

CVS commit: src/bin/sh

2022-09-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Sep 18 06:03:19 UTC 2022

Modified Files:
src/bin/sh: main.c option.list options.c sh.1 var.c var.h

Log Message:
Add the -l option (aka -o login): be a login shell.   Meaningful only on
the command line (with both - and + forms) - overrides the presence (or
otherwise) of a '-' as argv[0][0].

Since this allows any shell to be a login shell (which simply means that
it runs /etc/profile and ~/.profile at shell startup - there are no other
side effects) add a new, always set at startup, variable NBSH_INVOCATION
which has a char string as its value, where each char has a meaning,
more or less related to how the shell was started.   See sh(1).
This is intended to allow those startup scripts to tailor their behaviour
to the nature of this particular login shell (it is possible to detect
whether a shell is a login shell merely because of -l, or whether it would
have been anyway, before the -l option was added - and more).   The
var could also be used to set different values for $ENV for different
uses of the shell.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/bin/sh/main.c
cvs rdiff -u -r1.9 -r1.10 src/bin/sh/option.list
cvs rdiff -u -r1.57 -r1.58 src/bin/sh/options.c
cvs rdiff -u -r1.249 -r1.250 src/bin/sh/sh.1
cvs rdiff -u -r1.80 -r1.81 src/bin/sh/var.c
cvs rdiff -u -r1.38 -r1.39 src/bin/sh/var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Sep 16 19:25:10 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
More wording improvements.   There might be more to come.


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.248 src/bin/sh/sh.1:1.249
--- src/bin/sh/sh.1:1.248	Fri Sep 16 17:32:18 2022
+++ src/bin/sh/sh.1	Fri Sep 16 19:25:09 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.248 2022/09/16 17:32:18 kre Exp $
+.\"	$NetBSD: sh.1,v 1.249 2022/09/16 19:25:09 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -885,7 +885,8 @@ built-in command.
 Whenever a reserved word (see above) may occur,
 and after checking for reserved words, the shell
 checks the word to see if it matches an alias.
-If it does, it replaces it in the input stream with its value.
+If it does, the alias word is replaced by its value in the input stream,
+as if the value had been entered instead.
 For example, if there is an alias called
 .Dq lf
 with the value
@@ -936,7 +937,8 @@ command is located.
 Any remaining words are considered the arguments of the command.
 If no command name resulted, then the
 .Dq Ar name Ns Li = Ns Ar value
-variable assignments recognized in item 1 affect the current shell.
+variable assignments recognized in item 1 affect the current shell,
+but are not automatically added to the environment (are not exported).
 .It
 Redirections are performed, from first to last, in the order given,
 as described in the next section.
@@ -968,6 +970,11 @@ that refers to a file descriptor.
 If present it must occur unquoted, immediately before the redirection
 operator, with no intervening white space, and becomes a
 part of that operator.
+If not explicitly present,
+.Ar n
+will be 0 (standard input)
+or 1 (standard output)
+depending upon the redicection operator used.
 If file descriptor
 .Ar n
 was open prior to the redirection, its previous use is closed.
@@ -1117,7 +1124,7 @@ are set to the arguments of the shell fu
 The variables which are explicitly placed in the environment of
 the command (by placing assignments to them before the function name) are
 made local to the function and are set to the values given,
-and exported for the benefit of programs executed with the function.
+and exported for the benefit of programs executed within the function.
 Then the command given in the function definition is executed.
 The positional parameters, and local variables, are restored to
 their original values when the command completes.
@@ -1300,9 +1307,10 @@ sends both the standard output and stand
 to the standard input of command2.
 .Pp
 Note that unlike some other shells, each process in the pipeline is a
-child of the invoking shell (unless it is a shell built-in, in which case
-it executes in the current shell \(em but any effect it has on the
-environment is wiped).
+child of the invoking shell, except in the case where the pipeline
+is a single simple command (no
+.Sq Ic \(ba
+characters appear.)
 .Pp
 A pipeline is a simple case of an AND-OR-list (described below.)
 A
@@ -1742,11 +1750,14 @@ The value of the parameter is listed nex
 .It Dv *
 Expands to the positional parameters, starting from one.
 When the
-expansion occurs within a double-quoted string it expands to a single
+expansion occurs in a situation where field splitting is never
+performed, such as within a double-quoted string, it expands to a single
 field with the value of each parameter separated by the first character of
 the
 .Ev IFS
-variable, or by a
+variable (possibly nothing if
+.EV IFS
+has a null value), or by a
 .Aq space
 if
 .Ev IFS
@@ -1755,6 +1766,13 @@ is unset.
 Expands to the positional parameters, starting from one.
 When the expansion occurs within double quotes, each positional
 parameter expands as a separate argument.
+If the expansion happens in other situations where field splitting
+is not performed, whether double quoted or not, the results are undefined.
+In most shells, including this one,
+.Dv \&$@
+is treated as
+.Dv \&$*
+in such a context, but this is not universally true.
 If there are no positional parameters, the
 expansion of @ generates zero arguments, even when
 .Dv $@
@@ -1831,8 +1849,8 @@ instances of the expansion, or any of th
 Unless the
 .Ev IFS
 variable has an empty value,
-Field Splitting is performed on fields
-generated by step (1) except for Tilde Expansion.
+Field Splitting is performed on the text resulting from
+the expansions in step (1) except for Tilde Expansion.
 .It
 Pathname Expansion (unless set
 .Fl f



CVS commit: src/bin/sh

2022-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Sep 16 19:25:10 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
More wording improvements.   There might be more to come.


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Sep 16 17:32:18 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Minor wording improvements.

Note these do not alter anything about what the man page specifies,
just say a couple of things in a slightly better way, hence no Dd
update accompanies this change (deliberately).


To generate a diff of this commit:
cvs rdiff -u -r1.247 -r1.248 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.247 src/bin/sh/sh.1:1.248
--- src/bin/sh/sh.1:1.247	Fri Sep 16 17:29:21 2022
+++ src/bin/sh/sh.1	Fri Sep 16 17:32:18 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.247 2022/09/16 17:29:21 kre Exp $
+.\"	$NetBSD: sh.1,v 1.248 2022/09/16 17:32:18 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -159,7 +159,7 @@ is correct, as desired, use:
 Otherwise if
 .Ev ENV
 appears to contain a command substitution,
-which is not performed here,
+which is never performed here,
 or if there were no expansions to expand, the value of
 .Ev ENV
 is used as the file name.
@@ -258,8 +258,7 @@ The
 .Ic set Fl o
 name is provided next to the single letter option in
 the description below.
-Some options have only a long name, they are described after
-the flag options, they are used with
+Some options have only a long name, and are used with
 .Fl o
 or
 .Cm +o
@@ -270,7 +269,7 @@ Those are listed in the table below afte
 with a one letter, flag, equivalent.
 .Pp
 Other options described are for the command line only.
-Specifying a dash
+Specifying using a dash (or minus)
 .Dq Cm \-
 turns the option on, while using a plus
 .Dq Cm +
@@ -411,7 +410,8 @@ For more details see the section
 .Sx LINENO
 below.
 .It Fl m Em monitor
-Turn on job control (set automatically at shell startup when interactive).
+Turn on job control (set automatically at shell startup,
+if not mentioned on the command line, when interactive).
 .It Fl n Em noexec
 Read and parse commands, but do not execute them.
 This is useful for checking the syntax of shell scripts.
@@ -1780,7 +1780,7 @@ the two arguments:
 Expands to the number of positional parameters.
 .It Dv \&?
 Expands to the exit status of the most recent pipeline.
-.It Dv \- No (hyphen, or minus)
+.It Dv \- No (dash, hyphen, or minus)
 Expands to the current option flags (the single-letter
 option names concatenated into a string) as specified on
 invocation, by the set built-in command, or implicitly



CVS commit: src/bin/sh

2022-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Sep 16 17:32:18 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Minor wording improvements.

Note these do not alter anything about what the man page specifies,
just say a couple of things in a slightly better way, hence no Dd
update accompanies this change (deliberately).


To generate a diff of this commit:
cvs rdiff -u -r1.247 -r1.248 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Sep 16 17:29:21 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Move a comment that used to be in the correct place, once upon a time,
back where it belongs, and make it stand out more, so other text is
less likely to find itself pushed between the comment and the text
to which it appears.   This change should make no visible difference
to the man page displayed.


To generate a diff of this commit:
cvs rdiff -u -r1.246 -r1.247 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.246 src/bin/sh/sh.1:1.247
--- src/bin/sh/sh.1:1.246	Fri Sep 16 17:25:09 2022
+++ src/bin/sh/sh.1	Fri Sep 16 17:29:21 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.246 2022/09/16 17:25:09 kre Exp $
+.\"	$NetBSD: sh.1,v 1.247 2022/09/16 17:29:21 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -4798,7 +4798,6 @@ has not been set or unset.
 The default terminal setting for the shell.
 This is inherited by
 children of the shell, and is used in the history editing modes.
-.\" This is explicitly last, not in sort order - please leave!
 .It Ev ToD
 When referenced, uses the value of
 .Ev ToD_FORMAT
@@ -4834,6 +4833,9 @@ to use when formatting
 .Ev ToD
 and if exported, other utilities that deal with times.
 If unset, the system's local wall clock time zone is used.
+.\"
+.\" ==
+.\" This is explicitly last, not in sort order - please leave!
 .It Ev NETBSD_SHELL
 Unlike the variables previously mentioned,
 this variable is somewhat strange,



CVS commit: src/bin/sh

2022-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Sep 16 17:29:21 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Move a comment that used to be in the correct place, once upon a time,
back where it belongs, and make it stand out more, so other text is
less likely to find itself pushed between the comment and the text
to which it appears.   This change should make no visible difference
to the man page displayed.


To generate a diff of this commit:
cvs rdiff -u -r1.246 -r1.247 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Sep 16 17:25:09 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Sep 16 17:25:09 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.245 src/bin/sh/sh.1:1.246
--- src/bin/sh/sh.1:1.245	Thu Sep 15 18:00:36 2022
+++ src/bin/sh/sh.1	Fri Sep 16 17:25:09 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.245 2022/09/15 18:00:36 kre Exp $
+.\"	$NetBSD: sh.1,v 1.246 2022/09/16 17:25:09 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -3191,7 +3191,7 @@ to set key bindings as defined by
 .Xr editrc 5 .
 .\"
 .Pp
-.It Ic jobid Oo Fl g Ns \&| Ns Fl j Ns \&| Ns Fl p Oc  Op Ar job
+.It Ic jobid Oo Fl g Ns \&| Ns Fl j Ns \&| Ns Fl p Oc Op Ar job
 With no flags, print the process identifiers of the processes in the job.
 If the
 .Ar job
@@ -3573,7 +3573,7 @@ If an unescaped backslash is followed by
 the backslash and the newline will be deleted,
 and replaced by the contents of the following line,
 which is processed as if it had been part of the original line.
-This includes reading yet more input if necessary, 
+This includes reading yet more input if necessary,
 until a line is read that is not terminated by
 an unescaped backslash immediately before the newline.
 .\"



CVS commit: src/bin/sh

2022-09-15 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 15 18:00:36 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Correct spelling of terminal (it doesn't have a 2nd m).


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-09-15 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 15 18:00:36 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Correct spelling of terminal (it doesn't have a 2nd m).


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.244 src/bin/sh/sh.1:1.245
--- src/bin/sh/sh.1:1.244	Fri Aug 19 13:37:03 2022
+++ src/bin/sh/sh.1	Thu Sep 15 18:00:36 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.244 2022/08/19 13:37:03 kre Exp $
+.\"	$NetBSD: sh.1,v 1.245 2022/09/15 18:00:36 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -392,7 +392,7 @@ or
 given at invocation of
 .Nm ) ,
 and standard input and standard error refer to
-terminmal type devices.
+terminal type devices.
 .It Fl L Em local_lineno
 When set, before a function is defined,
 causes the variable



CVS commit: src/sys/arch/xen/xen

2022-09-01 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Sep  2 05:09:49 UTC 2022

Modified Files:
src/sys/arch/xen/xen: xenmem.c

Log Message:
Fix the syntax of the non _LP64 code fragment to match that in the
_LP64 fragment, so hopefully 32 bit ports with XEN (i386) will
build again.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/xen/xenmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/xenmem.c
diff -u src/sys/arch/xen/xen/xenmem.c:1.3 src/sys/arch/xen/xen/xenmem.c:1.4
--- src/sys/arch/xen/xen/xenmem.c:1.3	Thu Sep  1 16:28:08 2022
+++ src/sys/arch/xen/xen/xenmem.c	Fri Sep  2 05:09:49 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: xenmem.c,v 1.3 2022/09/01 16:28:08 bouyer Exp $ */
+/* $NetBSD: xenmem.c,v 1.4 2022/09/02 05:09:49 kre Exp $ */
 /*
  * Copyright (c) 2022 Manuel Bouyer.
  *
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xenmem.c,v 1.3 2022/09/01 16:28:08 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenmem.c,v 1.4 2022/09/02 05:09:49 kre Exp $");
 
 #include 
 #include 
@@ -62,7 +62,7 @@ xenmem_alloc_pa(u_long size, u_long alig
 	);
 #else
 	error = extent_alloc(XENMEM_EX, size, align, 0,
-	waitok ? ((EX_WAITSPACE | EX_WAITOK) : EX_NOWAIT) | EX_MALLOCOK,
+	(waitok ? (EX_WAITSPACE | EX_WAITOK) : EX_NOWAIT) | EX_MALLOCOK,
 	);
 #endif
 	if (error) {



CVS commit: src/sys/arch/xen/xen

2022-09-01 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Sep  2 05:09:49 UTC 2022

Modified Files:
src/sys/arch/xen/xen: xenmem.c

Log Message:
Fix the syntax of the non _LP64 code fragment to match that in the
_LP64 fragment, so hopefully 32 bit ports with XEN (i386) will
build again.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/xen/xenmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/etc/rc.d

2022-08-24 Thread Robert Elz
Date:Wed, 24 Aug 2022 20:37:54 +1000
From:Luke Mewburn 
Message-ID:  

  | I think it would be more consistent with existing convention
  | (in both NetBSD and on other systems) to add /etc/raid.d

I certainly won't be doing that, I detest the ".d" convention
as a general thing.   I personally prefer /etc/conf for config
files (I use it for all kinds of things) which then don't need
redundant ".conf" noise in their names (I have never much liked
the concept of filename extensions at all).

Note I didn't add the directory, for most people (who don't just
use raid autoconfig - at the minute I have reasons for not doing
that) can keep using the files that have always been used.  To
use /etc/conf/raid you have to go manually set it up for yourself.

If you want to add some other place where the files could be put,
by all means, go ahead.

kre

ps: that all happened over a month ago...



CVS commit: src/bin/sh

2022-08-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Aug 22 17:33:11 UTC 2022

Modified Files:
src/bin/sh: histedit.c

Log Message:
Add debugging trace points for history and the editline interface.
NFC for any normal shell (not compiled with debugging (sh DEBUG) enabled.

We have had a defined debug mode for this for years, but since I have
not often played in this arena, never used it.  Until recently (relatively).
This (or a small part of it) played a part in discovering the fc -e
bug cause.   I have had it in my tree a while now - recent changes
kept causing merge conflicts (all because I hadn't bothered to commit
this), so I think now is the time...


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/bin/sh/histedit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-08-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Aug 22 17:33:11 UTC 2022

Modified Files:
src/bin/sh: histedit.c

Log Message:
Add debugging trace points for history and the editline interface.
NFC for any normal shell (not compiled with debugging (sh DEBUG) enabled.

We have had a defined debug mode for this for years, but since I have
not often played in this arena, never used it.  Until recently (relatively).
This (or a small part of it) played a part in discovering the fc -e
bug cause.   I have had it in my tree a while now - recent changes
kept causing merge conflicts (all because I hadn't bothered to commit
this), so I think now is the time...


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/bin/sh/histedit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.64 src/bin/sh/histedit.c:1.65
--- src/bin/sh/histedit.c:1.64	Sun Aug 21 21:35:36 2022
+++ src/bin/sh/histedit.c	Mon Aug 22 17:33:11 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.c,v 1.64 2022/08/21 21:35:36 nia Exp $	*/
+/*	$NetBSD: histedit.c,v 1.65 2022/08/22 17:33:11 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.64 2022/08/21 21:35:36 nia Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.65 2022/08/22 17:33:11 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -65,6 +65,7 @@ __RCSID("$NetBSD: histedit.c,v 1.64 2022
 #ifndef SMALL
 #include "eval.h"
 #include "memalloc.h"
+#include "show.h"
 
 #define MAXHISTLOOPS	4	/* max recursions through fc */
 #define DEFEDITOR	"ed"	/* default editor *should* be $EDITOR */
@@ -97,6 +98,9 @@ histedit(void)
 
 #define editing (Eflag || Vflag)
 
+	CTRACE(DBG_HISTORY, ("histedit: %cE%cV %sinteractive\n",
+	Eflag ? '-' : '+',  Vflag ? '-' : '+', iflag ? "" : "not "));
+
 	if (iflag == 1) {
 		if (!hist) {
 			/*
@@ -152,6 +156,8 @@ histedit(void)
 			else
 unsetenv("TERM");
 			el = el_init("sh", el_in, el_out, el_err);
+			VTRACE(DBG_HISTORY, ("el_init() %sed\n",
+			el != NULL ? "succeed" : "fail"));
 			if (el != NULL) {
 if (hist)
 	el_set(el, EL_HIST, history, hist);
@@ -172,6 +178,7 @@ bad:
 			INTOFF;
 			el_end(el);
 			el = NULL;
+			VTRACE(DBG_HISTORY, ("line editing disabled\n"));
 			INTON;
 		}
 		if (el) {
@@ -180,6 +187,7 @@ bad:
 el_set(el, EL_EDITOR, "vi");
 			else if (Eflag)
 el_set(el, EL_EDITOR, "emacs");
+			VTRACE(DBG_HISTORY, ("reading $EDITRC\n"));
 			el_source(el, lookupvar("EDITRC"));
 			el_set(el, EL_BIND, "^I", 
 			tabcomplete ? "rl-complete" : "ed-insert", NULL);
@@ -196,6 +204,7 @@ bad:
 			hist = NULL;
 		}
 		INTON;
+		VTRACE(DBG_HISTORY, ("line editing & history disabled\n"));
 	}
 }
 
@@ -263,10 +272,13 @@ setterm(const char *term)
 int
 inputrc(int argc, char **argv)
 {
+	CTRACE(DBG_HISTORY, ("inputrc (%d arg%s)", argc-1, argc==2?"":"s"));
 	if (argc != 2) {
+		CTRACE(DBG_HISTORY, (" -- bad\n"));
 		out2str("usage: inputrc file\n");
 		return 1;
 	}
+	CTRACE(DBG_HISTORY, (" file: \"%s\"\n", argv[1]));
 	if (el != NULL) {
 		INTOFF;
 		if (el_source(el, argv[1])) {
@@ -310,6 +322,7 @@ histcmd(volatile int argc, char ** volat
 	if (hist == NULL)
 		error("history not active");
 
+	CTRACE(DBG_HISTORY, ("histcmd (fc) %d arg%s\n", argc, argc==1?"":"s"));
 	if (argc == 1)
 		error("missing history argument");
 
@@ -319,18 +332,23 @@ histcmd(volatile int argc, char ** volat
 		switch ((char)ch) {
 		case 'e':
 			editor = optarg;
+			VTRACE(DBG_HISTORY, ("histcmd -e %s\n", editor));
 			break;
 		case 'l':
 			lflg = 1;
+			VTRACE(DBG_HISTORY, ("histcmd -l\n"));
 			break;
 		case 'n':
 			nflg = 1;
+			VTRACE(DBG_HISTORY, ("histcmd -n\n"));
 			break;
 		case 'r':
 			rflg = 1;
+			VTRACE(DBG_HISTORY, ("histcmd -r\n"));
 			break;
 		case 's':
 			sflg = 1;
+			VTRACE(DBG_HISTORY, ("histcmd -s\n"));
 			break;
 		case ':':
 			error("option -%c expects argument", optopt);
@@ -355,12 +373,17 @@ histcmd(volatile int argc, char ** volat
 		savehandler = handler;
 		if (setjmp(jmploc.loc)) {
 			active = 0;
-			if (*editfile)
+			if (*editfile) {
+VTRACE(DBG_HISTORY,
+("histcmd err jump unlink temp \"%s\"\n",
+*editfile));
 unlink(editfile);
+			}
 			handler = savehandler;
 			longjmp(handler->loc, 1);
 		}
 		handler = 
+		VTRACE(DBG_HISTORY, ("histcmd was active %d (++)\n", active));
 		if (++active > MAXHISTLOOPS) {
 			active = 0;
 			displayhist = 0;
@@ -378,6 +401,8 @@ histcmd(volatile int argc, char ** volat
 sflg = 1;	/* no edit */
 editor = NULL;
 			}
+			VTRACE(DBG_HISTORY, ("histcmd using %s as editor\n",
+			editor == NULL ? "-nothing-" : editor));
 		}
 	}
 
@@ -389,6 +414,8 @@ histcmd(volatile int argc, char ** volat
 		pat = argv[0];
 		*repl++ = '\0';
 		argc--, argv++;
+		VTRACE(DBG_HISTORY, ("histcmd 

Re: CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Date:Fri, 19 Aug 2022 15:37:59 +
From:nia 
Message-ID:  

  | I wish editing mode and whether editing was enabled was more clearly
  | divorced.

That might be arranged, I will take a look and see what would be
involved (the major issue is making sure things get updated properly
when the user switches preferred editors - like if one is set as default
in some startup file, and the user then overrides that in another).
If things were to change such that most editing on/off decisions were
made by a separate option than emacs/vi mode, that issue would need
watching to make sure it is not forgotten/ignored.

And wrt:

  | it "feels right" that runtime commands take precedence over config files.

If it was the user manually typing "set -o vi" then yes, I'd agree that
generally that should probably take precedence.   But it almost never is,
those commands are almost always in a "config file" (like .profile or .shrc
or whatever the user wants to call the file in $ENV if they have one).

So what we really have, most of the time, is competing config files, and
and given the brutal nature of what set -o editor does, compared to the
more nuanced (at least, can be) EDITRC file, in this instance I think I'd
have EDITRC override the option's setup - apart from anything else, that's
how it has always been, and people are more likely to have a setup which
expects that, than the other way.

What might be possible however, is to have a change (or enabling, perhaps)
of editing mode, after the shell has issued its first prompt (ie: when it
is reading from the terminal - we know it is the terminal since none of this
stuff applies in any case other than an interactive shell reading from a tty)
have the shell only do the EL_SET "editor" command and not process EDITRC
again at all (if editing was enabled in a startup file, that will have
already been read, before the first prompt).   If the user after manually
choosing their editor of choice, wants their .editrc file processed again,
they can use the inputrc built in to read an editline config file of their
choice (like "inputrc $EDITRC" perhaps), or simply assign a new value to
EDITRC (like EDITRC=$EDITRC).   Either of those will cause the file to be
processed.   This ought to be relatively easy to implement, if it is 
conssidered a worthwhile enhancement (none of this affects me one way or
the other, I set vi mode before the prompt, and cetainly never change it
again, and I don't use a .editrc file (setting vi command maps, and everything
else the default works for me -- I don't use tabcomplete).

kre



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 13:37:03 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Improve the description of the read builtin command.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.243 src/bin/sh/sh.1:1.244
--- src/bin/sh/sh.1:1.243	Fri Jan  7 05:30:30 2022
+++ src/bin/sh/sh.1	Fri Aug 19 13:37:03 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.243 2022/01/07 05:30:30 lukem Exp $
+.\"	$NetBSD: sh.1,v 1.244 2022/08/19 13:37:03 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -3537,23 +3537,29 @@ and the built-in uses a separately cache
 .It Ic read Oo Fl p Ar prompt Oc Oo Fl r Oc Ar variable Op Ar ...
 The
 .Ar prompt
-is printed if the
+is printed on standard error if the
 .Fl p
 option is specified and the standard input is a terminal.
 Then a line is read from the standard input.
 The trailing newline is deleted from the
 line and the line is split as described in the field splitting section of the
 .Sx Word Expansions
-section above, and the pieces are assigned to the variables in order.
-If there are more pieces than variables, the remaining pieces
+section above.
+The pieces are assigned to the
+.Ar variable Ns s
+in order.
+If there are more pieces than variables,
+the remaining pieces
 (along with the characters in
 .Ev IFS
-that separated them) are assigned to the last variable.
+that separated them) are all assigned to the last
+.Ar variable .
 If there are more variables than pieces,
 the remaining variables are assigned the null string.
 The
 .Ic read
-built-in will indicate success unless EOF is encountered on input, in
+built-in will indicate success unless EOF, or a read error,
+is encountered on input, in
 which case failure is returned.
 .Pp
 By default, unless the
@@ -3562,8 +3568,14 @@ option is specified, the backslash
 .Dq \e
 acts as an escape character, causing the following character to be treated
 literally.
-If a backslash is followed by a newline, the backslash and the
-newline will be deleted.
+This is the only form of quoting that applies.
+If an unescaped backslash is followed by a newline,
+the backslash and the newline will be deleted,
+and replaced by the contents of the following line,
+which is processed as if it had been part of the original line.
+This includes reading yet more input if necessary, 
+until a line is read that is not terminated by
+an unescaped backslash immediately before the newline.
 .\"
 .Pp
 .It Ic readonly Ar name Ns Oo =value Oc ...



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 13:37:03 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Improve the description of the read builtin command.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 12:52:32 UTC 2022

Modified Files:
src/bin/sh: miscbltin.c

Log Message:
Don't output the error for bad usage (no var name given)
after already writing the prompt (set with the -p option).

That results in nonsense like:

$ read -p foo
fooread: arg count

While here, improve the error message so it means something.

Now we will get:

$ read -p foo
read: variable name required
Usage: read [-r] [-p prompt] var...

[Detected by code reading while doing the work for the previous fix]


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/bin/sh/miscbltin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 12:52:32 UTC 2022

Modified Files:
src/bin/sh: miscbltin.c

Log Message:
Don't output the error for bad usage (no var name given)
after already writing the prompt (set with the -p option).

That results in nonsense like:

$ read -p foo
fooread: arg count

While here, improve the error message so it means something.

Now we will get:

$ read -p foo
read: variable name required
Usage: read [-r] [-p prompt] var...

[Detected by code reading while doing the work for the previous fix]


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/bin/sh/miscbltin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/miscbltin.c
diff -u src/bin/sh/miscbltin.c:1.51 src/bin/sh/miscbltin.c:1.52
--- src/bin/sh/miscbltin.c:1.51	Fri Aug 19 12:17:18 2022
+++ src/bin/sh/miscbltin.c	Fri Aug 19 12:52:31 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: miscbltin.c,v 1.51 2022/08/19 12:17:18 kre Exp $	*/
+/*	$NetBSD: miscbltin.c,v 1.52 2022/08/19 12:52:31 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)miscbltin.c	8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: miscbltin.c,v 1.51 2022/08/19 12:17:18 kre Exp $");
+__RCSID("$NetBSD: miscbltin.c,v 1.52 2022/08/19 12:52:31 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -111,14 +111,15 @@ readcmd(int argc, char **argv)
 			rflag = 1;
 	}
 
+	if (*(ap = argptr) == NULL)
+		error("variable name required\n"
+			"Usage: read [-r] [-p prompt] var...");
+
 	if (prompt && isatty(0)) {
 		out2str(prompt);
 		flushall();
 	}
 
-	if (*(ap = argptr) == NULL)
-		error("arg count");
-
 	if ((ifs = bltinlookup("IFS", 1)) == NULL)
 		ifs = " \t\n";
 



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 12:17:18 UTC 2022

Modified Files:
src/bin/sh: miscbltin.c

Log Message:
PR bin/56972  Fix escape ('\') handling in sh read builtin.

In 1.35 (March 2005) (the big read fixup), most escape handling and IFS
processing in the read builtin was corrected.  However 2 cases were missed,
one is a word (something to be assigned to any variable but the last) in
which every character is escaped (the code was relying on a non-escaped char
to set the "in a word" status), and second trailing IFS whitespace at
the end of the line was being deleted, even if the chars had been escaped
(the escape chars are no longer present).

See the PR for more details (including the case that detected the problem).

After fixing this, I looked at the FreeBSD code (normally might do it
before, but these fixes were trivial) to check their implementation.
Their code does similar things to ours now does, but in a completely
different way, their read builtin is more complex than ours needs to
be (they handle more options).   For anyone tempted to simply incorporate
their code, note that it relies upon infrastructure changes elsewhere
in the shell, so would not be a simple cut and drop in exercise.

This needs pullups to -3 -4 -5 -6 -7 -8 and -9 (fortunately this is
happening before -10 is branched, so will never be broken this way there).


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/bin/sh/miscbltin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 12:17:18 UTC 2022

Modified Files:
src/bin/sh: miscbltin.c

Log Message:
PR bin/56972  Fix escape ('\') handling in sh read builtin.

In 1.35 (March 2005) (the big read fixup), most escape handling and IFS
processing in the read builtin was corrected.  However 2 cases were missed,
one is a word (something to be assigned to any variable but the last) in
which every character is escaped (the code was relying on a non-escaped char
to set the "in a word" status), and second trailing IFS whitespace at
the end of the line was being deleted, even if the chars had been escaped
(the escape chars are no longer present).

See the PR for more details (including the case that detected the problem).

After fixing this, I looked at the FreeBSD code (normally might do it
before, but these fixes were trivial) to check their implementation.
Their code does similar things to ours now does, but in a completely
different way, their read builtin is more complex than ours needs to
be (they handle more options).   For anyone tempted to simply incorporate
their code, note that it relies upon infrastructure changes elsewhere
in the shell, so would not be a simple cut and drop in exercise.

This needs pullups to -3 -4 -5 -6 -7 -8 and -9 (fortunately this is
happening before -10 is branched, so will never be broken this way there).


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/bin/sh/miscbltin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/miscbltin.c
diff -u src/bin/sh/miscbltin.c:1.50 src/bin/sh/miscbltin.c:1.51
--- src/bin/sh/miscbltin.c:1.50	Sat Apr 16 14:26:26 2022
+++ src/bin/sh/miscbltin.c	Fri Aug 19 12:17:18 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: miscbltin.c,v 1.50 2022/04/16 14:26:26 kre Exp $	*/
+/*	$NetBSD: miscbltin.c,v 1.51 2022/08/19 12:17:18 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)miscbltin.c	8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: miscbltin.c,v 1.50 2022/04/16 14:26:26 kre Exp $");
+__RCSID("$NetBSD: miscbltin.c,v 1.51 2022/08/19 12:17:18 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -100,6 +100,7 @@ readcmd(int argc, char **argv)
 	int i;
 	int is_ifs;
 	int saveall = 0;
+	ptrdiff_t wordlen = 0;
 
 	rflag = 0;
 	prompt = NULL;
@@ -137,7 +138,7 @@ readcmd(int argc, char **argv)
 break;
 			}
 			if (c != '\n')
-STPUTC(c, p);
+goto wdch;
 			continue;
 		}
 		if (c == '\n')
@@ -164,12 +165,14 @@ readcmd(int argc, char **argv)
 		}
 
 		if (is_ifs == 0) {
+  wdch:;
 			/* append this character to the current variable */
 			startword = 0;
 			if (saveall)
 /* Not just a spare terminator */
 saveall++;
 			STPUTC(c, p);
+			wordlen = p - stackblock();
 			continue;
 		}
 
@@ -187,11 +190,12 @@ readcmd(int argc, char **argv)
 		setvar(*ap, stackblock(), 0);
 		ap++;
 		STARTSTACKSTR(p);
+		wordlen = 0;
 	}
 	STACKSTRNUL(p);
 
 	/* Remove trailing IFS chars */
-	for (; stackblock() <= --p; *p = 0) {
+	for (; stackblock() + wordlen <= --p; *p = 0) {
 		if (!strchr(ifs, *p))
 			break;
 		if (strchr(" \t\n", *p))



Re: CVS commit: src/bin/sh

2022-08-18 Thread Robert Elz
Date:Thu, 18 Aug 2022 14:10:05 +
From:"Nia Alarie" 
Message-ID:  <20220818141005.5005af...@cvs.netbsd.org>

  | sh(1): Allow an explicit set -o vi or set -o emacs to override ~/.editrc

I'm not sure that change is a good idea - but it depends how you
view the .editrc file.

The effect of "set -o editor" (for whichever editor it uses), that
is when the shell does: el_set(el, EL_EDITOR, editor); is to essentially
set up all the key bindings so they match what that editor expects them
to be.   Doing that after having processed .editrc seems backwards to me,
as whatever that file did (at least for key bindings) is going to be lost.

I'd have expected that normally the idea would be to set the key bindings
for the editor of choice, and then use .editrc to override any that the
user wants to alter.   (editline (libedit) (and readline for that matter)
don't actually implement emacs or vi (duh!) what they do is provide a whole
set of functions that perform editing micro-actions on a line buffer, and
allow key bindings to invoke those functions.   The functions provided
implement the ability to edit text, using operations that perform similarly
to vi or emacs commands.   Setting vi or emacs mode simply sets all the
key bindings so that the keys act like they would when editing using the
corresponding editor.  But the user is free to mix and match to create an
environment that is even better (for this task, where many editing operations
that a full editor needs to provide make no sense), so a vi mode user can
bind ^A to "go to beginning of line" in insert mode if they want, just like
happens with emacs editing, rather than "insert a control-A" which would be
normal in vi, while otherwise having the command line editor act like vi.

That won't work if what .editrc is overridden by the el_set(EL_EDITOR)
operation.

The commands that can go in .editrc which don't affect the key bindings
(like setting the history size) should be unaffected by the order these two
steps are performed.

kre




CVS commit: src/external/public-domain/tz

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 14:32:34 UTC 2022

Modified Files:
src/external/public-domain/tz: tzdata2netbsd

Log Message:
Add support for fetching and using the Global Time Zone fork of tzdata
in addition to the older (Eggert) version.   The GTZ vesion is the one
we're currently using, so automating its use helps.

While here, correctly compare version numbers, correctly handling the
almost unthinkable need for a multi-char suffix after the year as the
version ID.  This was almost correct before, but would have failed in
the case that za was being updated to 1a

And add the ability (should not be needed often) to fetch one version
but claim to be using another (this was useful this time, as 2022c
followed quickly on the heels of 2022b - but made no changes at all
to the data, just some of the build infrastructure we don't use).
The GTZ version hadn't been updated (there was no real need, since the
data, which is all that it alters, had not changed) at the time, so
we updated to 2022c using the gtz data file for 2022b.  (The 2022cgtz
data file now exists - but didn't then).


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/public-domain/tz/tzdata2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/public-domain/tz/tzdata2netbsd
diff -u src/external/public-domain/tz/tzdata2netbsd:1.14 src/external/public-domain/tz/tzdata2netbsd:1.15
--- src/external/public-domain/tz/tzdata2netbsd:1.14	Tue Aug 16 13:23:12 2022
+++ src/external/public-domain/tz/tzdata2netbsd	Wed Aug 17 14:32:34 2022
@@ -1,4 +1,4 @@
-# $NetBSD: tzdata2netbsd,v 1.14 2022/08/16 13:23:12 kre Exp $
+# $NetBSD: tzdata2netbsd,v 1.15 2022/08/17 14:32:34 kre Exp $
 
 # For use by NetBSD developers when updating to new versions of tzdata.
 #
@@ -56,7 +56,9 @@ usage()
 	printf >&2 '%s\n'		\
 		"Usage: $0 [new-version-id [old-version-id]]"		\
 		" where a version-id is of the form x (eg: 2018c)" \
-		" or '' for new-version-id (to specify only the old)"
+		" or '' for new-version-id (to specify only the old)"  \
+		" and where new-version-id can have =fetch-version-id" \
+		" appended to specify fetching that version instead"
 	exit 2
 }
 
@@ -71,8 +73,12 @@ fail()
 valid_vers()
 {
 	case "$2" in
+	# The IANA (Eggert) standard version names
 	${VERS_PATTERN} | ${VERS_PATTERN}[a-z] )
 		;;
+	# The alternate (more rational) fork "global timezone" version
+	${VERS_PATTERN}gtz | ${VERS_PATTERN}[a-z]gtz )
+		;;
 	*)	printf >&2 '%s: %s\n' \
 		"Bad form for $1 version specifier '$2'" \
 		"should (usually) be 'x'"
@@ -121,7 +127,7 @@ get_curvers()
 
 argparse()
 {
-	local OVF
+	local OVF OV NV OVy OVs NVy NVs
 
 	if OVF=$(find "${WORK_PFX}" -name "${UPDATE_FROM##*/}" -mtime +2 -print)
 	then
@@ -156,6 +162,14 @@ argparse()
 	case "$#:$1" in
 	0: | 1: | 2: )
 		;;
+	1:=?*|2:=?*)	
+		valid_vers fetch "${1#=}" && FETCHVER="${1#=}" || usage
+		;;
+	1:*=?*|2:*=?*)	
+		set -- "{$1%=*}" "${1#*=}"
+		valid_vers fetch "$2" && FETCHVER="$2" || usage
+		valid_vers new "$1" && NEWVER="$1" || usage
+		;;
 	1:?*|2:?*)	
 		valid_vers new "$1" && NEWVER="$1" || usage
 		;;
@@ -165,6 +179,13 @@ argparse()
 
 	test -z "${NEWVER}" && get_curvers
 
+	test -z "${FETCHVER}" && FETCHVER=${NEWVER}
+
+	case "${FETCHVER}" in
+	*gtz)	GLOBAL=true;;
+	*)	GLOBAL=false;;
+	esac
+
 	test "${NEWVER}" = "${OLDVER}" && {
 		printf '%s\n' \
 		 "New and old versions both ${NEWVER}: nothing to do"
@@ -175,22 +196,50 @@ argparse()
 	printf '%s\n' "${OLDVER}" > "${UPDATE_FROM}" ||
 	fail "Unable to preserve old version ${OLDVER} in ${UPDATE_FROM}"
 
-	test "${#NEWVER}" -gt "${#OLDVER}" ||
-		test "${NEWVER}" '>' "${OLDVER}" ||
-		{
-			local reply
-
-			printf '%s\n' \
-			"Update would revert ${OLDVER} to ${NEWVER}"
-			read -p "Is reversion intended? " reply
-			case "${reply}" in
-			[Yy]*)	;;
-			*)	printf '%s\n' OK. Aborted.
-rm -f "${UPDATE_FROM}"
-exit 1
-;;
-			esac
+	# Do version upgrade test using base version names, ignoring
+	# the "gtz" in the "global timezone" versions, so we can
+	# switch back and forth between use of those as circumstances change
+	OV=${OLDVER%gtz}
+	NV=${NEWVER%gtz}
+
+	OVy=${OV%%[!0-9]*}
+	OVs=${OV#${OVy}}
+	NVy=${NV%%[!0-9]*}
+	NVs=${NV#${NVy}}
+
+	# To get all the permutations correct, we need to separate
+	# the year and suffix parts of the version IDs (done just above)
+	# and then compare them separately.  The suffix is only relevant
+	# to the result when the years are the same.
+
+	# We compare the length of the suffix separately to the suffix
+	# itself, a multi-char suffix has never happened (and is never
+	# likely to) - but in the event that prediction is wrong, we don't
+	# know (yet) what is to come after 'z' - it might be 'za' 'zb'
+	# ... to 'zz" then 'zza' ... or it might be 'aa' 'ab' ... 'az' 'ba'...

CVS commit: src/external/public-domain/tz

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 14:32:34 UTC 2022

Modified Files:
src/external/public-domain/tz: tzdata2netbsd

Log Message:
Add support for fetching and using the Global Time Zone fork of tzdata
in addition to the older (Eggert) version.   The GTZ vesion is the one
we're currently using, so automating its use helps.

While here, correctly compare version numbers, correctly handling the
almost unthinkable need for a multi-char suffix after the year as the
version ID.  This was almost correct before, but would have failed in
the case that za was being updated to 1a

And add the ability (should not be needed often) to fetch one version
but claim to be using another (this was useful this time, as 2022c
followed quickly on the heels of 2022b - but made no changes at all
to the data, just some of the build infrastructure we don't use).
The GTZ version hadn't been updated (there was no real need, since the
data, which is all that it alters, had not changed) at the time, so
we updated to 2022c using the gtz data file for 2022b.  (The 2022cgtz
data file now exists - but didn't then).


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/public-domain/tz/tzdata2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/base

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 14:03:05 UTC 2022

Modified Files:
src/distrib/sets/lists/base: mi

Log Message:
Add Europe/Kyiv to the sets list - fix the builds.   Apologies...


To generate a diff of this commit:
cvs rdiff -u -r1.1310 -r1.1311 src/distrib/sets/lists/base/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/base

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 14:03:05 UTC 2022

Modified Files:
src/distrib/sets/lists/base: mi

Log Message:
Add Europe/Kyiv to the sets list - fix the builds.   Apologies...


To generate a diff of this commit:
cvs rdiff -u -r1.1310 -r1.1311 src/distrib/sets/lists/base/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1310 src/distrib/sets/lists/base/mi:1.1311
--- src/distrib/sets/lists/base/mi:1.1310	Sun Jun 12 03:51:13 2022
+++ src/distrib/sets/lists/base/mi	Wed Aug 17 14:03:05 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1310 2022/06/12 03:51:13 tsutsui Exp $
+# $NetBSD: mi,v 1.1311 2022/08/17 14:03:05 kre Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -5585,6 +5585,7 @@
 ./usr/share/zoneinfo/Europe/Kiev		base-sys-share		share
 ./usr/share/zoneinfo/Europe/Kirov		base-sys-share		share
 ./usr/share/zoneinfo/Europe/Kuybyshev		base-obsolete		obsolete
+./usr/share/zoneinfo/Europe/Kyiv		base-sys-share		share
 ./usr/share/zoneinfo/Europe/Lisbon		base-sys-share		share
 ./usr/share/zoneinfo/Europe/Ljubljana		base-sys-share		share
 ./usr/share/zoneinfo/Europe/London		base-sys-share		share



CVS commit: src/doc

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 12:25:47 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
Balance the parentheses in the previous update...


To generate a diff of this commit:
cvs rdiff -u -r1.2899 -r1.2900 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2899 src/doc/CHANGES:1.2900
--- src/doc/CHANGES:1.2899	Wed Aug 17 12:24:42 2022
+++ src/doc/CHANGES	Wed Aug 17 12:25:47 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2899 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2900 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -655,5 +655,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	bge(4): Allow the driver to work without the big kernel lock
 		(support for NET_MPSAFE).  [skrll 20220814]
 	tzcode: Updated to 2022c. [christos 20220816]
-	tzdata: updated to 2022c (using the 2022bgtz fork
+	tzdata: updated to 2022c (using the 2022bgtz fork)
 		(tzdata2022b==tzdata2022c)  [kre 20220817]



CVS commit: src/doc

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 12:25:47 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
Balance the parentheses in the previous update...


To generate a diff of this commit:
cvs rdiff -u -r1.2899 -r1.2900 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 12:24:42 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note tzdata2022c


To generate a diff of this commit:
cvs rdiff -u -r1.1868 -r1.1869 src/doc/3RDPARTY
cvs rdiff -u -r1.2898 -r1.2899 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1868 src/doc/3RDPARTY:1.1869
--- src/doc/3RDPARTY:1.1868	Tue Aug 16 11:09:08 2022
+++ src/doc/3RDPARTY	Wed Aug 17 12:24:42 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1868 2022/08/16 11:09:08 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1869 2022/08/17 12:24:42 kre Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1410,7 +1410,7 @@ Notes:
 Added changes from a5 -> a12 manually.
 
 Package:	tz
-Version:	tzcode2022c / tzdata2022agtz
+Version:	tzcode2022c / tzdata2022bgtz (tzdata2022c)
 Current Vers:	tzcode2022c / tzdata2022c
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2898 src/doc/CHANGES:1.2899
--- src/doc/CHANGES:1.2898	Tue Aug 16 11:09:08 2022
+++ src/doc/CHANGES	Wed Aug 17 12:24:42 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2898 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2899 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -655,3 +655,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	bge(4): Allow the driver to work without the big kernel lock
 		(support for NET_MPSAFE).  [skrll 20220814]
 	tzcode: Updated to 2022c. [christos 20220816]
+	tzdata: updated to 2022c (using the 2022bgtz fork
+		(tzdata2022b==tzdata2022c)  [kre 20220817]



CVS commit: src/doc

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 12:24:42 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note tzdata2022c


To generate a diff of this commit:
cvs rdiff -u -r1.1868 -r1.1869 src/doc/3RDPARTY
cvs rdiff -u -r1.2898 -r1.2899 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/public-domain/tz/dist

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 12:19:41 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: TZDATA_VERSION asia australasia
backward leap-seconds.list leapseconds version

Log Message:
Merge tzdata2022c


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/external/public-domain/tz/dist/TZDATA_VERSION
cvs rdiff -u -r1.4 -r1.5 src/external/public-domain/tz/dist/asia \
src/external/public-domain/tz/dist/australasia \
src/external/public-domain/tz/dist/version
cvs rdiff -u -r1.3 -r1.4 src/external/public-domain/tz/dist/backward \
src/external/public-domain/tz/dist/leap-seconds.list \
src/external/public-domain/tz/dist/leapseconds

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS import: src/external/public-domain/tz/dist

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 12:17:57 UTC 2022

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv6507

Log Message:
Import tzdata2022c from 
https://github.com/JodaOrg/global-tz/releases/download//2022bgtz/tzdata2022bgtz.tar.gz

Summary of changes in tzdata2022c (2022-08-15 17:47:18 -0700):
  * None.

Summary of changes in tzdata2022b (2022-08-10 15:38:32 -0700):
  * Chile's 2022 DST start is delayed from September 4 to September 11.
  * Iran plans to stop observing DST permanently, after it falls back
on 2022-09-21.
  * From fall 1994 through fall 1995, Shanks wrote that Crimea's
DST transitions were at 02:00 standard time, not at 00:00.
  * Iran adopted standard time in 1935, not 1946.
  * Chile's observance of -04 from 1946-08-29 through 1947-03-31 was
considered DST, not standard time.
  * Some old, small clock transitions have been removed, as people at
the time did not change their clocks.

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2022CGTZ

U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/SECURITY
U src/external/public-domain/tz/dist/theory.html
C src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
C src/external/public-domain/tz/dist/asia
C src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
C src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
C src/external/public-domain/tz/dist/leap-seconds.list
C src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk
U src/external/public-domain/tz/dist/zoneinfo2tdf.pl

6 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA 
src/external/public-domain/tz/dist



CVS import: src/external/public-domain/tz/dist

2022-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 17 12:17:57 UTC 2022

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv6507

Log Message:
Import tzdata2022c from 
https://github.com/JodaOrg/global-tz/releases/download//2022bgtz/tzdata2022bgtz.tar.gz

Summary of changes in tzdata2022c (2022-08-15 17:47:18 -0700):
  * None.

Summary of changes in tzdata2022b (2022-08-10 15:38:32 -0700):
  * Chile's 2022 DST start is delayed from September 4 to September 11.
  * Iran plans to stop observing DST permanently, after it falls back
on 2022-09-21.
  * From fall 1994 through fall 1995, Shanks wrote that Crimea's
DST transitions were at 02:00 standard time, not at 00:00.
  * Iran adopted standard time in 1935, not 1946.
  * Chile's observance of -04 from 1946-08-29 through 1947-03-31 was
considered DST, not standard time.
  * Some old, small clock transitions have been removed, as people at
the time did not change their clocks.

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2022CGTZ

U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/SECURITY
U src/external/public-domain/tz/dist/theory.html
C src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
C src/external/public-domain/tz/dist/asia
C src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
C src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
C src/external/public-domain/tz/dist/leap-seconds.list
C src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk
U src/external/public-domain/tz/dist/zoneinfo2tdf.pl

6 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA 
src/external/public-domain/tz/dist



CVS commit: src/external/public-domain/tz

2022-08-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Aug 16 13:23:12 UTC 2022

Modified Files:
src/external/public-domain/tz: tzdata2netbsd

Log Message:
Change the NEWS parser to handle the more recent (as in going back several
years now) format (wording) that is used there, rather than that which
preceded it.   With this we get the intended "what changed" in the generated
CVS commit message, rather than lots of emptiness.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/public-domain/tz/tzdata2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/public-domain/tz

2022-08-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Aug 16 13:23:12 UTC 2022

Modified Files:
src/external/public-domain/tz: tzdata2netbsd

Log Message:
Change the NEWS parser to handle the more recent (as in going back several
years now) format (wording) that is used there, rather than that which
preceded it.   With this we get the intended "what changed" in the generated
CVS commit message, rather than lots of emptiness.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/public-domain/tz/tzdata2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/public-domain/tz/tzdata2netbsd
diff -u src/external/public-domain/tz/tzdata2netbsd:1.13 src/external/public-domain/tz/tzdata2netbsd:1.14
--- src/external/public-domain/tz/tzdata2netbsd:1.13	Tue Aug 16 13:19:41 2022
+++ src/external/public-domain/tz/tzdata2netbsd	Tue Aug 16 13:23:12 2022
@@ -1,4 +1,4 @@
-# $NetBSD: tzdata2netbsd,v 1.13 2022/08/16 13:19:41 kre Exp $
+# $NetBSD: tzdata2netbsd,v 1.14 2022/08/16 13:23:12 kre Exp $
 
 # For use by NetBSD developers when updating to new versions of tzdata.
 #
@@ -467,11 +467,11 @@ EOF
 " ("date"):";
 		}
 		/^$/ { blankline = 1; havesentence = 0; }
-		/^  Changes affecting/ { goodsection = 0; }
-		/^  Changes affecting.*time/ { goodsection = 1; }
-		/^  Changes affecting.*data/ { goodsection = 1; }
-		/^  Changes affecting.*documentation/ || \
-		/^  Changes affecting.*commentary/ {
+		/^  Changes / { goodsection = 0; }
+		/^  Changes to future timestamps/ { goodsection = 1; }
+		/^  Changes to past timestamps/ { goodsection = 1; }
+		/^  Changes to documentation/ || \
+		/^  Changes to commentary/ {
 			t = gensub("^ *", "", 1, $0);
 			t = gensub("\\.*$", ".", 1, t);
 			print bullet t;



CVS commit: src/external/public-domain/tz

2022-08-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Aug 16 13:19:42 UTC 2022

Modified Files:
src/external/public-domain/tz: tzdata2netbsd

Log Message:
Correct a typo in a comment.   NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/public-domain/tz/tzdata2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/public-domain/tz/tzdata2netbsd
diff -u src/external/public-domain/tz/tzdata2netbsd:1.12 src/external/public-domain/tz/tzdata2netbsd:1.13
--- src/external/public-domain/tz/tzdata2netbsd:1.12	Sat Mar 24 01:54:48 2018
+++ src/external/public-domain/tz/tzdata2netbsd	Tue Aug 16 13:19:41 2022
@@ -1,4 +1,4 @@
-# $NetBSD: tzdata2netbsd,v 1.12 2018/03/24 01:54:48 kre Exp $
+# $NetBSD: tzdata2netbsd,v 1.13 2022/08/16 13:19:41 kre Exp $
 
 # For use by NetBSD developers when updating to new versions of tzdata.
 #
@@ -288,7 +288,7 @@ shell_quote()
 			# Finally, elide unnecessary '' pairs at the
 			# beginning and end of the result and as part of
 			# '\'''\'' sequences that result from multiple
-			# adjacent quotes in he input.
+			# adjacent quotes in the input.
 			qarg="$(printf '%s\n' "$arg" | \
 			${SED:-sed} -e "s/'/'''/g" \
 -e "1s/^/'/" -e "\$s/\$/'/" \



CVS commit: src/external/public-domain/tz

2022-08-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Aug 16 13:19:42 UTC 2022

Modified Files:
src/external/public-domain/tz: tzdata2netbsd

Log Message:
Correct a typo in a comment.   NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/public-domain/tz/tzdata2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-08-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Aug  9 07:39:21 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
Minor alteration to the description of what df -b does (plus tiny reformat)


To generate a diff of this commit:
cvs rdiff -u -r1.2895 -r1.2896 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-08-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Aug  9 07:39:21 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
Minor alteration to the description of what df -b does (plus tiny reformat)


To generate a diff of this commit:
cvs rdiff -u -r1.2895 -r1.2896 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2895 src/doc/CHANGES:1.2896
--- src/doc/CHANGES:1.2895	Tue Aug  9 06:57:30 2022
+++ src/doc/CHANGES	Tue Aug  9 07:39:21 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2895 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2896 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -635,6 +635,6 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	kernel: Enable UFS_DIRHASH optimization if the architecture or
 		machine-specific kernel config file can use 128MB of RAM or
 		more.  [simonb 20220807]
-	df(1): Add -b (set blocksize), -H (-h using SI units), -N
-		(suppress the header line), and -f (show only free space)
+	df(1): Add -b (output unit: blocks; 512), -H (-h using SI units),
+		-N (suppress the header line), and -f (show only free space)
 		options.  [kre 20220808]



CVS commit: src/bin/df

2022-08-08 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Aug  8 16:50:35 UTC 2022

Modified Files:
src/bin/df: df.1 df.c

Log Message:
Add 4 new flags:
-b (from FreeBSD) - set blocksize to blocks (512 bytes)
(overrides a contrary setting in BLOCKSIZE)
-H (from FreeBSD and Linux): -h using SI units (powers of 10).  Ugh.
-N suppress the header line (except with -P which requires it).
-f show only free space (or inodes) in a minimal format (implies -N)
(that is, with one file[system] specified, print 1 number only)
With -c, show only the total.
Intended to be useful for scripting (aka, I needed it.)

While here, improve the usage message (group options where they apply,
there is no reason, for example, that -g should be shown differently
to -k -m ..., and those options aren't at all useful with -G)

Update the man page to match.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/df/df.1
cvs rdiff -u -r1.99 -r1.100 src/bin/df/df.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/df/df.1
diff -u src/bin/df/df.1:1.56 src/bin/df/df.1:1.57
--- src/bin/df/df.1:1.56	Wed Jan  6 20:38:09 2021
+++ src/bin/df/df.1	Mon Aug  8 16:50:35 2022
@@ -1,5 +1,3 @@
-.\"	$NetBSD: df.1,v 1.56 2021/01/06 20:38:09 ginsbach Exp $
-.\"
 .\" Copyright (c) 1989, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -29,7 +27,7 @@
 .\"
 .\"	@(#)df.1	8.2 (Berkeley) 1/13/92
 .\"
-.Dd January 2, 2021
+.Dd August 8, 2022
 .Dt DF 1
 .Os
 .Sh NAME
@@ -37,10 +35,10 @@
 .Nd display free disk space
 .Sh SYNOPSIS
 .Nm
-.Op Fl acglnW
-.Op Fl Ghkm | Fl ihkm | Fl Pk
+.Op Fl aclnW
+.Op Fl G | Fl Pbk | Fl bfgHhikmN
 .Op Fl t Ar type
-.Op Ar file | Ar file_system ...
+.Oo Ar file | Ar file_system Oc Ns ...
 .Sh DESCRIPTION
 .Nm
 displays statistics about the amount of free disk space on the specified
@@ -52,8 +50,12 @@ By default, all sizes are reported in 51
 If neither a file or a
 .Ar file_system
 operand is specified,
-statistics for all mounted file systems are displayed
+statistics for all mounted,
+and not hidden (i.e.: not mounted with
+.Dv MNT_IGNORE ) ,
+file systems are displayed
 (subject to the
+.Fl a ,
 .Fl l
 and
 .Fl t
@@ -68,26 +70,68 @@ on the file system is less than
 The following options are available:
 .Bl -tag -width Ds
 .It Fl a
-Show all mount points,
+If no
+.Ar file ,
+or
+.Ar file_system
+arguments are givem, show all mount points,
 including those that were mounted with the
 .Dv MNT_IGNORE
 flag.
+Note that for file systems specified on the command
+line, that mount option is never considered.
+.It Fl b
+Show space as units of basic blocks (512 bytes).
+This is normally the default; this option can be used to
+override a conflicting setting in the environment variable
+.Ev BLOCKSIZE .
 .It Fl c
 Display a grand total for all shown mount points.
+When combined with
+.Fl f
+only the total for the mount points which otherwise
+would be included is shown, not the individual entries.
+.It Fl f
+Display only the available free space (or with
+.Fl i ,
+free inodes) in a minimal format.
+When there is to be only one line of output, only the value
+is shown, otherwise the value and the mount point,
+separated by a single space, are printed.
+For free space, the
+.Fl b ,
+.Fl g ,
+.Fl H ,
+.Fl h ,
+.Fl k
+and
+.Fl m
+options, and
+.Ev BLOCKSIZE
+are all used as normal.
+This option implies
+.Fl N
+and is incompatible with
+.Fl P
+and
+.Fl G .
 .It Fl G
 Display all the fields of the structure(s) returned by
 .Xr statvfs 2 .
 This option cannot be used with the
+.Fl f ,
 .Fl i
 or
 .Fl P
-options, and it is modelled after the Solaris
+options, and is modelled after the Solaris
 .Fl g
 option.
 This option will override the
+.Fl b ,
 .Fl g ,
+.Fl H ,
 .Fl h ,
-.Fl k ,
+.Fl k
 and
 .Fl m
 options, as well as any setting of
@@ -95,20 +139,32 @@ options, as well as any setting of
 .It Fl g
 The
 .Fl g
-option causes the numbers to be reported in gigabytes (1024*1024*1024
+option causes size numbers to be reported in gigabytes (1024*1024*1024
 bytes).
 .It Fl h
-"Human-readable" output.
+Use
+.Dq human-readable
+output for space data.
 Use unit suffixes: Byte, Kilobyte, Megabyte,
 Gigabyte, Terabyte, Petabyte, Exabyte in order to reduce the number of
 digits to four or less.
+.It Fl H
+As with
+.Fl h
+but using powers of 10 (1000) rather than 2 (1024).
 .It Fl i
 Include statistics on the number of free inodes.
+When combined with
+.Fl f
+only the number of free inodes is shown.
 .It Fl k
-By default, all sizes are reported in 512-byte block counts.
+By default, all sizes are reported in 512-byte block counts,
+unless the
+.Ev BLOCKSIZE
+environment variable is set.
 The
 .Fl k
-option causes the numbers to be reported in kilobytes (1024 bytes).
+option causes the size numbers to be 

CVS commit: src/bin/df

2022-08-08 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Aug  8 16:50:35 UTC 2022

Modified Files:
src/bin/df: df.1 df.c

Log Message:
Add 4 new flags:
-b (from FreeBSD) - set blocksize to blocks (512 bytes)
(overrides a contrary setting in BLOCKSIZE)
-H (from FreeBSD and Linux): -h using SI units (powers of 10).  Ugh.
-N suppress the header line (except with -P which requires it).
-f show only free space (or inodes) in a minimal format (implies -N)
(that is, with one file[system] specified, print 1 number only)
With -c, show only the total.
Intended to be useful for scripting (aka, I needed it.)

While here, improve the usage message (group options where they apply,
there is no reason, for example, that -g should be shown differently
to -k -m ..., and those options aren't at all useful with -G)

Update the man page to match.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/df/df.1
cvs rdiff -u -r1.99 -r1.100 src/bin/df/df.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/tests/lib/libc/sys

2022-08-01 Thread Robert Elz
Date:Mon, 1 Aug 2022 18:55:15 +0300
From:Valery Ushakov 
Message-ID:  

  | The test uses __clone(), not clone() and a followup fix made __clone()
  | visible under plain _NETBSD_SOURCE again - which is the right thing,
  | IMO.  So this change is not necessary (the test only uses __clone()).

Yes, I saw, but the test really should be using clone() - that"s
the thing which needs to work (for those odd apps which use it).

kre


CVS commit: src/tests/lib/libc/sys

2022-08-01 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Aug  1 15:48:40 UTC 2022

Modified Files:
src/tests/lib/libc/sys: Makefile

Log Message:
Provide _GNU_SOURCE for t_clone now that is required to make clone()
visible.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/tests/lib/libc/sys/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.71 src/tests/lib/libc/sys/Makefile:1.72
--- src/tests/lib/libc/sys/Makefile:1.71	Wed Apr  6 10:02:55 2022
+++ src/tests/lib/libc/sys/Makefile	Mon Aug  1 15:48:39 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.71 2022/04/06 10:02:55 gson Exp $
+# $NetBSD: Makefile,v 1.72 2022/08/01 15:48:39 kre Exp $
 
 MKMAN=	no
 
@@ -120,6 +120,7 @@ CPPFLAGS.t_futex_robust.c	+= -I${.CURDIR
 
 CPPFLAGS.t_timerfd.c		+= -I${.CURDIR}/../gen
 
+CPPFLAGE.t_clone.c		+= -D_NETBSD_SOURCE -D_GNU_SOURCE
 CPPFLAGS.t_lwp_create.c		+= -D_KERNTYPES
 CPPFLAGS.t_ptrace_sigchld.c	+= -D__TEST_FENV
 CPPFLAGS.t_ptrace_wait.c	+= -D_KERNTYPES -D__TEST_FENV



CVS commit: src/tests/lib/libc/sys

2022-08-01 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Aug  1 15:48:40 UTC 2022

Modified Files:
src/tests/lib/libc/sys: Makefile

Log Message:
Provide _GNU_SOURCE for t_clone now that is required to make clone()
visible.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/tests/lib/libc/sys/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



  1   2   3   4   5   6   7   >