]> git.pld-linux.org Git - packages/rclone.git/commitdiff
up to 1.66.0 master auto/th/rclone-1.66.0-1
authorJan Palus <atler@pld-linux.org>
Mon, 11 Mar 2024 10:31:01 +0000 (11:31 +0100)
committerJan Palus <atler@pld-linux.org>
Mon, 11 Mar 2024 10:31:01 +0000 (11:31 +0100)
rclone.spec
webdav-modtime.patch [new file with mode: 0644]

index 09e3f7395d1c96f71bfd2690307aa4b33b25a44f..f343ac0e3b50a9a3df13a9f672f7e4e1ec779931 100644 (file)
@@ -1,20 +1,23 @@
+%define                vendor_ver      1.66.0
+
 Summary:       rsync for cloud storage
 Name:          rclone
 Summary:       rsync for cloud storage
 Name:          rclone
-Version:       1.58.0
+Version:       1.66.0
 Release:       1
 License:       MIT
 Group:         Networking/Utilities
 #Source0Download: https://github.com/rclone/rclone/releases
 Source0:       https://github.com/rclone/rclone/releases/download/v%{version}/%{name}-v%{version}.tar.gz
 Release:       1
 License:       MIT
 Group:         Networking/Utilities
 #Source0Download: https://github.com/rclone/rclone/releases
 Source0:       https://github.com/rclone/rclone/releases/download/v%{version}/%{name}-v%{version}.tar.gz
-# Source0-md5: f7e326049f0acd9c6f1ef5da4afcc681
+# Source0-md5: ae301cfeecf0675209d0acbfd8eaf05a
 # cd rclone-%{version}
 # go mod vendor
 # cd ..
 # tar cJf rclone-vendor-%{version}.tar.xz rclone-v%{version}/vendor
 # cd rclone-%{version}
 # go mod vendor
 # cd ..
 # tar cJf rclone-vendor-%{version}.tar.xz rclone-v%{version}/vendor
-Source1:       %{name}-vendor-%{version}.tar.xz
-# Source1-md5: 1cce795ce1839eca83ea493a27a1adaf
+Source1:       %{name}-vendor-%{vendor_ver}.tar.xz
+# Source1-md5: acca3f3203821e5623497bccce73de75
+Patch0:                webdav-modtime.patch
 URL:           https://rclone.org/
 URL:           https://rclone.org/
-BuildRequires: golang >= 1.14
+BuildRequires: golang >= 1.20
 BuildRequires: rpm-build >= 4.6
 BuildRequires: rpmbuild(macros) >= 2.009
 BuildRequires: tar >= 1:1.22
 BuildRequires: rpm-build >= 4.6
 BuildRequires: rpmbuild(macros) >= 2.009
 BuildRequires: tar >= 1:1.22
@@ -32,7 +35,7 @@ from different cloud storage providers.
 Summary:       bash-completion for rclone
 Group:         Applications/Shells
 Requires:      %{name} = %{version}-%{release}
 Summary:       bash-completion for rclone
 Group:         Applications/Shells
 Requires:      %{name} = %{version}-%{release}
-Requires:      bash-completion >= 2.0
+Requires:      bash-completion >= 1:2.0
 BuildArch:     noarch
 
 %description -n bash-completion-rclone
 BuildArch:     noarch
 
 %description -n bash-completion-rclone
@@ -59,7 +62,10 @@ BuildArch:   noarch
 Zsh completion for rclone command.
 
 %prep
 Zsh completion for rclone command.
 
 %prep
-%setup -q -b1 -n %{name}-v%{version}
+%setup -q -a1 -n %{name}-v%{version}
+%patch0 -p1
+
+%{__mv} %{name}-v%{vendor_ver}/vendor .
 
 %{__mkdir_p} .go-cache
 
 
 %{__mkdir_p} .go-cache
 
