From 22de7846c61e2d4810c02def290ee2fca317522c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:06:30 +0000 Subject: [PATCH 1/5] Bump github.com/spf13/cobra from 1.8.0 to 1.8.1 Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.0 to 1.8.1. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/compare/v1.8.0...v1.8.1) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 3393eee..3db351b 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,6 @@ require ( github.com/go-sql-driver/mysql v1.8.1 github.com/joho/godotenv v1.5.1 github.com/kr/pretty v0.1.0 // indirect - github.com/spf13/cobra v1.8.0 + github.com/spf13/cobra v1.8.1 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect ) diff --git a/go.sum b/go.sum index a4df162..9f23944 100644 --- a/go.sum +++ b/go.sum @@ -6,7 +6,7 @@ github.com/aliakseiz/go-mysqldump v1.1.0 h1:d6Oags6vfY0in9thm8ik94rfMOJg29/AasL5 github.com/aliakseiz/go-mysqldump v1.1.0/go.mod h1:xZRk7AUfKO44O7nywHl3j9OleW2U8HW3ufiPWMS4kiA= github.com/axllent/semver v0.0.1 h1:QqF+KSGxgj8QZzSXAvKFqjGWE5792ksOnQhludToK8E= github.com/axllent/semver v0.0.1/go.mod h1:2xSPzvG8n9mRfdtxSvWvfTfQGWfHsMsHO1iZnKATMSc= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -25,8 +25,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= From 5318d471eb831dcf6fcc75ff12e0bdd233800f4c Mon Sep 17 00:00:00 2001 From: Florian Thoma Date: Wed, 20 Nov 2024 09:10:09 +1100 Subject: [PATCH 2/5] exclude more resampled files, including converted and focuspoint ones --- app/variables.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/variables.go b/app/variables.go index b0f52d7..9920efb 100644 --- a/app/variables.go +++ b/app/variables.go @@ -31,8 +31,8 @@ var ( // ResampledRegex regular expressions should match all common thumbnail manipulations except for // resized images as those tend to be linked from HTMLText and aren't auto-generated without a republish ResampledRegex = []*regexp.Regexp{ - // Silverstripe 4 - regexp.MustCompile(`(?i)\_\_(Fit|Fill|Scale|Resampled)([a-z0-9]+)\.(jpg|png|jpeg|tiff)$`), + // Silverstripe 4 and 5 + regexp.MustCompile(`(?i)\_\_(Crop|ExtRewrite|Fill|Fit|Focus|Pad|Quality|Resampled|Scale)([a-z0-9_]*)\.[a-z0-9]{1,4}$`), // Silverstripe 3 regexp.MustCompile(`(?i)\/\_resampled\/(Pad|CMSThumbnail|stripthumbnail|Cropped|Set|Fit|Fill|Scale|Resampled).*\.(jpg|png|jpeg|tiff)`), From 666e42e1856782c63c31ecf9a8279213ac4c1481 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Fri, 22 Nov 2024 18:09:30 +1300 Subject: [PATCH 3/5] Workaround for Silverstripe 5 thumbnails when using `--ignore-resampled` --- utils/utils.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/utils.go b/utils/utils.go index 84cb52c..6b7b3ad 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -8,6 +8,7 @@ import ( "os" "path" "path/filepath" + "strings" "github.com/axllent/ssbak/app" ) @@ -125,7 +126,8 @@ func skipResampled(filePath string) bool { } for _, r := range app.ResampledRegex { - if r.MatchString(filePath) { + // Silverstripe 5 generates thumbnails for CMS previews by default with `__FitMaxWzM1MiwyNjRd` + if !strings.Contains(filePath, "__FitMaxWzM1MiwyNjRd.") && r.MatchString(filePath) { return true } } From dec10a3107bcec46773dafcc712eb9791d342333 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Fri, 22 Nov 2024 18:10:28 +1300 Subject: [PATCH 4/5] Remove redundant function --- utils/utils.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/utils/utils.go b/utils/utils.go index 6b7b3ad..c227443 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -58,11 +58,6 @@ func CalcSize(path string) (int64, error) { return size, err } -// Convert an int64 to uint64 -func int64Touint64(val int64) uint64 { - return uint64(val) -} - // ByteToHr returns a human readable size as a string func ByteToHr(b int64) string { const unit = 1024 From 3ba2b6ac168c61397c5be5e7b9a1e8ab67389a7d Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Fri, 22 Nov 2024 18:12:54 +1300 Subject: [PATCH 5/5] 1.1.6 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4268995..6b0ebbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.6] + +- Exclude more resampled files, including converted (webp) and FocusPoint ones when using `--ignore-resampled` +- Workaround for Silverstripe 5 thumbnails when using `--ignore-resampled` +- Update Go dependencies + + ## [1.1.5] - Update go-mysqldump (adds support for dumping VIEW tables)