[arch-commits] Commit in python-dnspython/repos/community-any (3 files)

Evangelos Foutras foutrelis at archlinux.org
Thu Dec 3 16:25:58 UTC 2020


    Date: Thursday, December 3, 2020 @ 16:25:58
  Author: foutrelis
Revision: 769703

archrelease: copy trunk to community-any

Added:
  python-dnspython/repos/community-any/PKGBUILD
    (from rev 769702, python-dnspython/trunk/PKGBUILD)
  python-dnspython/repos/community-any/py39.patch
    (from rev 769702, python-dnspython/trunk/py39.patch)
Deleted:
  python-dnspython/repos/community-any/PKGBUILD

------------+
 PKGBUILD   |   94 ++++++++++++++++++++++++++++++++---------------------------
 py39.patch |   79 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 130 insertions(+), 43 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2020-12-03 16:25:53 UTC (rev 769702)
+++ PKGBUILD	2020-12-03 16:25:58 UTC (rev 769703)
@@ -1,43 +0,0 @@
-# Maintainer: Sergej Pupykin <pupykin.s+arch at gmail.com>
-# Contributor: Mathijs Kadijk <maccain13 at gmail.com>
-
-_name=dnspython
-pkgname=python-dnspython
-# IMPORTANT: stay on 1.16 for https://github.com/eventlet/eventlet/issues/619
-pkgver=1.16.0
-pkgrel=2
-epoch=1
-pkgdesc="A DNS toolkit for Python"
-arch=('any')
-url="http://www.dnspython.org"
-license=('ISC')
-depends=('python')
-makedepends=('python-setuptools')
-checkdepends=('python-idna' 'python-pycryptodome' 'python-ecdsa') # 'python-trio')
-optdepends=('python-ecdsa: DNSSEC support'
-            'python-pycryptodome: DNSSEC support'
-            'python-idna: support for updated IDNA 2008')
-#            'python-trio: async support'
-#            'python-sniffio: async support')
-source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.zip")
-sha256sums=('36c5e8e38d4369a08b6780b7f27d790a292b2b08eea01607865bf0936c558e01')
-validpgpkeys=('A580DEE052FEC78D8ACF383DF24B3AFC8CA2F5C7') # Bob Halley <halley at dnspython.org>
-
-build() {
-    cd dnspython-${pkgver}
-
-    python setup.py build
-}
-
-check() {
-    cd dnspython-${pkgver}
-
-    python setup.py test
-}
-
-package() {
-    cd dnspython-${pkgver}
-
-    python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
-    install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
-}

Copied: python-dnspython/repos/community-any/PKGBUILD (from rev 769702, python-dnspython/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2020-12-03 16:25:58 UTC (rev 769703)
@@ -0,0 +1,51 @@
+# Maintainer: Sergej Pupykin <pupykin.s+arch at gmail.com>
+# Contributor: Mathijs Kadijk <maccain13 at gmail.com>
+
+_name=dnspython
+pkgname=python-dnspython
+# IMPORTANT: stay on 1.16 for https://github.com/eventlet/eventlet/issues/619
+pkgver=1.16.0
+pkgrel=3
+epoch=1
+pkgdesc="A DNS toolkit for Python"
+arch=('any')
+url="http://www.dnspython.org"
+license=('ISC')
+depends=('python')
+makedepends=('python-setuptools')
+checkdepends=('python-idna' 'python-pycryptodome' 'python-ecdsa') # 'python-trio')
+optdepends=('python-ecdsa: DNSSEC support'
+            'python-pycryptodome: DNSSEC support'
+            'python-idna: support for updated IDNA 2008')
+#            'python-trio: async support'
+#            'python-sniffio: async support')
+source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.zip"
+        py39.patch)
+sha256sums=('36c5e8e38d4369a08b6780b7f27d790a292b2b08eea01607865bf0936c558e01'
+            '243f735d32f403f6032d4c51b12c1f39c1a8f32d4b5cc9cb4d52c43f07e3296e')
+validpgpkeys=('A580DEE052FEC78D8ACF383DF24B3AFC8CA2F5C7') # Bob Halley <halley at dnspython.org>
+
+prepare() {
+    cd dnspython-${pkgver}
+
+    patch -Np1 -i ../py39.patch
+}
+
+build() {
+    cd dnspython-${pkgver}
+
+    python setup.py build
+}
+
+check() {
+    cd dnspython-${pkgver}
+
+    python setup.py test
+}
+
+package() {
+    cd dnspython-${pkgver}
+
+    python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+    install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+}

