pkgsrc-Changes archive

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

CVS commit: pkgsrc/net/py-ephemeral_port_reserve



Module Name:    pkgsrc
Committed By:   wiz
Date:           Fri Apr 29 13:05:35 UTC 2022

Added Files:
        pkgsrc/net/py-ephemeral_port_reserve: ALTERNATIVES DESCR Makefile PLIST
            distinfo

Log Message:
net/py-ephemeral_port_reserve: import py-ephemeral_port_reserve-1.1.4

Sometimes you need a networked program to bind to a port that can't
be hard-coded. Generally this is when you want to run several of
them in parallel; if they all bind to port 8080, only one of them
can succeed.

The usual solution is the "port 0 trick". If you bind to port 0,
your kernel will find some arbitrary high-numbered port that's
unused and bind to that. Afterward you can query the actual port
that was bound to if you need to use the port number elsewhere.
However, there are cases where the port 0 trick won't work. For
example, mysqld takes port 0 to mean "the port configured in my.cnf".
Docker can bind your containers to port 0, but uses its own
implementation to find a free port which races and fails in the
face of parallelism.

ephemeral-port-reserve provides an implementation of the port 0
trick which is reliable and race-free.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/net/py-ephemeral_port_reserve/ALTERNATIVES \
    pkgsrc/net/py-ephemeral_port_reserve/DESCR \
    pkgsrc/net/py-ephemeral_port_reserve/Makefile \
    pkgsrc/net/py-ephemeral_port_reserve/PLIST \
    pkgsrc/net/py-ephemeral_port_reserve/distinfo

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/net/py-ephemeral_port_reserve/ALTERNATIVES
diff -u /dev/null pkgsrc/net/py-ephemeral_port_reserve/ALTERNATIVES:1.1
--- /dev/null   Fri Apr 29 13:05:35 2022
+++ pkgsrc/net/py-ephemeral_port_reserve/ALTERNATIVES   Fri Apr 29 13:05:35 2022
@@ -0,0 +1 @@
+bin/ephemeral-port-reserve @PREFIX@/bin/ephemeral-port-reserve-@PYVERSSUFFIX@
Index: pkgsrc/net/py-ephemeral_port_reserve/DESCR
diff -u /dev/null pkgsrc/net/py-ephemeral_port_reserve/DESCR:1.1
--- /dev/null   Fri Apr 29 13:05:35 2022
+++ pkgsrc/net/py-ephemeral_port_reserve/DESCR  Fri Apr 29 13:05:35 2022
@@ -0,0 +1,17 @@
+Sometimes you need a networked program to bind to a port that can't
+be hard-coded. Generally this is when you want to run several of
+them in parallel; if they all bind to port 8080, only one of them
+can succeed.
+
+The usual solution is the "port 0 trick". If you bind to port 0,
+your kernel will find some arbitrary high-numbered port that's
+unused and bind to that. Afterward you can query the actual port
+that was bound to if you need to use the port number elsewhere.
+However, there are cases where the port 0 trick won't work. For
+example, mysqld takes port 0 to mean "the port configured in my.cnf".
+Docker can bind your containers to port 0, but uses its own
+implementation to find a free port which races and fails in the
+face of parallelism.
+
+ephemeral-port-reserve provides an implementation of the port 0
+trick which is reliable and race-free.
Index: pkgsrc/net/py-ephemeral_port_reserve/Makefile
diff -u /dev/null pkgsrc/net/py-ephemeral_port_reserve/Makefile:1.1
--- /dev/null   Fri Apr 29 13:05:35 2022
+++ pkgsrc/net/py-ephemeral_port_reserve/Makefile       Fri Apr 29 13:05:35 2022
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2022/04/29 13:05:35 wiz Exp $
+
+DISTNAME=      ephemeral_port_reserve-1.1.4
+PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
+CATEGORIES=    net python
+MASTER_SITES=  ${MASTER_SITE_PYPI:=e/ephemeral_port_reserve/}
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/Yelp/ephemeral-port-reserve/
+COMMENT=       Bind to ephemeral port, force it into TIME_WAIT state, and unbind it
+LICENSE=       mit
+
+post-install:
+       ${MV} ${DESTDIR}${PREFIX}/bin/ephemeral-port-reserve ${DESTDIR}${PREFIX}/bin/ephemeral-port-reserve-${PYVERSSUFFIX} || ${TRUE}
+
+.include "../../lang/python/egg.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/net/py-ephemeral_port_reserve/PLIST
diff -u /dev/null pkgsrc/net/py-ephemeral_port_reserve/PLIST:1.1
--- /dev/null   Fri Apr 29 13:05:35 2022
+++ pkgsrc/net/py-ephemeral_port_reserve/PLIST  Fri Apr 29 13:05:35 2022
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST,v 1.1 2022/04/29 13:05:35 wiz Exp $
+bin/ephemeral-port-reserve-${PYVERSSUFFIX}
+${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
+${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
+${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
+${PYSITELIB}/${EGG_INFODIR}/entry_points.txt
+${PYSITELIB}/${EGG_INFODIR}/top_level.txt
+${PYSITELIB}/ephemeral_port_reserve.py
+${PYSITELIB}/ephemeral_port_reserve.pyc
+${PYSITELIB}/ephemeral_port_reserve.pyo
Index: pkgsrc/net/py-ephemeral_port_reserve/distinfo
diff -u /dev/null pkgsrc/net/py-ephemeral_port_reserve/distinfo:1.1
--- /dev/null   Fri Apr 29 13:05:35 2022
+++ pkgsrc/net/py-ephemeral_port_reserve/distinfo       Fri Apr 29 13:05:35 2022
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.1 2022/04/29 13:05:35 wiz Exp $
+
+BLAKE2s (ephemeral_port_reserve-1.1.4.tar.gz) = 8f6af493ce79d9655a2a1eac52b026c977f868708f34110a88e83e3693cb070f
+SHA512 (ephemeral_port_reserve-1.1.4.tar.gz) = 7a406d092ddaeca28e55a6e0a367f10f21b635e3c32571b304453b86df0a852fb91a9b12619f300833ee58d6ef5aafcd7338801eeb7d330ad43c4f2caa14d50f
+Size (ephemeral_port_reserve-1.1.4.tar.gz) = 3541 bytes



Home | Main Index | Thread Index | Old Index