[arch-commits] Commit in hyperkitty/trunk (6 files)

David Runge dvzrv at gemini.archlinux.org
Wed Dec 8 20:44:41 UTC 2021


    Date: Wednesday, December 8, 2021 @ 20:44:41
  Author: dvzrv
Revision: 1065699

upgpkg: hyperkitty 1.3.5-2: Rebuild to fix multiple issues.

Assure compatibility with python-mistune >= 2.0.0.
Add patches for warnings with django and qcluster.
Add patches for python 3.10 compatibility.
Simplify quoting in file.
Simplify installation in package() to adhere to python package guidelines.

Added:
  hyperkitty/trunk/hyperkitty-1.3.5-assert_date_header.patch
  hyperkitty/trunk/hyperkitty-1.3.5-assert_printable_date.patch
  hyperkitty/trunk/hyperkitty-1.3.5-implict_primary_keys.patch
  hyperkitty/trunk/hyperkitty-1.3.5-mistune2.0.0_imports.patch
  hyperkitty/trunk/hyperkitty-1.3.5-qcluster_retry.patch
Modified:
  hyperkitty/trunk/PKGBUILD

----------------------------------------------+
 PKGBUILD                                     |  100 +++++++++++++++----------
 hyperkitty-1.3.5-assert_date_header.patch    |   32 ++++++++
 hyperkitty-1.3.5-assert_printable_date.patch |   37 +++++++++
 hyperkitty-1.3.5-implict_primary_keys.patch  |   31 +++++++
 hyperkitty-1.3.5-mistune2.0.0_imports.patch  |   28 +++++++
 hyperkitty-1.3.5-qcluster_retry.patch        |   14 +++
 6 files changed, 202 insertions(+), 40 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-12-08 20:26:13 UTC (rev 1065698)
+++ PKGBUILD	2021-12-08 20:44:41 UTC (rev 1065699)
@@ -3,20 +3,19 @@
 _name=HyperKitty
 pkgname=hyperkitty
 pkgver=1.3.5
-pkgrel=1
+pkgrel=2
 pkgdesc="A web interface to access GNU Mailman v3 archives"
-arch=('any')
+arch=(any)
 url="https://gitlab.com/mailman/hyperkitty"
-license=('GPL3')
-depends=('python-dateutil' 'python-django' 'python-django-compressor'
-'python-django-extensions' 'python-django-gravatar' 'python-django-haystack'
-'python-django-mailman3' 'python-django-q' 'python-django-rest-framework'
-'python-flufl-lock' 'python-mailmanclient' 'python-mistune' 'python-networkx'
-'python-pytz' 'python-robot-detection' 'python-whoosh' 'sassc')
-makedepends=('python-isort' 'python-setuptools')
-checkdepends=('python-beautifulsoup4' 'python-django-debug-toolbar'
-'python-elasticsearch' 'python-lxml' 'python-mock' 'python-pytest'
-'python-whoosh')
+license=(GPL3)
+depends=(python-dateutil python-django python-django-compressor
+python-django-extensions python-django-gravatar python-django-haystack
+python-django-mailman3 python-django-q python-django-rest-framework
+python-flufl-lock python-mailmanclient python-mistune python-networkx
+python-pytz python-robot-detection python-whoosh sassc)
+makedepends=(python-isort python-setuptools)
+checkdepends=(python-beautifulsoup4 python-django-debug-toolbar
+python-elasticsearch python-lxml python-mock python-pytest python-whoosh)
 optdepends=('python-elasticsearch: for using elasticsearch as search backend'
             'python-xapian-haystack: for using xapian as search backend'
             'uwsgi-plugin-python: for running inside uwsgi'
@@ -26,15 +25,27 @@
         "etc/webapps/${pkgname}/urls.py"
 )
 install="${pkgname}.install"
