Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rclone for openSUSE:Factory checked in at 2023-07-08 22:46:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rclone (Old) and /work/SRC/openSUSE:Factory/.rclone.new.23466 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rclone" Sat Jul 8 22:46:50 2023 rev:41 rq:1097524 version:1.63.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rclone/rclone.changes 2023-07-06 18:30:12.279698649 +0200 +++ /work/SRC/openSUSE:Factory/.rclone.new.23466/rclone.changes 2023-07-08 22:46:52.195024796 +0200 @@ -1,0 +2,22 @@ +Fri Jul 7 02:49:40 UTC 2023 - Marcus Rueckert <mrueck...@suse.de> + +- Avoid duplication in the %build section for the pie ppc64 case. + Just use line continuation for the build cmdline and %ifnarch + ppc64 to enable pie mode on everything but ppc64 + +------------------------------------------------------------------- +Fri Jul 7 02:48:21 UTC 2023 - Marcus Rueckert <mrueck...@suse.de> + +- Fix the rclone version update by properly setting the package + variable during the build + +------------------------------------------------------------------- +Fri Jul 7 02:29:50 UTC 2023 - Marcus Rueckert <mrueck...@suse.de> + +- added fix-nextcloud-chunked.patch: + The patch is a slightly modified version of + 73d1b72bd759f838ad322b42e75111652eafe02e, which should give the + user more guidance to check the configuration. + This should fix https://github.com/rclone/rclone/issues/7103 + +------------------------------------------------------------------- New: ---- fix-nextcloud-chunked.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rclone.spec ++++++ --- /var/tmp/diff_new_pack.0b9eT1/_old 2023-07-08 22:46:53.083030133 +0200 +++ /var/tmp/diff_new_pack.0b9eT1/_new 2023-07-08 22:46:53.087030157 +0200 @@ -26,6 +26,7 @@ URL: https://rclone.org/ Source: %{name}-%{version}.tar.xz Source1: vendor.tar.xz +Patch1: fix-nextcloud-chunked.patch BuildRequires: fdupes BuildRequires: go >= 1.20 BuildRequires: golang-packaging @@ -65,17 +66,21 @@ %prep %setup -q %setup -q -D -T -a 1 +%autopatch -p1 %build %if 0%{?sle_version} >= 150500 && 0%{?sle_version} < 160000 && 0%{?is_opensuse} export CC="gcc-11" %endif -%ifarch ppc64 -# pie not supported -go build -o %{name} -mod=vendor -%else -go build -o %{name} -mod=vendor -buildmode=pie +# pie not supported on ppc64 +go build -o %{name} \ +%ifnarch ppc64 + -buildmode=pie \ %endif + -mod=vendor \ + --ldflags '-X github.com/rclone/rclone/fs.Version=v%{version}' + +./%{name} version ./%{name} genautocomplete bash completion.bash ./%{name} genautocomplete zsh completion.zsh ++++++ fix-nextcloud-chunked.patch ++++++ commit 73d1b72bd759f838ad322b42e75111652eafe02e Author: Paul <devnoname...@gmail.com> Date: Sun Jul 2 16:50:52 2023 +0200 webdav: nextcloud: fix must use /dav/files/USER endpoint not /webdav error Fix https://github.com/rclone/rclone/issues/7103 Before this change the RegExp validating the endpoint URL was a bit too strict allowing only /dav/files/USER due to chunking limitations. This patch adds back support for /dav/files/USER/dir/subdir etc. Co-authored-by: Nick Craig-Wood <n...@craig-wood.com> diff --git a/backend/webdav/chunking.go b/backend/webdav/chunking.go index 36daab450..4660e9493 100644 --- a/backend/webdav/chunking.go +++ b/backend/webdav/chunking.go @@ -14,7 +14,6 @@ import ( "io" "net/http" "path" - "strings" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/lib/readers" @@ -41,10 +40,6 @@ func (f *Fs) setUploadChunkSize(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) return } -func (f *Fs) getChunksUploadURL() string { - return strings.Replace(f.endpointURL, "/dav/files/", "/dav/uploads/", 1) -} - func (o *Object) getChunksUploadDir() (string, error) { hasher := md5.New() _, err := hasher.Write([]byte(o.filePath())) @@ -55,12 +50,16 @@ func (o *Object) getChunksUploadDir() (string, error) { return uploadDir, nil } -func (f *Fs) verifyChunkConfig() error { - if f.opt.ChunkSize != 0 && !validateNextCloudChunkedURL.MatchString(f.endpointURL) { - return errors.New("chunked upload with nextcloud must use /dav/files/USER endpoint not /webdav") +func (f *Fs) getChunksUploadURL() (string, error) { + submatch := nextCloudURLRegex.FindStringSubmatch(f.endpointURL) + if submatch == nil { + return "", errors.New("the remote url looks incorrect. Note that nextcloud chunked uploads require you to use the /dav/files/USERNAME endpoint instead of /webdav. Please check 'rclone config show remotename' to verify that the url field ends in /dav/files/USERNAME") } - return nil + baseURL, user := submatch[1], submatch[2] + chunksUploadURL := fmt.Sprintf("%s/dav/uploads/%s/", baseURL, user) + + return chunksUploadURL, nil } func (o *Object) shouldUseChunkedUpload(src fs.ObjectInfo) bool { diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go index 397cd0b92..ed562bb98 100644 --- a/backend/webdav/webdav.go +++ b/backend/webdav/webdav.go @@ -569,7 +569,8 @@ func (f *Fs) fetchAndSetBearerToken() error { return nil } -var validateNextCloudChunkedURL = regexp.MustCompile(`^.*/dav/files/[^/]+/?$`) +// The WebDAV url can optionally be suffixed with a path. This suffix needs to be ignored for determining the temporary upload directory of chunks. +var nextCloudURLRegex = regexp.MustCompile(`^(.*)/dav/files/([^/]+)`) // setQuirks adjusts the Fs for the vendor passed in func (f *Fs) setQuirks(ctx context.Context, vendor string) error { @@ -592,11 +593,18 @@ func (f *Fs) setQuirks(ctx context.Context, vendor string) error { f.propsetMtime = true f.hasOCSHA1 = true f.canChunk = true - if err := f.verifyChunkConfig(); err != nil { - return err + + if f.opt.ChunkSize == 0 { + fs.Logf(nil, "Chunked uploads are disabled because nextcloud_chunk_size is set to 0") + } else { + chunksUploadURL, err := f.getChunksUploadURL() + if err != nil { + return err + } + + f.chunksUploadURL = chunksUploadURL + fs.Logf(nil, "Chunks temporary upload directory: %s", f.chunksUploadURL) } - f.chunksUploadURL = f.getChunksUploadURL() - fs.Logf(nil, "Chunks temporary upload directory: %s", f.chunksUploadURL) case "sharepoint": // To mount sharepoint, two Cookies are required // They have to be set instead of BasicAuth