commit - a8449d36a8f239b9621ea58fbcf8f762472e831e
commit + 744f987f501d8fcc2ea23e66676ed807c87e84f1
blob - /dev/null
blob + 8c358ee37937d9ab3c5e0bc18644990c4bfd7460 (mode 644)
--- /dev/null
+++ tools/pkg_required.patch
+diff --git a/regress/sys/fileops/Makefile b/regress/sys/fileops/Makefile
+index 42f5dcf9088..16c3344799d 100644
+--- a/regress/sys/fileops/Makefile
++++ b/regress/sys/fileops/Makefile
+@@ -1,5 +1,7 @@
+ # $OpenBSD: Makefile,v 1.2 2017/05/30 08:44:58 sf Exp $
+
++PKG_REQUIRED += p5-File-Slurp
++
+ SUBDIR= ffs ext2 msdos16 msdos32
+ PROG= fileops
+ NOMAN= yes
+diff --git a/regress/sys/net/Makefile b/regress/sys/net/Makefile
+index d56a7cc9189..653060732ec 100644
+--- a/regress/sys/net/Makefile
++++ b/regress/sys/net/Makefile
+@@ -1,5 +1,7 @@
+ # $OpenBSD: Makefile,v 1.13 2017/11/17 10:29:16 bluhm Exp $
+
++PKG_REQUIRED += scapy py-libdnet
++
+ SUBDIR += etherip loop
+ SUBDIR += pf_divert pf_forward pf_fragment pf_print pf_state pf_table
+ SUBDIR += rdomains rtable vxlan
+diff --git a/regress/sys/net/pf_divert/Makefile b/regress/sys/net/pf_divert/Makefile
+index 2c5f538ed8d..aaad41af726 100644
+--- a/regress/sys/net/pf_divert/Makefile
++++ b/regress/sys/net/pf_divert/Makefile
+@@ -3,20 +3,8 @@
+ # The following ports must be installed for the regression tests:
+ # p5-IO-Socket-INET6 object interface for AF_INET and AF_INET6 domain sockets
+ # p5-Socket6 Perl defines relating to AF_INET6 sockets
+-#
+-# Check wether all required perl packages are installed. If some
+-# are missing print a warning and skip the tests, but do not fail.
+-
+-PERL_REQUIRE != perl -Mstrict -Mwarnings -e ' \
+- eval { require IO::Socket::INET6 } or print $@; \
+- eval { require Socket6 } or print $@; \
+-'
+-.if ! empty(PERL_REQUIRE)
+-regress:
+- @echo "${PERL_REQUIRE}"
+- @echo install these perl packages for additional tests
+- @echo SKIPPED
+-.endif
++
++PKG_REQUIRED += p5-IO-Socket-INET6 p5-Socket6
+
+ # Fill out these variables as you have to test divert with the pf
+ # kernel running on a remote machine. You have to specify a local
+diff --git a/regress/sys/net/pflow/Makefile b/regress/sys/net/pflow/Makefile
+index 122fe9b13e9..d6acd95d7ea 100644
+--- a/regress/sys/net/pflow/Makefile
++++ b/regress/sys/net/pflow/Makefile
+@@ -27,6 +27,7 @@
+ # Destroy it in the end.
+
+ REGRESS_TARGETS=template_v10 flow_10_4 flow_10_6 ifconfig
++PKG_REQUIRED += p5-Net-Flow
+
+ PROG= gen_traffic
+ LDADD= -levent
+diff --git a/regress/sys/netinet/Makefile b/regress/sys/netinet/Makefile
+index 9ca134c9619..116e27c0392 100644
+--- a/regress/sys/netinet/Makefile
++++ b/regress/sys/netinet/Makefile
+@@ -1,5 +1,7 @@
+ # $OpenBSD: Makefile,v 1.5 2017/09/07 19:00:26 bluhm Exp $
+
++PKG_REQUIRED += scapy py-libdnet
++
+ SUBDIR = arp autoport frag ipsec pmtu
+
+ .include <bsd.subdir.mk>
+diff --git a/regress/sys/netinet6/Makefile b/regress/sys/netinet6/Makefile
+index 61d1a1e5154..169eede30fd 100644
+--- a/regress/sys/netinet6/Makefile
++++ b/regress/sys/netinet6/Makefile
+@@ -1,5 +1,7 @@
+ # $OpenBSD: Makefile,v 1.2 2015/10/26 08:06:51 vgross Exp $
+
++PKG_REQUIRED += scapy py-libdnet
++
+ SUBDIR = autoport frag6 nd6 rh0
+
+ .include <bsd.subdir.mk>
+diff --git a/regress/usr.sbin/ldapd/Makefile b/regress/usr.sbin/ldapd/Makefile
+index 55cf66f618b..4a783fc3734 100644
+--- a/regress/usr.sbin/ldapd/Makefile
++++ b/regress/usr.sbin/ldapd/Makefile
+@@ -6,27 +6,7 @@ DIT2=dc=bar,dc=quux
+ NLV=0.65
+ CLEANFILES=ldapd.pid log ldapd1.conf ${DIT}_indx.db ${DIT}_data.db ${DIT2}_indx.db ${DIT2}_data.db
+
+-# Needs p5-ldap and openldap (client)
+-
+-PERL_REQUIRE != perl -Mstrict -Mwarnings -e ' \
+- eval { require Net::LDAP } or print $@; \
+-'
+-.if ! empty (PERL_REQUIRE)
+-regress:
+- @echo "${PERL_REQUIRE}"
+- @echo install package p5-ldap
+- @echo SKIPPED
+-.endif
+-
+-.if ! (make(clean) || make(cleandir) || make(obj))
+-LDAP_DEP != ldapsearch -VV 2>/dev/null ; echo $?
+-.endif
+-.if ("${LDAP_DEP}" != 0)
+-regress:
+- @echo openldap-client must be installed
+- @echo SKIPPED
+-.endif
+-
++PKG_REQUIRED += p5-ldap openldap-client
+ REGRESS_TARGETS = connect import perl purge #cpan
+
+ bootstrap:
+diff --git a/regress/usr.sbin/ospfd/Makefile b/regress/usr.sbin/ospfd/Makefile
+index b829bbdc296..65cc7300307 100644
+--- a/regress/usr.sbin/ospfd/Makefile
++++ b/regress/usr.sbin/ospfd/Makefile
+@@ -4,21 +4,8 @@
+ # p5-AnyEvent provide framework for multiple event loops
+ # p5-Hash-Merge merge associative arrays
+ # p5-YAML YAML ain't a markup language
+-#
+-# Check wether all required perl packages are installed. If some
+-# are missing print a warning and skip the tests, but do not fail.
+-
+-PERL_REQUIRE != perl -Mstrict -Mwarnings -e ' \
+- eval { require AnyEvent } or print $@; \
+- eval { require Hash::Merge } or print $@; \
+- eval { require YAML } or print $@; \
+-'
+-.if ! empty (PERL_REQUIRE)
+-regress:
+- @echo "${PERL_REQUIRE}"
+- @echo install these perl packages for additional tests
+- @echo SKIPPED
+-.endif
++
++PKG_REQUIRED += p5-AnyEvent p5-Hash-Merge p5-YAML
+
+ # Fill out these variables with your own system parameters
+ # You need a tap device and an unused /24 IPv4 network.
+diff --git a/regress/usr.sbin/relayd/Makefile b/regress/usr.sbin/relayd/Makefile
+index 7f9106d9f92..e4ce3342755 100644
+--- a/regress/usr.sbin/relayd/Makefile
++++ b/regress/usr.sbin/relayd/Makefile
+@@ -8,17 +8,7 @@
+ # Check wether all required perl packages are installed. If some
+ # are missing print a warning and skip the tests, but do not fail.
+
+-PERL_REQUIRE != perl -Mstrict -Mwarnings -e ' \
+- eval { require IO::Socket::INET6 } or print $@; \
+- eval { require Socket6 } or print $@; \
+- eval { require IO::Socket::SSL } or print $@; \
+-'
+-.if ! empty (PERL_REQUIRE)
+-regress:
+- @echo "${PERL_REQUIRE}"
+- @echo install these perl packages for additional tests
+- @echo SKIPPED
+-.endif
++PKG_REQUIRED += p5-IO-Socker-INET6 p5-Socket6 p5-IO-Socket-SSL
+
+ .if make (regress) || make (all)
+ .BEGIN:
+diff --git a/regress/usr.sbin/snmpd/Makefile b/regress/usr.sbin/snmpd/Makefile
+index f2c6622c074..301c17ffe51 100644
+--- a/regress/usr.sbin/snmpd/Makefile
++++ b/regress/usr.sbin/snmpd/Makefile
+@@ -1,6 +1,7 @@
+ # $OpenBSD: Makefile,v 1.1 2017/08/11 17:45:02 rob Exp $
+ # Regress tests for snmpd
+
++PKG_REQUIRED += net-snmp
+ REGRESS_TARGETS = run-regress-snmpd
+
+ # Needs netsnmp
+diff --git a/regress/usr.sbin/switchd/Makefile b/regress/usr.sbin/switchd/Makefile
+index 76c47af0fdd..ce58ca65c71 100644
+--- a/regress/usr.sbin/switchd/Makefile
++++ b/regress/usr.sbin/switchd/Makefile
+@@ -4,21 +4,8 @@
+ # p5-Net-Pcap Perl interface for libpcap
+ # p5-NetPacket Perl interface for packet encoding/decoding
+ # p5-Crypt-Random To fill payloads with weak random data
+-#
+-# Check wether all required perl packages are installed. If some
+-# are missing print a warning and skip the tests, but do not fail.
+-
+-PERL_REQUIRE != perl -Mstrict -Mwarnings -e ' \
+- eval { require NetPacket::Ethernet } or print $@; \
+- eval { require Net::Pcap } or print $@; \
+- eval { require Crypt::Random } or print $@; \
+-'
+-.if ! empty (PERL_REQUIRE)
+-regress:
+- @echo "${PERL_REQUIRE}"
+- @echo install these perl packages for additional tests
+- @echo SKIPPED
+-.endif
++
++PKG_REQUIRED += p5-Net-Pcap p5-NetPacket p5-Crypt-Random
+
+ # Automatically generate regress targets from test cases in directory.
+
+diff --git a/regress/usr.sbin/syslogd/Makefile b/regress/usr.sbin/syslogd/Makefile
+index 7b33571f60d..c12a57b88a2 100644
+--- a/regress/usr.sbin/syslogd/Makefile
++++ b/regress/usr.sbin/syslogd/Makefile
+@@ -8,22 +8,12 @@
+ #
+ # This package enables additional interoperability tests
+ # rsyslog syslog daemon supporting databases, TCP, SSL, RELP
+-#
+-# Check wether all required perl packages are installed. If some
+-# are missing print a warning and skip the tests, but do not fail.
+-
+-PERL_REQUIRE != perl -Mstrict -Mwarnings -e ' \
+- eval { require IO::Socket::INET6 } or print $@; \
+- eval { require Socket6 } or print $@; \
+- eval { require IO::Socket::SSL } or print $@; \
+- eval { require BSD::Resource } or print $@; \
+-'
+-.if ! empty (PERL_REQUIRE)
+-regress:
+- @echo "${PERL_REQUIRE}"
+- @echo install these perl packages for additional tests
+- @echo SKIPPED
+-.endif
++
++PKG_REQUIRED += p5-IO-Socket-INET6 p5-Socket6 p5-IO-Socket-SSL p5-BSD-Resource
++.for _p in ${PKG_REQUIRED}
++ @echo ${_p}
++ @pkg_add ${_p}
++.endfor
+
+ # Automatically generate regress targets from test cases in directory.
+
+diff --git a/share/mk/bsd.regress.mk b/share/mk/bsd.regress.mk
+index 0b8aa4c30dc..3eba3d28054 100644
+--- a/share/mk/bsd.regress.mk
++++ b/share/mk/bsd.regress.mk
+@@ -33,6 +33,13 @@ ${_REGRESS_NEW}:=${${_REGRESS_OLD}}
+ . endif
+ .endfor
+
++.if defined(PKG_REQUIRED)
++. for _p in ${PKG_REQUIRED}
++ @echo ${_p}
++ @pkg_add 1>&2 ${_p}
++. endfor
++.endif
++
+ # XXX - Need full path to REGRESS_LOG, otherwise there will be much pain.
+ REGRESS_LOG?=/dev/null
+ REGRESS_SKIP_TARGETS?=
+@@ -65,7 +72,7 @@ _SKIP_FAIL=
+ _SKIP_FAIL=-
+ .endif
+
+-.if defined(REGRESS_ROOT_TARGETS)
++.if defined(REGRESS_ROOT_TARGETS) or defined(PKG_REQUIRED)
+ _ROOTUSER!=id -g
+ SUDO?=
+ . if (${_ROOTUSER} != 0) && empty(SUDO)