-source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz"{,.asc}
-        "${pkgname}-1.3.2-settings.patch"
-        "${pkgname}-qcluster.service"
-        "${pkgname}.sysusers"
-        "${pkgname}.tmpfiles"
-        "${pkgname}.uwsgi")
+source=(
+  "https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz"{,.asc}
+  "${pkgname}-1.3.2-settings.patch"
+  "${pkgname}-1.3.5-qcluster_retry.patch"
+  "${pkgname}-1.3.5-mistune2.0.0_imports.patch"
+  "${pkgname}-1.3.5-implict_primary_keys.patch"
+  "${pkgname}-1.3.5-assert_printable_date.patch"
+  "${pkgname}-1.3.5-assert_date_header.patch"
+  "${pkgname}-qcluster.service"
+  "${pkgname}.sysusers"
+  "${pkgname}.tmpfiles"
+  "${pkgname}.uwsgi"
+)
 sha512sums=('9e794cd522904369dea5a70489e3ab7fe149680ed13f03e5002f0ad84304cf1de7481c71e302cf46cd9fa244cadca5d0c41767ceb4cee82b7153f052bc1b677d'
             'SKIP'
             '452da2c049f0c35d27e15c16af1a6a526de79a6672b6fdaf9a4bcbdfd2110ebf608e8c5a1f5dfc3bb2febc39ecc6e69e2a657c3b2c6e1d2dc2eca2de81125380'
+            'e0a8843e370ff593caad26d72db1af84a404308148d7df0f8eb7ab99599223e4edd4f1f3fa5690dbb52b325df388a9b6ca1e45bd0a087036459e5c11e74d5f18'
+            'ad8f6fd38993eb5bcb03c4f98fd001827ef739498b08304a4d05b721dbbc146fff6b5fd7b0fdd1a73b34c26d5f9bbe3b2838ef4cd095c6df6086c11f9ab7583f'
+            '7ec5c67d03215b95eb32796fc7bc42f322d2874f188ac4e2bbf965b22a9d07935917b29828bc299bc4c51912201b0cfb5210cfa228d0135c2d69428e37cae122'
+            '6d317720ebf06bf028e60db717f37820bb3cb72b8ca9ce571e5c0cacc255b5f813138f3d1bc308d21081b8b5593095587760fbcf4ab87ea4e4a15aad55153e42'
+            'ad30d45393605efb4cc79e47fc243461ba00f5f400c39eb266bc73a1d52a88e34d33c0dd0a2f3ea8fdc61e1d61bd4ebe7b1a3497c5f2ac6d476be8ba3dc298e9'
             'a41c938082ceee555143ddb21c3a95835f9832b9aff423142d78d3e52f12500561f80e0ce43c67a4f190065c9d045945741ac71ab3307db1419c4dc0686db09a'
             '3267427109b08b8c9336b187381ed14357a07370bdcdfc24da94555020ad0424c5bbebc09e131e981e0540c51db443ffe558209e1bca7c2a1b7b1f602ed0805b'
             'c943d82b8640a513728e3f07fa44c0ddb5a3bb8ec84a3a70990e51287ca01977887f895b901688fc4643d8fcb106d524259a86a51bccaafd77c69b241f1b23ba'
@@ -42,6 +53,11 @@
 b2sums=('2ef6917425bdf00a5a03383a8f7ff0eb1243557c1189d9afba33b3c1f09db63b40827b0e7f9602964f251197045594d786df13c6cd288c97980967bdf85eba4c'
         'SKIP'
         '1eab6221db4adb1a066bde8d6c84a90d3e414d1d30c5cf55a90a4ac58d131f7c4872c85d65e98d91ee0f4cac6f71c47c829993c736617a86be8fec5d831422c8'
+        '81a08e5aeed8e2b287b29c8799dd7969877c7461e6c9d17df7208acdf98f740033114e1129175aa2eac80ede9075627f76204464ea3ca0bc0619b76b96f87fdc'
+        '96e34038f58dd5b15a36f99ae714e952743718f70dc0f4521d6e1a1681531fb16919026582951160ee76c512204a0d145ad0564e96578cf18cefc4184697d68e'
+        '8974775bd1a1426175516d4aaf7cebb85365db8dbe91ba5e2d609df0a860d71bb5573cf1f20c6a7a905a6f21764846aad7e506306b30287fe2514920a8810bc4'
+        '7f5003f8e9a525f4e0fa0688f1897b7d757ca069ce07b91f6a5bf59e58e9df47b01df0f37daaa9f6f6d6f1bbdb33c6741de6ed9bfacddcd8fe8b575080b8e21c'
+        'ab81d2c787a4c87748573e7fc01d027f2cc2d9b59b3716cc2a2161b11ea69b5f9c9b9ef290d17328d1df5db7a4027f189f46ae90c60cdfab6b00d8dcbc64a0e6'
         'e8ae1d123e74b0c6984df3e5fff720e03dcbc3f007123718fe845024b42e5c13b7eac4da6bde04a9e1372d446bfa50ac12479730a9092e8396b73434e59663d3'
         'f4e912e75c5127897837d67626ba94a418ec408f0f3a9bcd1767633347e107600cc43825caa5737a84362273a353bf03097879ff5b9065663150f6db4b96238a'
         'e4fd83e38703d8ff9a714b238296e4e12791b8ce0c19446709e5c20b4012ed10b97504cafda66cdbe12e56a9f943c094147b6a02db3bd9c854e609adca38ff01'
@@ -53,6 +69,20 @@
   cd "$pkgname-$pkgver"
   # setting FHS compliant default paths, remove debug options
   patch -Np1 -i "../${pkgname}-1.3.2-settings.patch"
+
+  # fix warnings with qcluster retry
+  # https://gitlab.com/mailman/hyperkitty/-/issues/402
+  patch -Np1 -i ../"${pkgname}-1.3.5-qcluster_retry.patch"
+  # fix imports with python-mistune >= 2.0.0
+  # https://gitlab.com/mailman/hyperkitty/-/issues/395
+  patch -Np1 -i ../"${pkgname}-1.3.5-mistune2.0.0_imports.patch"
+  # fix excessive warnings with django >= 3.2
+  # https://gitlab.com/mailman/hyperkitty/-/issues/401
+  patch -Np1 -i ../"${pkgname}-1.3.5-implict_primary_keys.patch"
+  # fix issues due to changes in the email module in python 3.10
+  # https://gitlab.com/mailman/hyperkitty/-/issues/401
+  patch -Np1 -i ../"${pkgname}-1.3.5-assert_printable_date.patch"
+  patch -Np1 -i ../"${pkgname}-1.3.5-assert_date_header.patch"
   touch settings_local.py
 }
 
@@ -68,11 +98,10 @@
 }
 
 package() {
+  local python_stdlib_basepath="$(python -c "from sysconfig import get_path; print(get_path('stdlib'))")"
+
   cd "$pkgname-$pkgver"
-  local python_stdlib_basepath="$(python -c "from sysconfig import get_path; print(get_path('stdlib'))")"
-  python setup.py install --skip-build \
-                          --optimize=1 \
-                          --root="${pkgdir}"
+  python setup.py install --optimize=1 --root="${pkgdir}"
   # remove example_project from top level site-packages:
   # https://gitlab.com/mailman/hyperkitty/issues/279
   rm -rfv "${pkgdir}/${python_stdlib_basepath}/site-packages/example_project"
@@ -79,13 +108,10 @@
   # doc
   install -vDm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
   # django project
-  install -vDm 644 example_project/{__init__,manage,settings,wsgi}.py \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}"
+  install -vDm 644 example_project/{__init__,manage,settings,wsgi}.py -t "${pkgdir}/usr/share/webapps/${pkgname}"
   # symlink locale and static dirs to state dir
