pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/socat socat: improve our ability to run the tests, ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/aa7396444fe0
branches:  trunk
changeset: 371425:aa7396444fe0
user:      maya <maya%pkgsrc.org@localhost>
date:      Sat Nov 11 19:43:06 2017 +0000

description:
socat: improve our ability to run the tests, less use of /bin/bash

bump PKGREVISION in case any of those scripts are used at runtime

diffstat:

 net/socat/Makefile              |   9 ++++++-
 net/socat/distinfo              |   3 +-
 net/socat/patches/patch-test.sh |  51 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+), 2 deletions(-)

diffs (93 lines):

diff -r 0bcc63a52d7e -r aa7396444fe0 net/socat/Makefile
--- a/net/socat/Makefile        Sat Nov 11 17:29:17 2017 +0000
+++ b/net/socat/Makefile        Sat Nov 11 19:43:06 2017 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.38 2017/02/05 20:40:32 leot Exp $
+# $NetBSD: Makefile,v 1.39 2017/11/11 19:43:06 maya Exp $
 
 DISTNAME=      socat-1.7.3.2
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  http://www.dest-unreach.org/socat/download/
 
@@ -11,6 +12,12 @@
 
 GNU_CONFIGURE=         YES
 
+USE_TOOLS+=    bash # test tool
+REPLACE_BASH+= *.sh
+
+do-test:
+       cd ${WRKSRC} && ${MAKE} test
+
 .include "../../mk/bsd.prefs.mk"
 
 CONFIGURE_ARGS+=       --disable-libwrap
diff -r 0bcc63a52d7e -r aa7396444fe0 net/socat/distinfo
--- a/net/socat/distinfo        Sat Nov 11 17:29:17 2017 +0000
+++ b/net/socat/distinfo        Sat Nov 11 19:43:06 2017 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.24 2017/02/05 20:40:32 leot Exp $
+$NetBSD: distinfo,v 1.25 2017/11/11 19:43:06 maya Exp $
 
 SHA1 (socat-1.7.3.2.tar.gz) = 28eca1f8efeadde3f96c1ac89e553c28d736d41d
 RMD160 (socat-1.7.3.2.tar.gz) = b20967255460adb348aa90f42aaa6bea062f4b7c
 SHA512 (socat-1.7.3.2.tar.gz) = 540658b2a3d1b87673196282e5c62b97681bd0f1d1e4759ff9d72909d11060235ee9e9521a973603c1b00376436a9444248e5fbc0ffac65f8edb9c9bc28e7972
 Size (socat-1.7.3.2.tar.gz) = 611707 bytes
 SHA1 (patch-mytypes.h) = 94df5a47f7fbadf867e0994edeeb857b467021df
+SHA1 (patch-test.sh) = f8e123d3e1a71d6ec34dc2dc42c6de0875a47754
diff -r 0bcc63a52d7e -r aa7396444fe0 net/socat/patches/patch-test.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/socat/patches/patch-test.sh   Sat Nov 11 19:43:06 2017 +0000
@@ -0,0 +1,51 @@
+$NetBSD: patch-test.sh,v 1.1 2017/11/11 19:43:06 maya Exp $
+
+Avoid hard coding /bin/bash so much
+
+--- test.sh.orig       2017-11-11 19:17:54.549032453 +0000
++++ test.sh
+@@ -698,7 +698,7 @@ for addr in proxy; do
+     done
+     echo $OPTS
+     # prepare dummy server
+-    $SOCAT tcp-l:$PORT,reuseaddr,crlf exec:"/bin/bash proxyecho.sh" || echo "cannot start proxyecho.sh" >&2 &
++    $SOCAT tcp-l:$PORT,reuseaddr,crlf exec:"bash proxyecho.sh" || echo "cannot start proxyecho.sh" >&2 &
+       pid=$!
+       sleep 1
+     for o in $(filloptionvalues $OPTS|tr ',' ' '); do
+@@ -4548,7 +4548,7 @@ te="$td/test$N.stderr"
+ tdiff="$td/test$N.diff"
+ da="test$N $(date) $RANDOM"; da="$da$($ECHO '\r')"
+ #CMD2="$TRACE $SOCAT tcp4-l:$PORT,crlf SYSTEM:\"read; read; $ECHO \\\"HTTP/1.0 200 OK\n\\\"; cat\""
+-CMD2="$TRACE $SOCAT $opts tcp4-l:$PORT,reuseaddr,crlf exec:\"/bin/bash proxyecho.sh\""
++CMD2="$TRACE $SOCAT $opts tcp4-l:$PORT,reuseaddr,crlf exec:\"bash proxyecho.sh\""
+ CMD="$TRACE $SOCAT $opts - proxy:$LOCALHOST:127.0.0.1:1000,pf=ip4,proxyport=$PORT"
+ printf "test $F_n $TEST... " $N
+ eval "$CMD2 2>\"${te}2\" &"
+@@ -4594,7 +4594,7 @@ te="$td/test$N.stderr"
+ tdiff="$td/test$N.diff"
+ da="test$N $(date) $RANDOM"; da="$da$($ECHO '\r')"
+ #CMD2="$TRACE $SOCAT $opts tcp6-l:$PORT,crlf SYSTEM:\"read; read; $ECHO \\\"HTTP/1.0 200 OK\n\\\"; cat\""
+-CMD2="$TRACE $SOCAT $opts tcp6-l:$PORT,reuseaddr,crlf exec:\"/bin/bash proxyecho.sh\""
++CMD2="$TRACE $SOCAT $opts tcp6-l:$PORT,reuseaddr,crlf exec:\"bash proxyecho.sh\""
+ CMD="$TRACE $SOCAT $opts - proxy:$LOCALHOST6:127.0.0.1:1000,proxyport=$PORT"
+ printf "test $F_n $TEST... " $N
+ eval "$CMD2 2>\"${te}2\" &"
+@@ -4828,7 +4828,7 @@ te="$td/test$N.stderr"
+ tdiff="$td/test$N.diff"
+ da="test$N $(date) $RANDOM"; da="$da$($ECHO '\r')"
+ #CMD2="$TRACE $SOCAT $opts tcp-l:$PORT,crlf SYSTEM:\"read; read; $ECHO \\\"HTTP/1.0 200 OK\n\\\"; cat\""
+-CMD2="$TRACE $SOCAT $opts tcp4-l:$PORT,reuseaddr,crlf exec:\"/bin/bash proxyecho.sh -w 2\""
++CMD2="$TRACE $SOCAT $opts tcp4-l:$PORT,reuseaddr,crlf exec:\"bash proxyecho.sh -w 2\""
+ CMD="$TRACE $SOCAT $opts - proxy:$LOCALHOST:127.0.0.1:1000,pf=ip4,proxyport=$PORT"
+ printf "test $F_n $TEST... " $N
+ eval "$CMD2 2>\"${te}1\" &"
+@@ -6335,7 +6335,7 @@ $PRINTF "test $F_n $TEST... " $N
+ #$TRACE $SOCAT $opts echo SYSTEM:'exec /bin/bash -c "echo \$PPID '">$tpp"'; echo \$$ '">$tp; read x\"",nofork 2>"$te"; stat=$?
+ tsh="$td/test$N.sh"
+ cat <<EOF >"$tsh"
+-#! /bin/bash
++#! /usr/bin/env bash
+ echo \$PPID >"$tpp"
+ echo \$\$ >"$tp"
+ read x



Home | Main Index | Thread Index | Old Index