1
0
mirror of https://salsa.debian.org/games-team/bsdgames synced 2024-12-04 14:46:22 -05:00
bsdgames/debian/patches/0021-Sync-countmail-with-NetBSD-HEAD.patch
2023-07-29 23:51:06 +02:00

124 lines
3.7 KiB
Diff

From: "Dr. Tobias Quathamer" <toddy@debian.org>
Date: Sat, 29 Jul 2023 21:56:13 +0200
Subject: Sync countmail with NetBSD-HEAD
---
countmail/countmail | 34 ++++------------------------------
countmail/countmail.6 | 15 ++++++++-------
2 files changed, 12 insertions(+), 37 deletions(-)
diff --git a/countmail/countmail b/countmail/countmail
index e574d6c..17537be 100644
--- a/countmail/countmail
+++ b/countmail/countmail
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: countmail,v 1.5 2002/07/02 17:18:21 mycroft Exp $
+# $NetBSD: countmail,v 1.8 2021/05/02 13:10:36 rillig Exp $
#
# Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -16,13 +16,6 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the NetBSD
-# Foundation, Inc. and its contributors.
-# 4. Neither the name of The NetBSD Foundation nor the names of its
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -37,29 +30,10 @@
# POSSIBILITY OF SUCH DAMAGE.
#
-# Count the messages in your mailbox, using only POSIX shell builtins.
+# Count the messages in your mailbox.
#
-# Caveats:
-#
-# The read loop is horrendously slow on every implementation I've
-# tried. I suggest using from(1) and wc(1) instead, though these are
-# not shell builtins.
-
-# for krb.
-#set -- `from -t`
-#v=$3
-set -- `from | wc -l`
+set -- `from 2>/dev/null | wc -l`
v=$1
-#v=`from | wc -l`
-
-#v=0
-#exec 0</var/mail/$USER
-#while read line; do
-# case "$line" in
-# "From "*) v=$(($v + 1)) ;;
-# esac
-#done
-#exec 0<&-
set --
g=0
@@ -158,6 +132,6 @@ esac
echo "$*!
-$* MAIL MESSAGE$p!
+$* NEW MAIL MESSAGE$p!
HAHAHAHAHA!"
diff --git a/countmail/countmail.6 b/countmail/countmail.6
index 015ada0..7275c65 100644
--- a/countmail/countmail.6
+++ b/countmail/countmail.6
@@ -1,4 +1,4 @@
-.\" $NetBSD: countmail.6,v 1.10 2004/02/08 00:31:16 jsm Exp $
+.\" $NetBSD: countmail.6,v 1.14 2014/03/18 18:20:36 riastradh Exp $
.\"
.\" Copyright (c) 1997 Matthew R. Green
.\" All rights reserved.
@@ -11,8 +11,6 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 3. The name of the author may not be used to endorse or promote products
-.\" derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -38,16 +36,21 @@
The
.Nm
program counts your mail and tells you about it rather obnoxiously.
+.Sh SEE ALSO
+.Xr from 1
.Sh HISTORY
The
.Nm
program first appeared in
.Nx 1.3 .
+.Sh AUTHORS
+.An -nosplit
.Nm
was first written by
-.An Noah Friedman Aq friedman@splode.com
+.An Noah Friedman Aq Mt friedman@splode.com
in 1993.
-This version was written by Charles M. Hannum
+This version was written by
+.An Charles M. Hannum
.Aq mycroft@NetBSD.org .
.Sh CAVEATS
The read loop is horrendously slow on every shell implementation tried.
@@ -57,5 +60,3 @@ uses
and
.Xr wc 1
instead, though these are not shell builtins.
-.Sh SEE ALSO
-.Xr from 1