diff --git a/webdav-modtime.patch b/webdav-modtime.patch
new file mode 100644 (file)
index 0000000..ac61ec0
--- /dev/null
@@ -0,0 +1,136 @@
+From fb38f0278d42b1de2a2f76c59aa294276aef64a1 Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus@fastmail.com>
+Date: Mon, 15 May 2023 19:16:22 +0200
+Subject: [PATCH 1/2] webdav: fastmail: adapt modtime update
+
+to make new logic work with fastmail bring spec compliant update from:
+https://github.com/rclone/rclone/pull/6108
+---
+ backend/webdav/webdav.go | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go
+index 801e8d970..c91e4950c 100644
+--- a/backend/webdav/webdav.go
++++ b/backend/webdav/webdav.go
+@@ -178,6 +178,7 @@ type Fs struct {
+       canStream          bool          // set if can stream
+       useOCMtime         bool          // set if can use X-OC-Mtime
+       propsetMtime       bool          // set if can use propset
++      propNameMtime      string        // name of property to set for mtime
+       retryWithZeroDepth bool          // some vendors (sharepoint) won't list files when Depth is 1 (our default)
+       checkBeforePurge   bool          // enables extra check that directory to purge really exists
+       hasOCMD5           bool          // set if can use owncloud style checksums for MD5
+@@ -581,18 +582,22 @@ func (f *Fs) setQuirks(ctx context.Context, vendor string) error {
+               f.canStream = true
+               f.precision = time.Second
+               f.useOCMtime = true
++              f.propsetMtime = true
++              f.propNameMtime = "getlastmodified"
+               f.hasMESHA1 = true
+       case "owncloud":
+               f.canStream = true
+               f.precision = time.Second
+               f.useOCMtime = true
+               f.propsetMtime = true
++              f.propNameMtime = "lastmodified"
+               f.hasOCMD5 = true
+               f.hasOCSHA1 = true
+       case "nextcloud":
+               f.precision = time.Second
+               f.useOCMtime = true
+               f.propsetMtime = true
++              f.propNameMtime = "lastmodified"
+               f.hasOCSHA1 = true
+               f.canChunk = true
+@@ -1322,11 +1327,11 @@ func (o *Object) ModTime(ctx context.Context) time.Time {
+ // Set modified time using propset
+ //
+ // <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"><d:response><d:href>/ocm/remote.php/webdav/office/wir.jpg</d:href><d:propstat><d:prop><d:lastmodified/></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>
+-var owncloudPropset = `<?xml version="1.0" encoding="utf-8" ?>
++var mtimePropset = `<?xml version="1.0" encoding="utf-8" ?>
+ <D:propertyupdate xmlns:D="DAV:">
+  <D:set>
+   <D:prop>
+-   <lastmodified xmlns="DAV:">%d</lastmodified>
++   <D:%s>%s</D:%s>
+   </D:prop>
+  </D:set>
+ </D:propertyupdate>
+@@ -1335,11 +1340,17 @@ var owncloudPropset = `<?xml version="1.0" encoding="utf-8" ?>
+ // SetModTime sets the modification time of the local fs object
+ func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error {
+       if o.fs.propsetMtime {
++              var modTimeStr string
++              if o.fs.propNameMtime == "getlastmodified" {
++                      modTimeStr = modTime.Format(time.RFC1123)
++              } else {
++                      modTimeStr = strconv.FormatInt(modTime.Unix(), 10)
++              }
+               opts := rest.Opts{
+                       Method:     "PROPPATCH",
+                       Path:       o.filePath(),
+                       NoRedirect: true,
+-                      Body:       strings.NewReader(fmt.Sprintf(owncloudPropset, modTime.Unix())),
++                      Body:       strings.NewReader(fmt.Sprintf(mtimePropset, o.fs.propNameMtime, modTimeStr, o.fs.propNameMtime)),
+               }
+               var result api.Multistatus
+               var resp *http.Response
+-- 
+2.41.0
+
+From 84d2bbc2e2eb15f4ef3558aec46adf33d3b443c3 Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus@fastmail.com>
+Date: Mon, 15 May 2023 19:20:32 +0200
+Subject: [PATCH 2/2] webdav: fastmail: support for update_modtime config opt
+
+for compatibility with:
+https://github.com/rclone/rclone/pull/6108
+---
+ backend/webdav/webdav.go | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go
+index c91e4950c..a8c7ffce8 100644
+--- a/backend/webdav/webdav.go
++++ b/backend/webdav/webdav.go
+@@ -146,6 +146,14 @@ Set to 0 to disable chunked uploading.
+                       Help:     "Exclude ownCloud shares",
+                       Advanced: true,
+                       Default:  false,
++              }, {
++                      Name: "update_modtime",
++                      Help: `Adjust modification time on servers which allow DAV:getlastmodified property update.
++
++Use provider's default if unset.
++`,
++                      Default:  fs.Tristate{},
++                      Advanced: true,
+               }},
+       })
+ }
+@@ -162,6 +170,7 @@ type Options struct {
+       PacerMinSleep      fs.Duration          `config:"pacer_min_sleep"`
+       ChunkSize          fs.SizeSuffix        `config:"nextcloud_chunk_size"`
+       ExcludeShares      bool                 `config:"owncloud_exclude_shares"`
++      UpdateModTime      fs.Tristate          `config:"update_modtime"`
+ }
+ // Fs represents a remote webdav
+@@ -582,8 +591,10 @@ func (f *Fs) setQuirks(ctx context.Context, vendor string) error {
+               f.canStream = true
+               f.precision = time.Second
+               f.useOCMtime = true
+-              f.propsetMtime = true
+-              f.propNameMtime = "getlastmodified"
++              if !f.opt.UpdateModTime.Valid || f.opt.UpdateModTime.Valid && f.opt.UpdateModTime.Value {
++                      f.propsetMtime = true
++                      f.propNameMtime = "getlastmodified"
++              }
+               f.hasMESHA1 = true
+       case "owncloud":
+               f.canStream = true
+-- 
+2.41.0
+
This page took 0.197991 seconds and 4 git commands to generate.