From 324a09bb21649bddf98ff5c9847ee1361e2a2d20 Mon Sep 17 00:00:00 2001 From: Levi <57452819+l3v11@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:02:42 +0600 Subject: [PATCH] rclone: sync to v1.62.2 --- .github/workflows/build.yml | 18 +- VERSION | 2 +- backend/drive/drive.go | 14 +- backend/drive/drive_internal_test.go | 9 + bin/cross-compile.go | 10 +- bin/upload-github | 17 +- go.mod | 114 ++-- go.sum | 936 ++++----------------------- 8 files changed, 235 insertions(+), 885 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5ce054..7e4fccc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,11 +8,11 @@ name: build on: push: tags: - - '*' - pull_request: + - '**' jobs: build: + if: ${{ github.event.inputs.manual == 'true' || (github.repository == 'l3v11/gclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }} timeout-minutes: 60 strategy: fail-fast: false @@ -22,7 +22,7 @@ jobs: include: - job_name: linux os: ubuntu-latest - go: '1.19' + go: '1.20' gotags: cmount build_flags: '-include "^linux/" -exclude "^(linux/mips|linux/mipsle)"' check: false @@ -30,21 +30,21 @@ jobs: - job_name: mac_amd64 os: macos-11 - go: '1.19' + go: '1.20' gotags: 'cmount' build_flags: '-include "^darwin/amd64" -cgo' deploy: true - job_name: mac_arm64 os: macos-11 - go: '1.19' + go: '1.20' gotags: 'cmount' build_flags: '-include "^darwin/arm64" -cgo -macos-arch arm64 -cgo-cflags=-I/usr/local/include -cgo-ldflags=-L/usr/local/lib' deploy: true - job_name: windows os: windows-latest - go: '1.19' + go: '1.20' gotags: cmount cgo: '0' build_flags: '-include "^windows/"' @@ -62,7 +62,7 @@ jobs: fetch-depth: 0 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} check-latest: true @@ -82,7 +82,7 @@ jobs: sudo modprobe fuse sudo chmod 666 /dev/fuse sudo chown root:$USER /etc/fuse.conf - sudo apt-get install fuse libfuse-dev rpm pkg-config + sudo apt-get install fuse3 libfuse-dev rpm pkg-config if: matrix.os == 'ubuntu-latest' - name: Install Libraries on macOS @@ -138,4 +138,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # working-directory: '$(modulePath)' # Deploy binaries if enabled in config && not a PR && not a fork - if: matrix.deploy && github.head_ref == '' && github.repository == 'l3v11/gclone' + if: env.GITHUB_TOKEN != '' && matrix.deploy && github.head_ref == '' && github.repository == 'l3v11/gclone' diff --git a/VERSION b/VERSION index c37e3b9..1ba6c01 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.61.1 +v1.62.2 diff --git a/backend/drive/drive.go b/backend/drive/drive.go index fa5a6a3..a78639a 100644 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -456,7 +456,11 @@ If downloading a file returns the error "This file has been identified as malware or spam and cannot be downloaded" with the error code "cannotDownloadAbusiveFile" then supply this flag to rclone to indicate you acknowledge the risks of downloading the file and rclone -will download it anyway.`, +will download it anyway. + +Note that if you are using service account it will need Manager +permission (not Content Manager) to for this flag to work. If the SA +does not have the right permission, Google will just ignore the flag.`, Advanced: true, }, { Name: "keep_revision_forever", @@ -778,7 +782,7 @@ func (f *Fs) shouldRetry(ctx context.Context, err error) (bool, error) { } else if f.opt.StopOnDownloadLimit && reason == "downloadQuotaExceeded" { fs.Errorf(f, "Received download limit error: %v", err) return false, fserrors.FatalError(err) - } else if f.opt.StopOnUploadLimit && reason == "quotaExceeded" { + } else if f.opt.StopOnUploadLimit && (reason == "quotaExceeded" || reason == "storageQuotaExceeded") { fs.Errorf(f, "Received upload limit error: %v", err) return false, fserrors.FatalError(err) } else if f.opt.StopOnUploadLimit && reason == "teamDriveFileLimitExceeded" { @@ -3463,9 +3467,9 @@ This takes an optional directory to trash which make this easier to use via the API. rclone backend untrash drive:directory - rclone backend -i untrash drive:directory subdir + rclone backend --interactive untrash drive:directory subdir -Use the -i flag to see what would be restored before restoring it. +Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it. Result: @@ -3495,7 +3499,7 @@ component will be used as the file name. If the destination is a drive backend then server-side copying will be attempted if possible. -Use the -i flag to see what would be copied before copying. +Use the --interactive/-i or --dry-run flag to see what would be copied before copying. `, }, { Name: "exportformats", diff --git a/backend/drive/drive_internal_test.go b/backend/drive/drive_internal_test.go index 58bdb13..c2e6da0 100644 --- a/backend/drive/drive_internal_test.go +++ b/backend/drive/drive_internal_test.go @@ -243,6 +243,15 @@ func (f *Fs) InternalTestShouldRetry(t *testing.T) { quotaExceededRetry, quotaExceededError := f.shouldRetry(ctx, &generic403) assert.False(t, quotaExceededRetry) assert.Equal(t, quotaExceededError, expectedQuotaError) + + sqEItem := googleapi.ErrorItem{ + Reason: "storageQuotaExceeded", + } + generic403.Errors[0] = sqEItem + expectedStorageQuotaError := fserrors.FatalError(&generic403) + storageQuotaExceededRetry, storageQuotaExceededError := f.shouldRetry(ctx, &generic403) + assert.False(t, storageQuotaExceededRetry) + assert.Equal(t, storageQuotaExceededError, expectedStorageQuotaError) } func (f *Fs) InternalTestDocumentImport(t *testing.T) { diff --git a/bin/cross-compile.go b/bin/cross-compile.go index 9b30efa..21a4b27 100644 --- a/bin/cross-compile.go +++ b/bin/cross-compile.go @@ -57,6 +57,7 @@ var osarches = []string{ "linux/386", "linux/amd64", "linux/arm", + "linux/arm-v6", "linux/arm-v7", "linux/arm64", "linux/mips", @@ -64,10 +65,12 @@ var osarches = []string{ "freebsd/386", "freebsd/amd64", "freebsd/arm", + "freebsd/arm-v6", "freebsd/arm-v7", "netbsd/386", "netbsd/amd64", "netbsd/arm", + "netbsd/arm-v6", "netbsd/arm-v7", "openbsd/386", "openbsd/amd64", @@ -82,13 +85,16 @@ var archFlags = map[string][]string{ "386": {"GO386=softfloat"}, "mips": {"GOMIPS=softfloat"}, "mipsle": {"GOMIPS=softfloat"}, + "arm": {"GOARM=5"}, + "arm-v6": {"GOARM=6"}, "arm-v7": {"GOARM=7"}, } // Map Go architectures to NFPM architectures // Any missing are passed straight through var goarchToNfpm = map[string]string{ - "arm": "arm6", + "arm": "arm5", + "arm-v6": "arm6", "arm-v7": "arm7", } @@ -219,7 +225,7 @@ func buildWindowsResourceSyso(goarch string, versionTag string) string { "StringFileInfo": M{ "CompanyName": "https://rclone.org", "ProductName": "Rclone", - "FileDescription": "Rsync for cloud storage", + "FileDescription": "Rclone", "InternalName": "rclone", "OriginalFilename": "rclone.exe", "LegalCopyright": "The Rclone Authors", diff --git a/bin/upload-github b/bin/upload-github index 0ce645c..bd7af03 100755 --- a/bin/upload-github +++ b/bin/upload-github @@ -14,7 +14,6 @@ if [ "$1" == "" ]; then fi VERSION="$1" -function create_release() { cat > "/tmp/${VERSION}-release-notes" <