Bug#927681: unblock: khal/1:0.9.10-1.1
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Please unblock package khal
Previous fix for bug#908497 (FTBFS with python-dateutil 2.7.3-1) was
incomplete and hid the real underlying problem.
Release 1:0.9.10-1.1 replaces the patch introduced in 1:0.9.10-0.1 with
the corresponding patch cherry-picked upstream.
unblock khal/1:0.9.10-1.1
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAly8D/wACgkQLHwxRsGg
ASF8IRAAjOZxfUyRsypsRARlnht7k3Tw9/ZSzWCI4Ml4v0azph9C52vi0nfL7cBN
hAZ8wSj4uumTLITYRyt2l38U17nlfvwrWt4D9Pv0AHWGZVBRGdsGjiSS03UIm9QX
an+rjx5GhL+r1/mFhgHgC0Pb+fvotV7pMZ89rSxy3g1gv1Xt6Cxcm9zW2ME+ZjOT
uofAhDB4nl5EbTOxXCEw/q+kgATgmS1CNeErWdj7iu86oKTDVfcYpW2nb0ldM2TL
Iw9aDDgJey+cvpCeGad/lxsOZTBfNU/Nn1SgkIXWHWcb5FcuLlXlSsvBLlcxl0h3
g6RPtp9aT1a1nAkiKIfjCr7r4WoDRsrsBweeiFIgVAuxADjnnKzfRaLMcjralEzA
NQgGVsxueJnj8NoMd1lYJwqALaeT5uaDVi8BXUAnBYpC/zqmh89Qx0bhQiS4Miic
ID4FUNel48X1W7i/UZ1aNJcaf/LrfMaQlImp7Ns4MCdpy20jwwSSt7m4vFpsjUbj
Hz6DFf7Ffx6njRhJ2wPtDoEZL1kp+6wrNOIYgctlu8ZzG1M73a3jfTB/pAciPWxu
5quR1cInyFuEQ15pe0Yk5P7jnokadIDebvcRlasUSu8bMLNQOCdQIOBi23EspFLk
IL4v2nQiuJZShHO1OGiczJc4Og6d1O12cNUT8nTFFVVpc4H+0AE=
=qK2A
-----END PGP SIGNATURE-----
diff --git a/debian/changelog b/debian/changelog
index 292fbb6..3100246 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+khal (1:0.9.10-1.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Add patch cherry-picked upstream to fix parse categories as list,
+ superseding patch 0008 only fixing testsuite.
+ Tighten build-dependency on python3-icalendar.
+
+ -- Jonas Smedegaard <dr@jones.dk> Tue, 26 Mar 2019 09:56:46 +0100
+
khal (1:0.9.10-1) unstable; urgency=medium
[ Ondřej Nový ]
diff --git a/debian/control b/debian/control
index 254176e..d0501fc 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,7 @@ Build-Depends: debhelper (>= 12),
python3-dateutil,
python3-doc,
python3-freezegun,
- python3-icalendar,
+ python3-icalendar (>= 4.0.3),
python3-pytest,
python3-setuptools,
python3-setuptools-scm,
diff --git a/debian/patches/0000-20190325~c58fb88-fix-parse-categories-as-list.patch b/debian/patches/0000-20190325~c58fb88-fix-parse-categories-as-list.patch
new file mode 100644
index 0000000..1d69783
--- /dev/null
+++ b/debian/patches/0000-20190325~c58fb88-fix-parse-categories-as-list.patch
@@ -0,0 +1,121 @@
+Description: fix pass categories as list
+ Support (only) icalendar >= 4.0.3
+ .
+ With icalendar 4.0.3 the CATEGORIES Property became a list
+ as mandated by the RFC.
+Author: Christian Geier <geier@lostpackets.de>
+Bug: https://github.com/pimutils/khal/issues/825
+Last-Update: 2019-03-26
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/khal/cli.py
++++ b/khal/cli.py
+@@ -335,7 +335,7 @@
+ @click.option('--location', '-l',
+ help=('The location of the new event.'))
+ @click.option('--categories', '-g',
+- help=('The categories of the new event.'))
++ help=('The categories of the new event, comma separated.'))
+ @click.option('--repeat', '-r',
+ help=('Repeat event: daily, weekly, monthly or yearly.'))
+ @click.option('--until', '-u',
+--- a/khal/controllers.py
++++ b/khal/controllers.py
+@@ -349,6 +349,8 @@
+ categories=None, repeat=None, until=None, alarms=None,
+ timezone=None, format=None, env=None):
+ """Create a new event from arguments and add to vdirs"""
++ if isinstance(categories, str):
++ categories = list([category.strip() for category in categories.split(',')])
+ try:
+ event = utils.new_event(
+ locale=conf['locale'], location=location, categories=categories,
+@@ -489,7 +491,10 @@
+ value = prompt(question, default)
+ if allow_none and value == "None":
+ value = ""
+- getattr(event, "update_" + attr)(value)
++ if attr == 'categories':
++ getattr(event, "update_" + attr)(list([cat.strip() for cat in value.split(',')]))
++ else:
++ getattr(event, "update_" + attr)(value)
+ edited = True
+
+ if edited:
+--- a/khal/khalendar/event.py
++++ b/khal/khalendar/event.py
+@@ -409,13 +409,16 @@
+
+ @property
+ def categories(self):
+- return self._vevents[self.ref].get('CATEGORIES', '')
++ try:
++ return self._vevents[self.ref].get('CATEGORIES', '').to_ical().decode('utf-8')
++ except AttributeError:
++ return ''
+
+ def update_categories(self, categories):
+- if categories.strip():
+- self._vevents[self.ref]['CATEGORIES'] = categories
+- else:
+- self._vevents[self.ref].pop('CATEGORIES', False)
++ assert isinstance(categories, list)
++ self._vevents[self.ref].pop('CATEGORIES', False)
++ if categories:
++ self._vevents[self.ref].add('CATEGORIES', categories)
+
+ @property
+ def description(self):
+--- a/khal/ui/editor.py
++++ b/khal/ui/editor.py
+@@ -414,7 +414,7 @@
+ self.event.update_summary(self.summary.get_edit_text())
+ self.event.update_description(self.description.get_edit_text())
+ self.event.update_location(self.location.get_edit_text())
+- self.event.update_categories(self.categories.get_edit_text())
++ self.event.update_categories(self.categories.get_edit_text().split(','))
+
+ if self.startendeditor.changed:
+ self.event.update_start_end(
+--- a/setup.py
++++ b/setup.py
+@@ -11,7 +11,7 @@
+
+ requirements = [
+ 'click>=3.2',
+- 'icalendar',
++ 'icalendar>=4.0.3',
+ 'urwid',
+ 'pyxdg',
+ 'pytz',
+--- a/tests/event_test.py
++++ b/tests/event_test.py
+@@ -55,7 +55,7 @@
+ event.update_summary('A not so simple Event')
+ event.update_description('Everything has changed')
+ event.update_location('anywhere')
+- event.update_categories('meeting')
++ event.update_categories(['meeting'])
+ assert normalize_component(event.raw) == normalize_component(event_updated.raw)
+
+
+@@ -95,7 +95,7 @@
+ def test_update_remove_categories():
+ event = Event.fromString(_get_text('event_dt_simple_updated'), **EVENT_KWARGS)
+ event_nocat = Event.fromString(_get_text('event_dt_simple_nocat'), **EVENT_KWARGS)
+- event.update_categories(' ')
++ event.update_categories([])
+ assert normalize_component(event.raw) == normalize_component(event_nocat.raw)
+
+
+--- a/tests/utils_test.py
++++ b/tests/utils_test.py
+@@ -564,7 +564,7 @@
+ event = _construct_event(data_list.split(),
+ description='please describe the event',
+ location='in the office',
+- categories='boring meeting',
++ categories=['boring meeting'],
+ locale=LOCALE_BERLIN)
+ assert _replace_uid(event).to_ical() == vevent
+
diff --git a/debian/patches/0008_pass-categories-as-list.patch b/debian/patches/0008_pass-categories-as-list.patch
deleted file mode 100644
index 7df0de2..0000000
--- a/debian/patches/0008_pass-categories-as-list.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Description: fix pass categories as list in test
-Author: Jonas Smedegaard <dr@jones.dk>
-Bug: https://github.com/pimutils/khal/issues/825
-Last-Update: 2018-12-13
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/tests/utils_test.py
-+++ b/tests/utils_test.py
-@@ -564,7 +564,7 @@
- event = _construct_event(data_list.split(),
- description='please describe the event',
- location='in the office',
-- categories='boring meeting',
-+ categories=['boring meeting'],
- locale=LOCALE_BERLIN)
- assert _replace_uid(event).to_ical() == vevent
-
diff --git a/debian/patches/series b/debian/patches/series
index b4fea8b..83cb8b4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,7 @@
+0000-20190325~c58fb88-fix-parse-categories-as-list.patch
0001-No-RSS-news-in-docs.patch
0003-Fix-intersphinx-mapping.patch
0004-Fix-tests-failing-due-to-timezone.patch
0005-Avoid-privacy-breach-in-sphinx-doc.patch
0006-Timezone-tests-may-fail-due-to-older-pytz-with-newer.patch
0007-Workaround-test-of-stdin-input.patch
-0008_pass-categories-as-list.patch
Reply to: