public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rclone] f44: Fix builds with Go 1.27
@ 2026-08-28 11:19 Mikel Olasagasti Uranga
0 siblings, 0 replies; only message in thread
From: Mikel Olasagasti Uranga @ 2026-08-28 11:19 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rclone
Branch : f44
Commit : d9188f080e6e9a4d4cac9925a41e344cf8e7e3c8
Author : Mikel Olasagasti Uranga <mikel@olasagasti.info>
Date : 2026-08-28T09:48:56+02:00
Stats : +32/-69 in 5 file(s)
URL : https://src.fedoraproject.org/rpms/rclone/c/d9188f080e6e9a4d4cac9925a41e344cf8e7e3c8?branch=f44
Log:
Fix builds with Go 1.27
---
diff --git a/0001-Fix-test-with-1.25.patch b/0001-Fix-test-with-1.25.patch
deleted file mode 100644
index 136bf05..0000000
--- a/0001-Fix-test-with-1.25.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 2096915ad6a91f193f3815deb71180d026253816 Mon Sep 17 00:00:00 2001
-From: Mikel Olasagasti Uranga <mikel@olasagasti.info>
-Date: Sat, 2 May 2026 00:20:43 +0200
-Subject: [PATCH] Fix test with 1.25
-
-Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
----
- backend/huaweidrive/huaweidrive_test.go | 18 ++++++++++++++----
- fs/mimetype.go | 1 +
- 2 files changed, 15 insertions(+), 4 deletions(-)
-
-diff --git a/backend/huaweidrive/huaweidrive_test.go b/backend/huaweidrive/huaweidrive_test.go
-index a5285f2ab..71a16c9a6 100644
---- a/backend/huaweidrive/huaweidrive_test.go
-+++ b/backend/huaweidrive/huaweidrive_test.go
-@@ -427,14 +427,24 @@ func TestMimeTypeDetection(t *testing.T) {
-
- for _, tc := range testCases {
- t.Run(tc.filename, func(t *testing.T) {
-- detected := mime.TypeByExtension(path.Ext(tc.filename))
-+ ext := path.Ext(tc.filename)
-+ raw := mime.TypeByExtension(ext)
-+ detected := raw
- if detected == "" {
- detected = "application/octet-stream"
- }
-
-- // Check if detected MIME type is in the list of expected types
-+ // Go 1.25 and earlier use a small builtin extension table; types such as .txt and .zip
-+ // come from the OS MIME DB (/usr/share/mime/globs2, /etc/mime.types). Minimal RPM
-+ // buildroots often have no mapping, so TypeByExtension returns "". That matches
-+ // huaweidrive upload logic, which keeps application/octet-stream when lookup is empty.
-+ acceptable := append([]string(nil), tc.expectedMimes...)
-+ if raw == "" && ext != "" {
-+ acceptable = append(acceptable, "application/octet-stream")
-+ }
-+
- found := false
-- for _, expected := range tc.expectedMimes {
-+ for _, expected := range acceptable {
- if detected == expected {
- found = true
- break
-@@ -442,7 +452,7 @@ func TestMimeTypeDetection(t *testing.T) {
- }
-
- if !found {
-- t.Errorf("expected one of MIME types %v for %q, got %q", tc.expectedMimes, tc.filename, detected)
-+ t.Errorf("expected one of MIME types %v for %q, got %q", acceptable, tc.filename, detected)
- }
- })
- }
-diff --git a/fs/mimetype.go b/fs/mimetype.go
-index 44d423738..7185db777 100644
---- a/fs/mimetype.go
-+++ b/fs/mimetype.go
-@@ -15,6 +15,7 @@ func init() {
- mimeType string
- extensions string
- }{
-+ {"text/plain", ".txt"},
- {"audio/flac", ".flac"},
- {"audio/mpeg", ".mpga,.mpega,.mp2,.mp3,.m4a"},
- {"audio/ogg", ".oga,.ogg,.opus,.spx"},
---
-2.54.0
-
diff --git a/0001-protondrive-fix-Go-1.27-vet-warning-in-retry-test.patch b/0001-protondrive-fix-Go-1.27-vet-warning-in-retry-test.patch
new file mode 100644
index 0000000..4edccdc
--- /dev/null
+++ b/0001-protondrive-fix-Go-1.27-vet-warning-in-retry-test.patch
@@ -0,0 +1,28 @@
+From 478a69b9a976193a0dabe50d6442c0227410a40b Mon Sep 17 00:00:00 2001
+From: Mikel Olasagasti Uranga <mikel@olasagasti.info>
+Date: Thu, 27 Aug 2026 23:28:33 +0200
+Subject: [PATCH] protondrive: fix Go 1.27 vet warning in retry test
+
+Pass the wrapped API error through the error-typed test helper so the
+%w operand satisfies Go 1.27's printf analyzer without changing test
+behavior.
+---
+ backend/protondrive/protondrive_internal_test.go | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/backend/protondrive/protondrive_internal_test.go b/backend/protondrive/protondrive_internal_test.go
+index d1ef4224d..651d848e3 100644
+--- a/backend/protondrive/protondrive_internal_test.go
++++ b/backend/protondrive/protondrive_internal_test.go
+@@ -86,7 +86,7 @@ func TestShouldRetry(t *testing.T) {
+ {"rate limit Status=429 (handled by SDK, not retried here)", ctx, apiErr(429, 0), false},
+ {"client error Status=400", ctx, apiErr(400, 0), false},
+ {"client error Status=404", ctx, apiErr(404, 0), false},
+- {"wrapped API error retried via errors.As", ctx, fmt.Errorf("wrapped: %w", &proton.APIError{Status: 500}), true},
++ {"wrapped API error retried via errors.As", ctx, fmt.Errorf("wrapped: %w", apiErr(500, 0)), true},
+ {"non-API error falls back to fserrors.ShouldRetry", ctx, errors.New("plain error"), false},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+--
+2.55.0
+
diff --git a/go-vendor-tools.toml b/go-vendor-tools.toml
index 2b9f3d6..2a4edf6 100644
--- a/go-vendor-tools.toml
+++ b/go-vendor-tools.toml
@@ -2,6 +2,8 @@
[archive.dependency_overrides]
"github.com/cronokirby/saferith" = "1f11f94"
+"github.com/rclone/gofakes3" = "v0.0.9"
+
[licensing]
detector = "askalono"
[[licensing.licenses]]
diff --git a/rclone.spec b/rclone.spec
index b3e8a8e..89305af 100644
--- a/rclone.spec
+++ b/rclone.spec
@@ -19,7 +19,7 @@ Source0: %{gosource}
# Generated by go-vendor-tools
Source1: %{archivename}-vendor.tar.bz2
Source2: go-vendor-tools.toml
-Patch: 0001-Fix-test-with-1.25.patch
+Patch: 0001-protondrive-fix-Go-1.27-vet-warning-in-retry-test.patch
BuildRequires: go-vendor-tools
diff --git a/sources b/sources
index 5862081..2df9cb6 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
SHA512 (rclone-1.75.0.tar.gz) = 094a77967bc97bf1a63e4eb4e4fe136044c345289ce66f3484b364f53f4f6382088ebe43f41b919ab4c9e8208d05781102e0991c71863f9aa9f937b767fd1fa3
-SHA512 (rclone-1.75.0-vendor.tar.bz2) = 5bf2dfe5c6187ad1aef4924e8b43cf9eeb6dda3f65d66488f32fa1d5209512a34f79ad420073e00503e7f0956a25ec895b042175809204787fd0019b341e8c16
+SHA512 (rclone-1.75.0-vendor.tar.bz2) = b6496b52133102249a4fa53658a98751c8f3438505a8d6515922418a98e2c0bde4387c5ce8fb4318ec93f7b80cad6bd66cab85a5bf358d53c34bdd01f47d079e
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-28 11:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-28 11:19 [rpms/rclone] f44: Fix builds with Go 1.27 Mikel Olasagasti Uranga
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox