Skip to content

Commit

Permalink
community/khal: add upstream patch to support icalendar 6.0.0
Browse files Browse the repository at this point in the history
This was submitted upstream but hasn't been merged yet because they are
trying to figure out how to maintain backwards compatibility with older
py3-icalendar versions.

pimutils/khal#1364
  • Loading branch information
craftyguy authored and Ikke committed Nov 6, 2024
1 parent bb335b8 commit 462b56a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
38 changes: 38 additions & 0 deletions community/khal/0001-support-icalendar-6.0.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 0b5975e17296d5e52f19abbbb4790a64b153d710 Mon Sep 17 00:00:00 2001
From: Clayton Craft <[email protected]>
Date: Mon, 4 Nov 2024 19:46:04 -0800
Subject: [PATCH] support icalendar>=6.0.0

Based on: https://github.com/pimutils/khal/pull/1364
---
khal/icalendar.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/khal/icalendar.py b/khal/icalendar.py
index 5ae1787..c108ad0 100644
--- a/khal/icalendar.py
+++ b/khal/icalendar.py
@@ -37,6 +37,9 @@ from .utils import generate_random_uid, localize_strip_tz, to_unix_time

logger = logging.getLogger('khal')

+# Force use of pytz because we rely on functionalities not available in
+# zoneinfo.
+icalendar.use_pytz()

def split_ics(ics: str, random_uid: bool=False, default_timezone=None):
"""split an ics string into several according to VEVENT's UIDs
@@ -56,8 +59,8 @@ def split_ics(ics: str, random_uid: bool=False, default_timezone=None):
# Standard Time' for 'Pacific/Auckland' in Olson format), we convert any
# Windows format timezones to Olson.
if item.name == 'VTIMEZONE':
- if item['TZID'] in icalendar.windows_to_olson.WINDOWS_TO_OLSON:
- key = icalendar.windows_to_olson.WINDOWS_TO_OLSON[item['TZID']]
+ if item['TZID'] in icalendar.timezone.windows_to_olson.WINDOWS_TO_OLSON:
+ key = icalendar.timezone.windows_to_olson.WINDOWS_TO_OLSON[item['TZID']]
else:
key = item['TZID']
tzs[key] = item
--
2.46.2

4 changes: 3 additions & 1 deletion community/khal/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Maintainer: Galen Abell <[email protected]>
pkgname=khal
pkgver=0.11.3
pkgrel=2
pkgrel=3
pkgdesc="CLI calendar application build around CalDAV"
url="https://lostpackets.de/khal"
arch="noarch"
Expand Down Expand Up @@ -39,6 +39,7 @@ subpackages="
"
source="https://files.pythonhosted.org/packages/source/k/khal/khal-$pkgver.tar.gz
fix-doc-intersphinx-mapping.patch
0001-support-icalendar-6.0.0.patch
"
case "$CARCH" in
s390x)
Expand Down Expand Up @@ -84,4 +85,5 @@ package() {
sha512sums="
1f7f82e04ad913df9e2e4bd315a70b9832b1af3f6d2db794018c780645f5bdb6df39efb45a36b38e3c1327932a1cb91d4c735f578b29a9326ef0f163fecd7bba khal-0.11.3.tar.gz
6d076eaa73274d360f89e2fba7a3cfcfb655a0f101ecc6ad6636d0d9fadc68c6caba9c51cf6229f7994677eb6e5e68c0dd5b17c4c7e437f4b5e543c4ff3c9ad0 fix-doc-intersphinx-mapping.patch
4554bdaa3dcdf963927b6b7924fa580dd045e99e2be254594863f1a8c63f868893a415ef0f4c2d469160f6ca4d3fd63593518c6d99cb576959d96556cbcb5cbc 0001-support-icalendar-6.0.0.patch
"

0 comments on commit 462b56a

Please sign in to comment.