git: 56fc85f2008d - main - www/radicale: Fix 'main component missing' error, Bump PORTREVISION

From: Ryan Steinmetz <zi_at_FreeBSD.org>
Date: Fri, 18 Nov 2022 13:15:55 UTC
The branch main has been updated by zi:

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

commit 56fc85f2008dd9804c03063944ed5860e83aba93
Author:     Ryan Steinmetz <zi@FreeBSD.org>
AuthorDate: 2022-11-18 13:13:58 +0000
Commit:     Ryan Steinmetz <zi@FreeBSD.org>
CommitDate: 2022-11-18 13:15:52 +0000

    www/radicale: Fix 'main component missing' error, Bump PORTREVISION
    
    Approved by:    maintainer
    Obtained from:  https://github.com/Kozea/Radicale/pull/1252/commits
---
 www/radicale/Makefile                            |  1 +
 www/radicale/files/patch-radicale_item_filter.py | 25 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/www/radicale/Makefile b/www/radicale/Makefile
index 823e7266abdb..230fda6b1063 100644
--- a/www/radicale/Makefile
+++ b/www/radicale/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	radicale
 PORTVERSION=	3.1.8
+PORTREVISION=	1
 CATEGORIES=	www python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
diff --git a/www/radicale/files/patch-radicale_item_filter.py b/www/radicale/files/patch-radicale_item_filter.py
new file mode 100644
index 000000000000..a6a5e5cc1ae2
--- /dev/null
+++ b/www/radicale/files/patch-radicale_item_filter.py
@@ -0,0 +1,25 @@
+--- radicale/item/filter.py.orig	2022-07-14 20:36:41 UTC
++++ radicale/item/filter.py
+@@ -225,6 +225,7 @@ def visit_time_ranges(vobject_item: vobject.base.Compo
+     def get_children(components: Iterable[vobject.base.Component]) -> Iterator[
+                          Tuple[vobject.base.Component, bool, List[date]]]:
+         main = None
++        rec_main = None
+         recurrences = []
+         for comp in components:
+             if hasattr(comp, "recurrence_id") and comp.recurrence_id.value:
+@@ -232,11 +233,14 @@ def visit_time_ranges(vobject_item: vobject.base.Compo
+                 if comp.rruleset:
+                     # Prevent possible infinite loop
+                     raise ValueError("Overwritten recurrence with RRULESET")
++                rec_main = comp
+                 yield comp, True, []
+             else:
+                 if main is not None:
+                     raise ValueError("Multiple main components")
+                 main = comp
++        if main is None and len(recurrences) == 1:
++            main = rec_main
+         if main is None:
+             raise ValueError("Main component missing")
+         yield main, False, recurrences