[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#884111: stretch-pu: package vdirsyncer/0.14.1-1



Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian.org@packages.debian.org
Usertags: pu

Hello,

I would like to upload vdirsyncer 0.14.1-2 containing fix for bug #883299
[1][2][3]. This fixes critical issue that's making vdirsyncer 0.14.1 unusable for
some users as it's unable to sync Google contacts.

Attaching debdiff.

Thank you,
Filip

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=883299
[2] https://github.com/pimutils/vdirsyncer/issues/551
[3] https://github.com/pimutils/vdirsyncer/pull/564

-- System Information:
Debian Release: 9.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (100, 'unstable'), (50, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.13.0-0.bpo.1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=cs_CZ.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru vdirsyncer-0.14.1/debian/changelog vdirsyncer-0.14.1/debian/changelog
--- vdirsyncer-0.14.1/debian/changelog	2017-03-27 09:41:21.000000000 +0200
+++ vdirsyncer-0.14.1/debian/changelog	2017-12-11 15:12:09.000000000 +0100
@@ -1,3 +1,9 @@
+vdirsyncer (0.14.1-2) stretch; urgency=medium
+
+  * Backport fix for discovering Google contacts (Closes: #883299)
+
+ -- Filip Pytloun <filip@pytloun.cz>  Mon, 11 Dec 2017 15:12:09 +0100
+
 vdirsyncer (0.14.1-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru vdirsyncer-0.14.1/debian/patches/0005-Work-around-Google-Contacts-discovery-bug-564.patch vdirsyncer-0.14.1/debian/patches/0005-Work-around-Google-Contacts-discovery-bug-564.patch
--- vdirsyncer-0.14.1/debian/patches/0005-Work-around-Google-Contacts-discovery-bug-564.patch	1970-01-01 01:00:00.000000000 +0100
+++ vdirsyncer-0.14.1/debian/patches/0005-Work-around-Google-Contacts-discovery-bug-564.patch	2017-12-11 15:11:33.000000000 +0100
@@ -0,0 +1,71 @@
+From ac662b5c11223157e8a0df8988a1af63a0a4ce82 Mon Sep 17 00:00:00 2001
+From: Markus Unterwaditzer <markus@unterwaditzer.net>
+Date: Mon, 27 Feb 2017 16:06:28 +0100
+Subject: [PATCH] Work around Google Contacts discovery bug (#564)
+
+* Work around Google Contacts discovery bug
+
+* fixup
+
+* changelog
+---
+ vdirsyncer/storage/dav.py    | 20 ++++++++++++++++++--
+ vdirsyncer/storage/google.py |  4 ++++
+ 2 files changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/vdirsyncer/storage/dav.py b/vdirsyncer/storage/dav.py
+index 905c8d0..ed6dd61 100644
+--- a/vdirsyncer/storage/dav.py
++++ b/vdirsyncer/storage/dav.py
+@@ -201,6 +201,23 @@ class Discover(object):
+         dav_logger.debug('Given URL is not a homeset URL')
+         return self._find_collections_impl(self.find_home())
+ 
++    def _check_collection_resource_type(self, response):
++        if self._resourcetype is None:
++            return True
++
++        props = _merge_xml(response.findall(
++            '{DAV:}propstat/{DAV:}prop'
++        ))
++        if not props:
++            dav_logger.debug('Skipping, missing <prop>: %s', response)
++            return False
++        if props.find('{DAV:}resourcetype/' + self._resourcetype) \
++           is None:
++            dav_logger.debug('Skipping, not of resource type %s: %s',
++                             self._resourcetype, response)
++            return False
++        return True
++
+     def _find_collections_impl(self, url):
+         headers = self.session.get_default_headers()
+         headers['Depth'] = '1'
+@@ -209,8 +226,7 @@ class Discover(object):
+         root = _parse_xml(r.content)
+         done = set()
+         for response in root.findall('{DAV:}response'):
+-            props = _merge_xml(response.findall('{DAV:}propstat/{DAV:}prop'))
+-            if props.find('{DAV:}resourcetype/' + self._resourcetype) is None:
++            if not self._check_collection_resource_type(response):
+                 continue
+ 
+             href = response.find('{DAV:}href')
+diff --git a/vdirsyncer/storage/google.py b/vdirsyncer/storage/google.py
+index d6520cc..0dc1173 100644
+--- a/vdirsyncer/storage/google.py
++++ b/vdirsyncer/storage/google.py
+@@ -157,6 +157,10 @@ class GoogleContactsStorage(dav.CardDAVStorage):
+         url = 'https://www.googleapis.com/.well-known/carddav'
+         scope = ['https://www.googleapis.com/auth/carddav']
+ 
++    class discovery_class(dav.CardDAVStorage.discovery_class):
++        # Google CardDAV doesn't return any resourcetype prop.
++        _resourcetype = None
++
+     storage_name = 'google_contacts'
+ 
+     def __init__(self, token_file, client_id, client_secret, **kwargs):
+-- 
+2.14.2
+
diff -Nru vdirsyncer-0.14.1/debian/patches/series vdirsyncer-0.14.1/debian/patches/series
--- vdirsyncer-0.14.1/debian/patches/series	2017-03-27 09:41:21.000000000 +0200
+++ vdirsyncer-0.14.1/debian/patches/series	2017-12-11 15:11:59.000000000 +0100
@@ -2,3 +2,4 @@
 0002-Include-license-from-copyright-file.patch
 0003-Skip-SSL-tests.patch
 0004-Suppress-HealthCheck.too_slow-to-fix-build-on-slow-p.patch
+0005-Work-around-Google-Contacts-discovery-bug-564.patch

Attachment: signature.asc
Description: PGP signature


Reply to: