From f6ec0514ff9d716cdea8052e95d55fe7b60f9833 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 13 May 2021 17:42:29 +0200 Subject: [PATCH] Use forked renameio package --- database/storage/fstree/fstree.go | 3 +-- go.mod | 5 ----- go.sum | 2 -- updater/fetch.go | 3 +-- utils/atomic.go | 6 +----- 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/database/storage/fstree/fstree.go b/database/storage/fstree/fstree.go index 0cf72d3..9cc755a 100644 --- a/database/storage/fstree/fstree.go +++ b/database/storage/fstree/fstree.go @@ -19,8 +19,7 @@ import ( "github.com/safing/portbase/database/query" "github.com/safing/portbase/database/record" "github.com/safing/portbase/database/storage" - - "github.com/google/renameio" + "github.com/safing/portbase/utils/renameio" ) const ( diff --git a/go.mod b/go.mod index d0e4927..8f5d3da 100644 --- a/go.mod +++ b/go.mod @@ -38,8 +38,3 @@ require ( google.golang.org/protobuf v1.25.0 // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect ) - -// The follow-up commit removes Windows support. -// TODO: Check how we want to handle this in the future, possibly ingest -// needed functionality into here. -require github.com/google/renameio v0.1.1-0.20200217212219-353f81969824 diff --git a/go.sum b/go.sum index 318e754..91dfaf8 100644 --- a/go.sum +++ b/go.sum @@ -110,8 +110,6 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/renameio v0.1.1-0.20200217212219-353f81969824 h1:9q700G0beHecUuiZOuKgNqNsGQixTeDLnzVZ5nsW3lc= -github.com/google/renameio v0.1.1-0.20200217212219-353f81969824/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= diff --git a/updater/fetch.go b/updater/fetch.go index b4341ea..85465f2 100644 --- a/updater/fetch.go +++ b/updater/fetch.go @@ -12,9 +12,8 @@ import ( "path/filepath" "time" - "github.com/google/renameio" - "github.com/safing/portbase/log" + "github.com/safing/portbase/utils/renameio" ) func (reg *ResourceRegistry) fetchFile(ctx context.Context, client *http.Client, rv *ResourceVersion, tries int) error { diff --git a/utils/atomic.go b/utils/atomic.go index d3d8287..cd1224d 100644 --- a/utils/atomic.go +++ b/utils/atomic.go @@ -5,11 +5,7 @@ import ( "io" "os" - // Version is fixed to commit 353f8196982447d8b12c64f69530e657331e3dbc. - // The follow-up commit removes Windows support. - // TOOD: Check how we want to handle this in the future, possibly ingest - // needed functionality into here. - "github.com/google/renameio" + "github.com/safing/portbase/utils/renameio" ) // AtomicFileOptions holds additional options for manipulating