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

Proposed by Andreas Hasenack
Status: Merged
Merged at revision: 54180dc29cc3dcc42b24a7828ce161aceaa013e2
Proposed branch: ~ahasenack/ubuntu/+source/rclone:rclone-fix-gdrive-download-1937136-FOCAL
Merge into: ubuntu/+source/rclone:ubuntu/focal-devel
Diff against target: 107 lines (+66/-1)
4 files modified
debian/changelog (+10/-0)
debian/control (+3/-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
git-ubuntu import Pending
Review via email: mp+417826@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 :)

For Focal, I had to fix an FTBFS as well (missing build-dep).

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 :

Same comment from the Jammy MP about the DEP-3 headers applies here. Moreover, you forgot to run the update-maintainer script to fix the Maintainer field in d/control.

Thanks for also fixing the FTBFS here. The steps in the test plan worked as expected.

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

dep-3 done, maintainer done (oops)

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 :

+1

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

Thanks, uploaded

$ dput ubuntu ../rclone_1.50.2-2ubuntu0.1_source.changes
D: Setting host argument.
Checking signature on .changes
gpg: ../rclone_1.50.2-2ubuntu0.1_source.changes: Valid signature from AC983EB5BF6BCBA9
Checking signature on .dsc
gpg: ../rclone_1.50.2-2ubuntu0.1.dsc: Valid signature from AC983EB5BF6BCBA9
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading rclone_1.50.2-2ubuntu0.1.dsc: done.
  Uploading rclone_1.50.2-2ubuntu0.1.debian.tar.xz: done.
  Uploading rclone_1.50.2-2ubuntu0.1_source.buildinfo: done.
  Uploading rclone_1.50.2-2ubuntu0.1_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 749b0e5..da1b288 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,13 @@
6+rclone (1.50.2-2ubuntu0.1) focal; 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+ * d/control: add missing build-depends for
12+ golang-github-mattn-go-colorable-dev (LP: #1966950)
13+
14+ -- Andreas Hasenack <andreas@canonical.com> Tue, 29 Mar 2022 10:28:41 -0300
15+
16 rclone (1.50.2-2) unstable; urgency=medium
17
18 * Team upload.
19diff --git a/debian/control b/debian/control
20index ddc9c0d..ae6c530 100644
21--- a/debian/control
22+++ b/debian/control
23@@ -1,7 +1,8 @@
24 Source: rclone
25 Section: net
26 Priority: optional
27-Maintainer: Debian Go Packaging Team <pkg-go-maintainers@lists.alioth.debian.org>
28+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
29+XSBC-Original-Maintainer: Debian Go Packaging Team <pkg-go-maintainers@lists.alioth.debian.org>
30 Uploaders: Dr. Tobias Quathamer <toddy@debian.org>
31 Build-Depends: bash-completion,
32 debhelper-compat (= 12),
33@@ -23,6 +24,7 @@ Build-Depends: bash-completion,
34 golang-github-jzelinskie-whirlpool-dev,
35 golang-github-koofr-go-httpclient-dev,
36 golang-github-koofr-go-koofrclient-dev,
37+ golang-github-mattn-go-colorable-dev,
38 golang-github-ncw-go-acd-dev,
39 golang-github-ncw-swift-dev (>= 1.0.47),
40 golang-github-nsf-termbox-go-dev,
41diff --git a/debian/patches/0008-fix-gdrive-download.patch b/debian/patches/0008-fix-gdrive-download.patch
42new file mode 100644
43index 0000000..8911cf9
44--- /dev/null
45+++ b/debian/patches/0008-fix-gdrive-download.patch
46@@ -0,0 +1,52 @@
47+From 94b1439299e57f84dec27e865fba2b7356f3ea79 Mon Sep 17 00:00:00 2001
48+From: Nick Craig-Wood <nick@craig-wood.com>
49+Date: Wed, 14 Jul 2021 10:23:35 +0100
50+Subject: [PATCH] drive: fix some google docs being treated as files - fixes
51+ #5455
52+
53+At some point some google docs files started having sizes returned in
54+their listing information.
55+
56+This then caused rclone to treat the docs as files which caused
57+downloads to fail.
58+
59+The API docs now state that google docs may have sizes (whereas I'm
60+pretty sure it didn't earlier).
61+
62+This fix removes the check for size, so google docs are identified
63+solely by not having an MD5 checksum.
64+---
65+ backend/drive/drive.go | 8 ++++----
66+ 1 file changed, 4 insertions(+), 4 deletions(-)
67+
68+Origin: backport, https://github.com/rclone/rclone/commit/94b1439299e57f84dec27e865fba2b7356f3ea79
69+Bug: https://github.com/rclone/rclone/issues/5455
70+Bug-Debian: https://bugs.debian.org/991124
71+Bug-Ubuntu: https://bugs.launchpad.net/rclone/+bug/1937136
72+Applied-Upstream: 1.56.0
73+Last-Update: 2022-03-28
74+
75+--- a/backend/drive/drive.go
76++++ b/backend/drive/drive.go
77+@@ -1189,8 +1189,8 @@
78+ //
79+ // When the drive.File cannot be represented as a fs.Object it will return (nil, nil).
80+ func (f *Fs) newObjectWithInfo(remote string, info *drive.File) (fs.Object, error) {
81+- // If item has MD5 sum or a length it is a file stored on drive
82+- if info.Md5Checksum != "" || info.Size > 0 {
83++ // If item has MD5 sum it is a file stored on drive
84++ if info.Md5Checksum != "" {
85+ return f.newRegularObject(remote, info), nil
86+ }
87+
88+@@ -1205,8 +1205,8 @@
89+ remote string, info *drive.File,
90+ extension, exportName, exportMimeType string, isDocument bool) (fs.Object, error) {
91+ switch {
92+- case info.Md5Checksum != "" || info.Size > 0:
93+- // If item has MD5 sum or a length it is a file stored on drive
94++ case info.Md5Checksum != "":
95++ // If item has MD5 sum it is a file stored on drive
96+ return f.newRegularObject(remote, info), nil
97+ case f.opt.SkipGdocs:
98+ fs.Debugf(remote, "Skipping google document type %q", info.MimeType)
99diff --git a/debian/patches/series b/debian/patches/series
100index 4c900cd..34e8e09 100644
101--- a/debian/patches/series
102+++ b/debian/patches/series
103@@ -4,3 +4,4 @@
104 0004-Disable-FTP-server-of-rclone.patch
105 0005-Do-not-include-installation-instructions-in-manpage.patch
106 0007-Remove-script-to-disable-possible-privacy-breach.patch
107+0008-fix-gdrive-download.patch

Subscribers

People subscribed via source and target branches