Merge ~ahasenack/ubuntu/+source/rclone:rclone-fix-gdrive-download-1937136-JAMMY into ubuntu/+source/rclone:ubuntu/devel

Proposed by Andreas Hasenack
Status: Merged
Merged at revision: 8aa3e5a26d357c113f3365c41ac0895e3ac22b45
Proposed branch: ~ahasenack/ubuntu/+source/rclone:rclone-fix-gdrive-download-1937136-JAMMY
Merge into: ubuntu/+source/rclone:ubuntu/devel
Diff against target: 100 lines (+63/-1)
4 files modified
debian/changelog (+8/-0)
debian/control (+2/-1)
debian/patches/0008-fix-gdrive-download.patch (+52/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Lucas Kanashiro (community) Approve
Canonical Server Pending
Review via email: mp+417824@code.launchpad.net

Description of the change

This fixes downloading certain files from google drive. The linked SRU bug has testing details. Setting this up, with the required API keys, is a bit less than a nightmare in my opinion, other clouds were much easier, but hey :)

PPA: https://launchpad.net/~ahasenack/+archive/ubuntu/rclone-gdrive-download-1937136/

To post a comment you must log in.
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the MP Andreas. I have a small comment:

- Add the following Debian bug as a DEP-3 header: https://bugs.debian.org/991124
  + Maybe comment in there saying we are applying this patch to fix the issue.

I did run the test plan and it indeed fixed the issue, good work. The SRU bug description also looks really good.

review: Needs Fixing
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Good point, done. I'll add the comment to the debian bug once this is merged, in which case I can give a stable link to the patch in our git tree, and even submit it to salsa.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I went ahead and created a salsa PR[1] for this, and added a comment in the debian bug pointing to it.

1. https://salsa.debian.org/go-team/packages/rclone/-/merge_requests/4

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Awesome, thanks!

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Thanks, uploaded

$ dput ubuntu ../rclone_1.53.3-4ubuntu1_source.changes
D: Setting host argument.
Checking signature on .changes
gpg: ../rclone_1.53.3-4ubuntu1_source.changes: Valid signature from AC983EB5BF6BCBA9
Checking signature on .dsc
gpg: ../rclone_1.53.3-4ubuntu1.dsc: Valid signature from AC983EB5BF6BCBA9
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading rclone_1.53.3-4ubuntu1.dsc: done.
  Uploading rclone_1.53.3-4ubuntu1.debian.tar.xz: done.
  Uploading rclone_1.53.3-4ubuntu1_source.buildinfo: done.
  Uploading rclone_1.53.3-4ubuntu1_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 5731d80..7c2ec38 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+rclone (1.53.3-4ubuntu1) jammy; urgency=medium
7+
8+ * d/p/0008-fix-gdrive-download.patch: remove check for size, so google
9+ docs are identified solely by not having an MD5 checksum
10+ (LP: #1937136)
11+
12+ -- Andreas Hasenack <andreas@canonical.com> Mon, 28 Mar 2022 18:45:23 -0300
13+
14 rclone (1.53.3-4) unstable; urgency=medium
15
16 * Team upload.
17diff --git a/debian/control b/debian/control
18index 629436a..9c6c681 100644
19--- a/debian/control
20+++ b/debian/control
21@@ -1,7 +1,8 @@
22 Source: rclone
23 Section: net
24 Priority: optional
25-Maintainer: Debian Go Packaging Team <team+pkg-go@tracker.debian.org>
26+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
27+XSBC-Original-Maintainer: Debian Go Packaging Team <team+pkg-go@tracker.debian.org>
28 Uploaders: Dr. Tobias Quathamer <toddy@debian.org>
29 Build-Depends: debhelper-compat (= 13),
30 dh-sequence-bash-completion,
31diff --git a/debian/patches/0008-fix-gdrive-download.patch b/debian/patches/0008-fix-gdrive-download.patch
32new file mode 100644
33index 0000000..587a5fd
34--- /dev/null
35+++ b/debian/patches/0008-fix-gdrive-download.patch
36@@ -0,0 +1,52 @@
37+From 94b1439299e57f84dec27e865fba2b7356f3ea79 Mon Sep 17 00:00:00 2001
38+From: Nick Craig-Wood <nick@craig-wood.com>
39+Date: Wed, 14 Jul 2021 10:23:35 +0100
40+Subject: [PATCH] drive: fix some google docs being treated as files - fixes
41+ #5455
42+
43+At some point some google docs files started having sizes returned in
44+their listing information.
45+
46+This then caused rclone to treat the docs as files which caused
47+downloads to fail.
48+
49+The API docs now state that google docs may have sizes (whereas I'm
50+pretty sure it didn't earlier).
51+
52+This fix removes the check for size, so google docs are identified
53+solely by not having an MD5 checksum.
54+---
55+ backend/drive/drive.go | 8 ++++----
56+ 1 file changed, 4 insertions(+), 4 deletions(-)
57+
58+Origin: upstream, https://github.com/rclone/rclone/commit/94b1439299e57f84dec27e865fba2b7356f3ea79
59+Bug: https://github.com/rclone/rclone/issues/5455
60+Bug-Debian: https://bugs.debian.org/991124
61+Bug-Ubuntu: https://bugs.launchpad.net/rclone/+bug/1937136
62+Applied-Upstream: 1.56.0
63+Last-Update: 2022-03-28
64+
65+--- a/backend/drive/drive.go
66++++ b/backend/drive/drive.go
67+@@ -1295,8 +1295,8 @@
68+ //
69+ // When the drive.File cannot be represented as an fs.Object it will return (nil, nil).
70+ func (f *Fs) newObjectWithInfo(remote string, info *drive.File) (fs.Object, error) {
71+- // If item has MD5 sum or a length it is a file stored on drive
72+- if info.Md5Checksum != "" || info.Size > 0 {
73++ // If item has MD5 sum it is a file stored on drive
74++ if info.Md5Checksum != "" {
75+ return f.newRegularObject(remote, info), nil
76+ }
77+
78+@@ -1329,8 +1329,8 @@
79+ // Pretend a dangling shortcut is a regular object
80+ // It will error if used, but appear in listings so it can be deleted
81+ return f.newRegularObject(remote, info), nil
82+- case info.Md5Checksum != "" || info.Size > 0:
83+- // If item has MD5 sum or a length it is a file stored on drive
84++ case info.Md5Checksum != "":
85++ // If item has MD5 sum it is a file stored on drive
86+ return f.newRegularObject(remote, info), nil
87+ case f.opt.SkipGdocs:
88+ fs.Debugf(remote, "Skipping google document type %q", info.MimeType)
89diff --git a/debian/patches/series b/debian/patches/series
90index fc2bd4f..321935b 100644
91--- a/debian/patches/series
92+++ b/debian/patches/series
93@@ -4,6 +4,7 @@
94 0004-Disable-FTP-server-of-rclone.patch
95 0005-Do-not-include-installation-instructions-in-manpage.patch
96 0007-Remove-script-to-disable-possible-privacy-breach.patch
97+0008-fix-gdrive-download.patch
98 ignore_tardigrade_backend.patch
99 skip_TestParseDuration.patch
100 skip_sftp_webdav_TestIntegration.patch

Subscribers

People subscribed via source and target branches