git: c046a1681579 - main - misc/retry: Add new port

From: Joel Bodenmann <jbo_at_FreeBSD.org>
Date: Fri, 15 Sep 2023 13:52:37 UTC
The branch main has been updated by jbo:

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

commit c046a1681579b4ff0dd479c2313bd73c0238967c
Author:     Jon Stuart <freebsd@zikomo.xyz>
AuthorDate: 2023-09-14 15:58:26 +0000
Commit:     Joel Bodenmann <jbo@FreeBSD.org>
CommitDate: 2023-09-15 13:51:25 +0000

    misc/retry: Add new port
    
    A utility to retry a command until the command succeeds.
    
    PR:                     273730
    Approved by:            zirias (mentor)
    Reviewed by:            diizzy
    Differential Revision:  https://reviews.freebsd.org/D41862
---
 misc/Makefile        |  1 +
 misc/retry/Makefile  | 20 ++++++++++++++++++++
 misc/retry/distinfo  |  3 +++
 misc/retry/pkg-descr |  8 ++++++++
 4 files changed, 32 insertions(+)

diff --git a/misc/Makefile b/misc/Makefile
index 31a5c25df116..1304a56a71fe 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -507,6 +507,7 @@
     SUBDIR += raspberrypi-userland
     SUBDIR += raspbsd-led
     SUBDIR += ree
+    SUBDIR += retry
     SUBDIR += rfc
     SUBDIR += ringtonetools
     SUBDIR += rname
diff --git a/misc/retry/Makefile b/misc/retry/Makefile
new file mode 100644
index 000000000000..a7ac1f6c3d41
--- /dev/null
+++ b/misc/retry/Makefile
@@ -0,0 +1,20 @@
+PORTNAME=	retry
+DISTVERSION=	1.0.5
+CATEGORIES=	misc
+MASTER_SITES=	https://github.com/minfrin/${PORTNAME}/releases/download/${PORTNAME}-${DISTVERSION}/
+
+MAINTAINER=	jon@zikomo.xyz
+COMMENT=	Retry a command until the command succeeds
+WWW=		https://github.com/minfrin/retry
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+USES=		tar:bzip2
+
+GNU_CONFIGURE=	yes
+
+PLIST_FILES=	bin/retry \
+		man/man1/retry.1.gz
+
+.include <bsd.port.mk>
diff --git a/misc/retry/distinfo b/misc/retry/distinfo
new file mode 100644
index 000000000000..2add2c026ef8
--- /dev/null
+++ b/misc/retry/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1694647018
+SHA256 (retry-1.0.5.tar.bz2) = 68e241d10f0e2d784a165634bb2eb12b7baf0a9fd9d27c4d54315382597d892e
+SIZE (retry-1.0.5.tar.bz2) = 260264
diff --git a/misc/retry/pkg-descr b/misc/retry/pkg-descr
new file mode 100644
index 000000000000..9ca00f4a1774
--- /dev/null
+++ b/misc/retry/pkg-descr
@@ -0,0 +1,8 @@
+Retry captures stdin into memory as the data is passed to the repeated command,
+and this captured stdin is then replayed should the command be repeated. This
+makes it possible to embed the retry tool into shell pipelines.
+
+Retry captures stdout into memory, and if the command was successful stdout is
+passed on to stdout as normal, while if the command was repeated stdout is
+passed to stderr instead. This ensures that output is passed to stdout once and
+once only.