Skip to content

Commit

Permalink
build: update dependencies
Browse files Browse the repository at this point in the history
This fixes the azureblob backend so it builds again after the SDK
changes.

This doesn't update bazil.org/fuse because it doesn't build on FreeBSD

bazil/fuse#295
  • Loading branch information
ncw committed Mar 10, 2023
1 parent dd6e229 commit 15e3c48
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 99 deletions.
41 changes: 20 additions & 21 deletions backend/azureblob/azureblob.go
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ func (o *Object) updateMetadataWithModTime(modTime time.Time) {
}

// Returns whether file is a directory marker or not
func isDirectoryMarker(size int64, metadata map[string]string, remote string) bool {
func isDirectoryMarker(size int64, metadata map[string]*string, remote string) bool {
// Directory markers are 0 length
if size == 0 {
endsWithSlash := strings.HasSuffix(remote, "/")
Expand All @@ -964,7 +964,7 @@ func isDirectoryMarker(size int64, metadata map[string]string, remote string) bo
// defacto standard for marking blobs as directories.
// Note also that the metadata hasn't been normalised to lower case yet
for k, v := range metadata {
if strings.EqualFold(k, "hdi_isfolder") && v == "true" {
if v != nil && strings.EqualFold(k, "hdi_isfolder") && *v == "true" {
return true
}
}
Expand Down Expand Up @@ -1552,12 +1552,15 @@ func (o *Object) Size() int64 {
return o.size
}

func (o *Object) setMetadata(metadata map[string]string) {
// Set o.metadata from metadata
func (o *Object) setMetadata(metadata map[string]*string) {
if len(metadata) > 0 {
// Lower case the metadata
o.meta = make(map[string]string, len(metadata))
for k, v := range metadata {
o.meta[strings.ToLower(k)] = v
if v != nil {
o.meta[strings.ToLower(k)] = *v
}
}
// Set o.modTime from metadata if it exists and
// UseServerModTime isn't in use.
Expand All @@ -1573,20 +1576,16 @@ func (o *Object) setMetadata(metadata map[string]string) {
}
}

// Duplicte of setMetadata but taking pointers to strings
func (o *Object) setMetadataP(metadata map[string]*string) {
if len(metadata) > 0 {
// Convert the format of the metadata
newMeta := make(map[string]string, len(metadata))
for k, v := range metadata {
if v != nil {
newMeta[k] = *v
}
}
o.setMetadata(newMeta)
} else {
o.meta = nil
// Get metadata from o.meta
func (o *Object) getMetadata() (metadata map[string]*string) {
if len(o.meta) == 0 {
return nil
}
metadata = make(map[string]*string, len(o.meta))
for k, v := range o.meta {
metadata[k] = &v
}
return metadata
}

// decodeMetaDataFromPropertiesResponse sets the metadata from the data passed in
Expand Down Expand Up @@ -1718,7 +1717,7 @@ func (o *Object) decodeMetaDataFromBlob(info *container.BlobItem) (err error) {
} else {
o.accessTier = *info.Properties.AccessTier
}
o.setMetadataP(metadata)
o.setMetadata(metadata)

return nil
}
Expand Down Expand Up @@ -1800,7 +1799,7 @@ func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error {
blb := o.getBlobSVC()
opt := blob.SetMetadataOptions{}
err := o.fs.pacer.Call(func() (bool, error) {
_, err := blb.SetMetadata(ctx, o.meta, &opt)
_, err := blb.SetMetadata(ctx, o.getMetadata(), &opt)
return o.fs.shouldRetry(ctx, err)
})
if err != nil {
Expand Down Expand Up @@ -2096,7 +2095,7 @@ func (o *Object) uploadMultipart(ctx context.Context, in io.Reader, size int64,

tier := blob.AccessTier(o.fs.opt.AccessTier)
options := blockblob.CommitBlockListOptions{
Metadata: o.meta,
Metadata: o.getMetadata(),
Tier: &tier,
HTTPHeaders: httpHeaders,
}
Expand Down Expand Up @@ -2143,7 +2142,7 @@ func (o *Object) uploadSinglepart(ctx context.Context, in io.Reader, size int64,

tier := blob.AccessTier(o.fs.opt.AccessTier)
options := blockblob.UploadOptions{
Metadata: o.meta,
Metadata: o.getMetadata(),
Tier: &tier,
HTTPHeaders: httpHeaders,
}
Expand Down
50 changes: 25 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ require (
bazil.org/fuse v0.0.0-20221209211307-2abb8038c751
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
github.com/Max-Sum/base32768 v0.0.0-20191205131208-7937843c71d5
github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd
github.com/Unknwon/goconfig v1.0.0
github.com/a8m/tree v0.0.0-20230208161321-36ae24ddad15
github.com/aalpar/deheap v0.0.0-20210914013432-0cc84d79dec3
Expand All @@ -17,72 +17,72 @@ require (
github.com/anacrolix/log v0.13.1
github.com/artyom/mtab v1.0.0
github.com/atotto/clipboard v0.1.4
github.com/aws/aws-sdk-go v1.44.178
github.com/aws/aws-sdk-go v1.44.218
github.com/buengese/sgzip v0.1.1
github.com/colinmarc/hdfs/v2 v2.3.0
github.com/coreos/go-semver v0.3.0
github.com/coreos/go-semver v0.3.1
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/dop251/scsu v0.0.0-20220106150536-84ac88021d00
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5
github.com/gabriel-vasile/mimetype v1.4.1
github.com/gabriel-vasile/mimetype v1.4.2
github.com/gdamore/tcell/v2 v2.6.0
github.com/go-chi/chi/v5 v5.0.8
github.com/google/uuid v1.3.0
github.com/hanwen/go-fuse/v2 v2.2.0
github.com/hirochachacha/go-smb2 v1.1.0
github.com/iguanesolutions/go-systemd/v5 v5.1.1
github.com/jcmturner/gokrb5/v8 v8.4.3
github.com/jcmturner/gokrb5/v8 v8.4.4
github.com/jlaffaye/ftp v0.1.1-0.20230214004652-d84bf4be2b6e
github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004
github.com/klauspost/compress v1.15.14
github.com/koofr/go-httpclient v0.0.0-20221124135700-2eb26cff5dd8
github.com/klauspost/compress v1.16.0
github.com/koofr/go-httpclient v0.0.0-20230225102643-5d51a2e9dea6
github.com/koofr/go-koofrclient v0.0.0-20221207135200-cbd7fc9ad6a6
github.com/mattn/go-colorable v0.1.13
github.com/mattn/go-runewidth v0.0.14
github.com/mitchellh/go-homedir v1.1.0
github.com/ncw/go-acd v0.0.0-20201019170801-fe55f33415b1
github.com/ncw/swift/v2 v2.0.1
github.com/oracle/oci-go-sdk/v65 v65.30.0
github.com/oracle/oci-go-sdk/v65 v65.32.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/sftp v1.13.6-0.20230213180117-971c283182b6
github.com/pmezard/go-difflib v1.0.0
github.com/prometheus/client_golang v1.14.0
github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8
github.com/rfjakob/eme v1.1.2
github.com/rivo/uniseg v0.4.3
github.com/shirou/gopsutil/v3 v3.22.12
github.com/rivo/uniseg v0.4.4
github.com/shirou/gopsutil/v3 v3.23.2
github.com/sirupsen/logrus v1.9.0
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.2
github.com/t3rm1n4l/go-mega v0.0.0-20230228171823-a01a2cda13ca
github.com/winfsp/cgofuse v1.5.1-0.20221118130120-84c0898ad2e0
github.com/xanzy/ssh-agent v0.3.3
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a
github.com/yunify/qingstor-sdk-go/v3 v3.2.0
go.etcd.io/bbolt v1.3.6
go.etcd.io/bbolt v1.3.7
goftp.io/server v0.4.2-0.20210615155358-d07a820aac35
golang.org/x/crypto v0.6.0
golang.org/x/net v0.7.0
golang.org/x/oauth2 v0.4.0
golang.org/x/crypto v0.7.0
golang.org/x/net v0.8.0
golang.org/x/oauth2 v0.6.0
golang.org/x/sync v0.1.0
golang.org/x/sys v0.6.0
golang.org/x/text v0.7.0
golang.org/x/text v0.8.0
golang.org/x/time v0.3.0
google.golang.org/api v0.106.0
google.golang.org/api v0.112.0
gopkg.in/yaml.v2 v2.4.0
storj.io/uplink v1.10.0
)

require (
cloud.google.com/go/compute v1.14.0 // indirect
cloud.google.com/go/compute v1.18.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/calebcase/tmpfile v1.0.3 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudflare/circl v1.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -92,7 +92,7 @@ require (
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
Expand Down Expand Up @@ -129,8 +129,8 @@ require (
github.com/zeebo/errs v1.3.0 // indirect
go.opencensus.io v0.24.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488 // indirect
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -140,11 +140,11 @@ require (

require (
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230109192245-7efeeb08f296
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/pkg/xattr v0.4.9
golang.org/x/mobile v0.0.0-20221110043201-43a038452099
golang.org/x/mobile v0.0.0-20230301163155-e0f57694e12c
golang.org/x/term v0.6.0
)

0 comments on commit 15e3c48

Please sign in to comment.