-  ln -svf "/var/lib/${pkgname}/locale/" \
-    "${pkgdir}/usr/share/webapps/${pkgname}"
-  ln -svf "/var/lib/${pkgname}/static/" \
-    "${pkgdir}/usr/share/webapps/${pkgname}"
+  ln -svf "/var/lib/${pkgname}/locale/" "${pkgdir}/usr/share/webapps/${pkgname}"
+  ln -svf "/var/lib/${pkgname}/static/" "${pkgdir}/usr/share/webapps/${pkgname}"
   # state dir
   install -vdm 750 "${pkgdir}/var/lib/${pkgname}/data"
   install -vdm 755 "${pkgdir}/var/lib/${pkgname}/"{locale,static}
@@ -92,21 +118,15 @@
   # log dir
   install -vdm 750 "${pkgdir}/var/log/${pkgname}"
   # config
-  install -vDm 640 settings_local.py example_project/urls.py \
-    -t "${pkgdir}/etc/webapps/${pkgname}"
-  ln -svf "/etc/webapps/${pkgname}/settings_local.py" \
-    "${pkgdir}/usr/share/webapps/${pkgname}/settings_local.py"
-  ln -svf "/etc/webapps/${pkgname}/urls.py" \
-    "${pkgdir}/usr/share/webapps/${pkgname}/urls.py"
+  install -vDm 640 settings_local.py example_project/urls.py -t "${pkgdir}/etc/webapps/${pkgname}"
+  ln -svf "/etc/webapps/${pkgname}/settings_local.py" "${pkgdir}/usr/share/webapps/${pkgname}/settings_local.py"
+  ln -svf "/etc/webapps/${pkgname}/urls.py" "${pkgdir}/usr/share/webapps/${pkgname}/urls.py"
   # systemd service