Copied: python-dnspython/repos/community-any/py39.patch (from rev 769702, python-dnspython/trunk/py39.patch)
===================================================================
--- py39.patch	                        (rev 0)
+++ py39.patch	2020-12-03 16:25:58 UTC (rev 769703)
@@ -0,0 +1,79 @@
+From f565c1120bc8f823ce2c6e21d5aeea412afaec6e Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos at foutrelis.com>
+Date: Thu, 3 Dec 2020 18:17:51 +0200
+Subject: [PATCH] Use base64.decodebytes() and base64.encodebytes().  [Issue
+ #338]
+
+This commit also adds test coverage for tsigkeyring, and fixes to_text()
+on python 3, which had never worked properly due to an extra .decode().
+
+(cherry picked from commit f93c8c6ad41d38ccd19335a5a0a396cbaa409caf)
+---
+ dns/tsigkeyring.py        |  7 ++++---
+ tests/test_tsigkeyring.py | 33 +++++++++++++++++++++++++++++++++
+ 2 files changed, 37 insertions(+), 3 deletions(-)
+ create mode 100644 tests/test_tsigkeyring.py
+
+diff --git a/dns/tsigkeyring.py b/dns/tsigkeyring.py
+index 5e5fe1c..74ff667 100644
+--- a/dns/tsigkeyring.py
++++ b/dns/tsigkeyring.py
+@@ -32,7 +32,7 @@ def from_text(textring):
+     keyring = {}
+     for keytext in textring:
+         keyname = dns.name.from_text(keytext)
+-        secret = base64.decodestring(maybe_encode(textring[keytext]))
++        secret = base64.decodebytes(maybe_encode(textring[keytext]))
+         keyring[keyname] = secret
+     return keyring
+ 
+@@ -44,7 +44,8 @@ def to_text(keyring):
+ 
+     textring = {}
+     for keyname in keyring:
+-        keytext = maybe_decode(keyname.to_text())
+-        secret = maybe_decode(base64.encodestring(keyring[keyname]))
++        keytext = keyname.to_text()
++        # rstrip to get rid of the \n encoding adds
++        secret = maybe_decode(base64.encodebytes(keyring[keyname])).rstrip()
+         textring[keytext] = secret
+     return textring
+diff --git a/tests/test_tsigkeyring.py b/tests/test_tsigkeyring.py
+new file mode 100644
+index 0000000..ce8888d
+--- /dev/null
++++ b/tests/test_tsigkeyring.py
+@@ -0,0 +1,33 @@
++# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
++
++import base64
++import unittest
++
++import dns.tsigkeyring
++
++text_keyring = {
++    'keyname.' : 'NjHwPsMKjdN++dOfE5iAiQ=='
++}
++
++rich_keyring = {
++    dns.name.from_text('keyname.') : \
++    base64.decodebytes('NjHwPsMKjdN++dOfE5iAiQ=='.encode())
++}
++
++class TSIGKeyRingTestCase(unittest.TestCase):
++
++    def test_from_text(self):
++        """text keyring -> rich keyring"""
++        rkeyring = dns.tsigkeyring.from_text(text_keyring)
++        self.assertEqual(rkeyring, rich_keyring)
++
++    def test_to_text(self):
++        """text keyring -> rich keyring -> text keyring"""
++        tkeyring = dns.tsigkeyring.to_text(rich_keyring)
++        self.assertEqual(tkeyring, text_keyring)
++
++    def test_from_and_to_text(self):
++        """text keyring -> rich keyring -> text keyring"""
++        rkeyring = dns.tsigkeyring.from_text(text_keyring)
++        tkeyring = dns.tsigkeyring.to_text(rkeyring)
++        self.assertEqual(tkeyring, text_keyring)



More information about the arch-commits mailing list