git: 99b3ddf04f4d - main - security/py-yubikey-manager: patch missing FreeBSD backend support

Vinícius Zavam egypcio at FreeBSD.org
Mon Apr 19 19:58:50 UTC 2021


The branch main has been updated by egypcio:

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

commit 99b3ddf04f4dd18812d2ca69216b2fd7b214bd70
Author:     Vinícius Zavam <egypcio at FreeBSD.org>
AuthorDate: 2021-04-19 19:57:38 +0000
Commit:     Vinícius Zavam <egypcio at FreeBSD.org>
CommitDate: 2021-04-19 19:57:38 +0000

    security/py-yubikey-manager: patch missing FreeBSD backend support
    
    PR:             254580
    Reported by:    nwhitehorn
---
 security/py-yubikey-manager/Makefile                |  1 +
 .../files/patch-ykman_hid_____init____.py           | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/security/py-yubikey-manager/Makefile b/security/py-yubikey-manager/Makefile
index b60103123654..89e0911599e4 100644
--- a/security/py-yubikey-manager/Makefile
+++ b/security/py-yubikey-manager/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	yubikey-manager
 PORTVERSION=	4.0.2
+PORTREVISION=	1
 CATEGORIES=	security python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
diff --git a/security/py-yubikey-manager/files/patch-ykman_hid_____init____.py b/security/py-yubikey-manager/files/patch-ykman_hid_____init____.py
new file mode 100644
index 000000000000..235da25bf84d
--- /dev/null
+++ b/security/py-yubikey-manager/files/patch-ykman_hid_____init____.py
@@ -0,0 +1,21 @@
+--- ykman/hid/__init__.py.orig	2021-04-12 07:23:08 UTC
++++ ykman/hid/__init__.py
+@@ -42,12 +42,15 @@ elif sys.platform.startswith("win32"):
+     from . import windows as backend
+ elif sys.platform.startswith("darwin"):
+     from . import macos as backend
++elif sys.platform.startswith("freebsd"):
++    backend = None
+ else:
+     raise Exception("Unsupported platform")
+ 
+-
+-list_otp_devices: Callable[[], List[OtpYubiKeyDevice]] = backend.list_devices
+-
++if backend is not None:
++    list_otp_devices: Callable[[], List[OtpYubiKeyDevice]] = backend.list_devices
++else:
++    list_otp_devices: Callable[[], List[OtpYubiKeyDevice]] = lambda: []
+ 
+ class CtapYubiKeyDevice(YkmanDevice):
+     """YubiKey FIDO USB HID device"""


More information about the dev-commits-ports-all mailing list