-  install -vDm 644 "../${pkgname}-qcluster.service" \
-    -t "${pkgdir}/usr/lib/systemd/system"
+  install -vDm 644 "../${pkgname}-qcluster.service" -t "${pkgdir}/usr/lib/systemd/system"
   # uwsgi
   install -vDm 644 "../${pkgname}.uwsgi" "${pkgdir}/etc/uwsgi/${pkgname}.ini"
   # tmpfiles.d
-  install -vDm 644 "../${pkgname}.tmpfiles" \
-    "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
+  install -vDm 644 "../${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
   # sysusers.d
-  install -vDm 644 "../${pkgname}.sysusers" \
-    "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
+  install -vDm 644 "../${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
 }

Added: hyperkitty-1.3.5-assert_date_header.patch
===================================================================
--- hyperkitty-1.3.5-assert_date_header.patch	                        (rev 0)
+++ hyperkitty-1.3.5-assert_date_header.patch	2021-12-08 20:44:41 UTC (rev 1065699)
@@ -0,0 +1,32 @@
+From 2c01fb98f8587a38d0c5bc8ede008d6f0b8e8005 Mon Sep 17 00:00:00 2001
+From: David Runge <dave at sleepmap.de>
+Date: Wed, 8 Dec 2021 13:55:33 +0100
+Subject: [PATCH] Raise when datetime attribute of a Date: header is None
+
+hyperkitty/management/commands/hyperkitty_import.py:
+Change `DbImporter._get_date()` to raise when the retrieved `Date:`
+header's `datetime` attribute is `None`.
+This is required as python 3.10.0 introduces a change, that may return
+invalid string representations of a `Date:` header, while setting its
+`datetime` attribute to `None`:
+
+https://github.com/python/cpython/commit/303aac8c56609290e122eecc14c038e9b1e4174a
+---
+ hyperkitty/management/commands/hyperkitty_import.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/hyperkitty/management/commands/hyperkitty_import.py b/hyperkitty/management/commands/hyperkitty_import.py
+index 48dd248d..baae013d 100644
+--- a/hyperkitty/management/commands/hyperkitty_import.py
++++ b/hyperkitty/management/commands/hyperkitty_import.py
+@@ -134,6 +134,7 @@ class DbImporter(object):
+             date = message.get(header)
+             if date:
+                 assert all(char in printable for char in date)
++                assert date.datetime is not None
+         except (AssertionError, TypeError, ValueError) as e:
+             if self.verbose:
+                 self.stderr.write(
+-- 
+GitLab
+

Added: hyperkitty-1.3.5-assert_printable_date.patch
===================================================================
--- hyperkitty-1.3.5-assert_printable_date.patch	                        (rev 0)
+++ hyperkitty-1.3.5-assert_printable_date.patch	2021-12-08 20:44:41 UTC (rev 1065699)
@@ -0,0 +1,37 @@
+From 0fc064f834cb15ad716ea45b3726fc6ca26e74bb Mon Sep 17 00:00:00 2001
+From: David Runge <dave at sleepmap.de>
+Date: Tue, 7 Dec 2021 22:46:17 +0100
+Subject: [PATCH] Assert date headers are printable chars
+
+hyperkitty/management/commands/hyperkitty_import.py:
+Assert that chars in date headers are in the set of printable chars.
+---
+ hyperkitty/management/commands/hyperkitty_import.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/hyperkitty/management/commands/hyperkitty_import.py b/hyperkitty/management/commands/hyperkitty_import.py
+index 2a50e933..48dd248d 100644
+--- a/hyperkitty/management/commands/hyperkitty_import.py
++++ b/hyperkitty/management/commands/hyperkitty_import.py
+@@ -31,6 +31,7 @@ from datetime import datetime
+ from email import message_from_bytes, policy
+ from email.utils import make_msgid, unquote
+ from math import floor
++from string import printable
+ from traceback import print_exc
+ 
+ from django.conf import settings
+@@ -131,7 +132,9 @@ class DbImporter(object):
+     def _get_date(self, message, header, report_name):
+         try:
+             date = message.get(header)
+-        except (TypeError, ValueError) as e:
++            if date:
++                assert all(char in printable for char in date)
++        except (AssertionError, TypeError, ValueError) as e:
+             if self.verbose:
+                 self.stderr.write(
+                     "Can't get {} header in message {}{}: {}.".format(
+-- 
+GitLab
+

Added: hyperkitty-1.3.5-implict_primary_keys.patch
===================================================================
--- hyperkitty-1.3.5-implict_primary_keys.patch	                        (rev 0)
+++ hyperkitty-1.3.5-implict_primary_keys.patch	2021-12-08 20:44:41 UTC (rev 1065699)
@@ -0,0 +1,31 @@
+diff --git a/example_project/settings.py b/example_project/settings.py
+index 5aca0186..aad3e4f5 100644
+--- a/example_project/settings.py
++++ b/example_project/settings.py
+@@ -157,6 +157,9 @@ DATABASES = {
+     #}
+ }
+ 
++# Set default type of primary key (feature introduced with django 3.2)
++# https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys
++DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
+ 
+ # If you're behind a proxy, use the X-Forwarded-Host header
+ # See https://docs.djangoproject.com/en/1.8/ref/settings/#use-x-forwarded-host
+diff --git a/hyperkitty/tests/settings_test.py b/hyperkitty/tests/settings_test.py
+index 71da81c3..ab271a3b 100644
+--- a/hyperkitty/tests/settings_test.py
++++ b/hyperkitty/tests/settings_test.py
+@@ -149,6 +149,9 @@ DATABASES = {
+     # }
+ }
+ 
++# Set default type of primary key (feature introduced with django 3.2)
++# https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys
++DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
+ 
+ # If you're behind a proxy, use the X-Forwarded-Host header
+ # See https://docs.djangoproject.com/en/1.8/ref/settings/#use-x-forwarded-host
+-- 
+GitLab
+

Added: hyperkitty-1.3.5-mistune2.0.0_imports.patch
===================================================================
--- hyperkitty-1.3.5-mistune2.0.0_imports.patch	                        (rev 0)
+++ hyperkitty-1.3.5-mistune2.0.0_imports.patch	2021-12-08 20:44:41 UTC (rev 1065699)
@@ -0,0 +1,28 @@
+From 2c3c189c9aacef3f54de2ae0f653aa13c6167093 Mon Sep 17 00:00:00 2001
+From: David Runge <dave at sleepmap.de>
+Date: Sun, 5 Dec 2021 12:39:01 +0100
+Subject: [PATCH] Fix mistune imports for mistune >= 2.0.0
+
+hyperkitty/lib/renderer.py:
+With mistune 2.0.0 the `escape_url()` and `escape_html()` are moved to
+mistune.util.
+---
+ hyperkitty/lib/renderer.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/hyperkitty/lib/renderer.py b/hyperkitty/lib/renderer.py
+index cf54e7c0..96f026db 100644
+--- a/hyperkitty/lib/renderer.py
++++ b/hyperkitty/lib/renderer.py
+@@ -4,7 +4,7 @@ from django.conf import settings
+ 
+ import mistune
+ from mistune.plugins.extra import plugin_url
+-from mistune.scanner import escape_html, escape_url
++from mistune.util import escape_html, escape_url
+ 
+ 
+ class MyRenderer(mistune.HTMLRenderer):
+-- 
+GitLab
+

Added: hyperkitty-1.3.5-qcluster_retry.patch
===================================================================
--- hyperkitty-1.3.5-qcluster_retry.patch	                        (rev 0)
+++ hyperkitty-1.3.5-qcluster_retry.patch	2021-12-08 20:44:41 UTC (rev 1065699)
@@ -0,0 +1,14 @@
+diff --git a/example_project/settings.py b/example_project/settings.py
+index a6e90441..5aca0186 100644
+--- a/example_project/settings.py
++++ b/example_project/settings.py
+@@ -368,6 +368,7 @@ REST_FRAMEWORK = {
+ #
+ Q_CLUSTER = {
+     'timeout': 300,
++    'retry': 360,
+     'save_limit': 100,
+     'orm': 'default',
+ }
+-- 
+GitLab



More information about the arch-commits mailing list