git: 55c01f69543c - main - net-mgmt/smokeping: fix bug in FPingContinuous.pm

From: Eugene Grosbein <eugen_at_FreeBSD.org>
Date: Fri, 04 Nov 2022 15:30:21 UTC
The branch main has been updated by eugen:

URL: https://cgit.FreeBSD.org/ports/commit/?id=55c01f69543c6336bb583857019f5278d4bf90ef

commit 55c01f69543c6336bb583857019f5278d4bf90ef
Author:     Eugene Grosbein <eugen@FreeBSD.org>
AuthorDate: 2022-11-04 15:27:04 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2022-11-04 15:27:04 +0000

    net-mgmt/smokeping: fix bug in FPingContinuous.pm
    
    Add patch accepted upstream with bug #341.
    https://github.com/oetiker/SmokePing/issues/341
    
    PR:             267015
    Approved by:    rodrigo (maintainer timeout, 3 weeks)
---
 net-mgmt/smokeping/Makefile                                 |  2 +-
 .../files/patch-lib_Smokeping_probes_FPingContinuous.pm     | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/net-mgmt/smokeping/Makefile b/net-mgmt/smokeping/Makefile
index 619e42e43091..a67fa425f303 100644
--- a/net-mgmt/smokeping/Makefile
+++ b/net-mgmt/smokeping/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	smokeping
 PORTVERSION=	2.8.2
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	net-mgmt www
 
 MAINTAINER=	rodrigo@FreeBSD.org
diff --git a/net-mgmt/smokeping/files/patch-lib_Smokeping_probes_FPingContinuous.pm b/net-mgmt/smokeping/files/patch-lib_Smokeping_probes_FPingContinuous.pm
new file mode 100644
index 000000000000..04aa39c2fab9
--- /dev/null
+++ b/net-mgmt/smokeping/files/patch-lib_Smokeping_probes_FPingContinuous.pm
@@ -0,0 +1,13 @@
+--- lib/Smokeping/probes/FPingContinuous.pm.orig	2021-08-13 06:20:13 UTC
++++ lib/Smokeping/probes/FPingContinuous.pm
+@@ -72,8 +72,8 @@ sub new($$$)
+     	my $binary = join(" ", $self->binary);
+ 	my $testhost = $self->testhost;
+ 	my $return = `$binary -C 1 $testhost 2>&1`;
+-	$self->{enable}{S} = (`$binary -h 2>&1` =~ /\s-S\s/);
+-	$self->{enable}{O} = (`$binary -h 2>&1` =~ /\s-O\s/);
++	$self->{enable}{S} = (`$binary -h 2>&1` =~ /\s-S[,\s]/);
++	$self->{enable}{O} = (`$binary -h 2>&1` =~ /\s-O[,\s]/);
+ 	croak "ERROR: fping ('$binary -C 1 $testhost') could not be run: $return"
+ 	    if $return =~ m/not found/;
+ 	croak "ERROR: FPing must be installed setuid root or it will not work\n"