pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/daemontools-encore Apply upstream patch to fi...
details: https://anonhg.NetBSD.org/pkgsrc/rev/9a650a8566e4
branches: trunk
changeset: 422294:9a650a8566e4
user: schmonz <schmonz%pkgsrc.org@localhost>
date: Thu Jan 23 16:49:59 2020 +0000
description:
Apply upstream patch to fix self-tests on NetBSD 8 and 9, FreeBSD 12,
and OpenBSD 6.6. Self-tests continue to pass on macOS, Debian, and
Devuan. (Some test failures remain on CentOS and Tribblix.) Bump
PKGREVISION.
diffstat:
sysutils/daemontools-encore/Makefile | 3 +-
sysutils/daemontools-encore/distinfo | 3 +-
sysutils/daemontools-encore/patches/patch-sleeper.c | 145 ++++++++++++++++++++
3 files changed, 149 insertions(+), 2 deletions(-)
diffs (175 lines):
diff -r 5bc05aaf84c5 -r 9a650a8566e4 sysutils/daemontools-encore/Makefile
--- a/sysutils/daemontools-encore/Makefile Thu Jan 23 16:45:48 2020 +0000
+++ b/sysutils/daemontools-encore/Makefile Thu Jan 23 16:49:59 2020 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2020/01/21 21:54:25 schmonz Exp $
+# $NetBSD: Makefile,v 1.2 2020/01/23 16:49:59 schmonz Exp $
DISTNAME= daemontools-encore-1.11
+PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= ${HOMEPAGE}
diff -r 5bc05aaf84c5 -r 9a650a8566e4 sysutils/daemontools-encore/distinfo
--- a/sysutils/daemontools-encore/distinfo Thu Jan 23 16:45:48 2020 +0000
+++ b/sysutils/daemontools-encore/distinfo Thu Jan 23 16:49:59 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1 2020/01/22 01:26:16 schmonz Exp $
+$NetBSD: distinfo,v 1.2 2020/01/23 16:49:59 schmonz Exp $
SHA1 (daemontools-encore-1.11.tar.gz) = 23f8dc5cf2d063c481b328fce523fc8a0349b693
RMD160 (daemontools-encore-1.11.tar.gz) = 518f85f1502bf969ee60d5169642089752bd2d52
@@ -7,3 +7,4 @@
SHA1 (patch-MAN) = 7c361a3365a43a992d7a0ccf938b79dc2a8691bc
SHA1 (patch-Makefile) = b1bc2500071491280a02f158bf4d8ed4e0aa369e
SHA1 (patch-rts.tests_supervise-downtime.sh) = c6415e1c0adce32e5ad57ad5457fd1be98c53958
+SHA1 (patch-sleeper.c) = cdae9837bb8a5cc268c8e86e97e03d11f8e9d32d
diff -r 5bc05aaf84c5 -r 9a650a8566e4 sysutils/daemontools-encore/patches/patch-sleeper.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/daemontools-encore/patches/patch-sleeper.c Thu Jan 23 16:49:59 2020 +0000
@@ -0,0 +1,145 @@
+$NetBSD: patch-sleeper.c,v 1.1 2020/01/23 16:49:59 schmonz Exp $
+
+Apply https://github.com/bruceg/daemontools-encore/pull/54 to fix tests.
+
+--- sleeper.c.orig 2018-10-14 00:48:50.000000000 +0000
++++ sleeper.c
+@@ -1,39 +1,84 @@
++#include <unistd.h>
+ #include <signal.h>
++#include "ndelay.h"
++#include "strerr.h"
++#include "error.h"
+ #include "byte.h"
+ #include "sig.h"
+ #include "str.h"
+-#include <unistd.h>
++
++static int selfpipe[2];
+
+ static void catch_sig(int sig)
+ {
++ int ignored;
++ char c;
++
++ c = (char)sig;
++ ignored = write(selfpipe[1],&c,1);
++ (void)ignored;
++}
++
++static void show_sig(int sig)
++{
+ char buf[7+14+2] = "Caught ";
+ const char *name;
+ int ignored;
+ int i;
++
+ switch (sig) {
+- case SIGALRM: name = "ALRM"; break;
+- case SIGCONT: name = "CONT"; break;
+- case SIGHUP: name = "HUP"; break;
+- case SIGINT: name = "INT"; break;
+- case SIGQUIT: name = "QUIT"; break;
+- case SIGTERM: name = "TERM"; break;
+- case SIGUSR1: name = "USR1"; break;
+- case SIGUSR2: name = "USR2"; break;
+- case SIGWINCH: name = "WINCH"; break;
+- default: name = "unknown signal";
++ case SIGALRM: name = "ALRM"; break;
++ case SIGCONT: name = "CONT"; break;
++ case SIGHUP: name = "HUP"; break;
++ case SIGINT: name = "INT"; break;
++ case SIGQUIT: name = "QUIT"; break;
++ case SIGTERM: name = "TERM"; break;
++ case SIGUSR1: name = "USR1"; break;
++ case SIGUSR2: name = "USR2"; break;
++ case SIGWINCH: name = "WINCH"; break;
++ default: name = "unknown signal";
+ }
+ i = str_len(name);
+ byte_copy(buf+7,i,name);
+ i += 7;
+ buf[i++] = '\n';
+ ignored = write(1,buf,i);
+- if (sig != SIGCONT)
+- _exit(1);
+ (void)ignored;
+ }
+
++static void show_err()
++{
++ int ignored;
++
++ ignored = write(1,"invalid signal\n",15);
++ return;
++ (void)ignored;
++}
++
++static void show_one(int sig)
++{
++ show_sig(sig);
++ return;
++}
++
++static void show_two(int sig1, int sig2)
++{
++ show_sig(sig1);
++ show_sig(sig2);
++ return;
++}
++
+ int main(void)
+ {
++ int r;
++ int nc, nt, oc, ot;
++ int new_sig, old_sig=0;
++ char buf;
++
++ if (pipe(selfpipe) == -1)
++ strerr_die1sys(111,"sleeper: fatal: unable to create pipe");
++ ndelay_on(selfpipe[1]);
++
+ sig_catch(SIGALRM,catch_sig);
+ sig_catch(SIGCONT,catch_sig);
+ sig_catch(SIGHUP,catch_sig);
+@@ -43,6 +88,38 @@ int main(void)
+ sig_catch(SIGUSR1,catch_sig);
+ sig_catch(SIGUSR2,catch_sig);
+ sig_catch(SIGWINCH,catch_sig);
+- sleep(9999);
+- return 0;
++
++ for (;;) {
++ r = read(selfpipe[0],&buf,1);
++ if (!r) break;
++ if (r == -1) {
++ if (errno == error_intr) continue;
++ break;
++ }
++
++ new_sig = (int)buf;
++
++ nc = new_sig == SIGCONT;
++ nt = new_sig == SIGTERM;
++ oc = old_sig == SIGCONT;
++ ot = old_sig == SIGTERM;
++
++ if (!nc && !nt && !oc && !ot) {show_one(new_sig); break; }
++ if (!nc && !nt && !oc && ot) {show_two(SIGTERM, new_sig); break; }
++ if (!nc && !nt && oc && !ot) {show_two(SIGCONT, new_sig); break; }
++ if (!nc && !nt && oc && ot) {show_err(); break; }
++ if (!nc && nt && !oc && !ot) {old_sig = SIGTERM; continue;}
++ if (!nc && nt && !oc && ot) {show_one(SIGTERM); continue;}
++ if (!nc && nt && oc && !ot) {show_two(SIGCONT, SIGTERM); break; }
++ if (!nc && nt && oc && ot) {show_err(); break; }
++ if ( nc && !nt && !oc && !ot) {old_sig = SIGCONT; continue;}
++ if ( nc && !nt && !oc && ot) {show_two(SIGCONT, SIGTERM); break; }
++ if ( nc && !nt && oc && !ot) {show_one(SIGCONT); continue;}
++ if ( nc && !nt && oc && ot) {show_err(); break; }
++ if ( nc && nt && !oc && !ot) {show_err(); break; }
++ if ( nc && nt && !oc && ot) {show_err(); break; }
++ if ( nc && nt && oc && !ot) {show_err(); break; }
++ if ( nc && nt && oc && ot) {show_err(); break; }
++ }
++ _exit(0);
+ }
Home |
Main Index |
Thread Index |
Old Index