Skip to content

Commit

Permalink
rollback some unreleted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Oct 7, 2023
1 parent e6eda47 commit 1635942
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ juicefs: Makefile cmd/*.go pkg/*/*.go go.*
go build -ldflags="$(LDFLAGS)" -o juicefs .

juicefs.lite: Makefile cmd/*.go pkg/*/*.go
go build -tags nogateway,nowebdav,nocos,nobos,nohdfs,noibmcos,noobs,nooss,noqingstor,noscs,nosftp,noswift,noupyun,noazure,nogs,noufile,nob2,nosqlite,nomysql,nopg,notikv,nobadger,noetcd \
go build -tags nogateway,nowebdav,nocos,nobos,nohdfs,noibmcos,noobs,nooss,noqingstor,noscs,nosftp,noswift,noupyun,noazure,nogs,noufile,nob2,nonfs,nosqlite,nomysql,nopg,notikv,nobadger,noetcd \
-ldflags="$(LDFLAGS)" -o juicefs.lite .

juicefs.ceph: Makefile cmd/*.go pkg/*/*.go
Expand Down
1 change: 1 addition & 0 deletions cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ func createSyncStorage(uri string, conf *sync.Config) (object.ObjectStorage, err
secretKey, _ = user.Password()
}
name := strings.ToLower(u.Scheme)

var endpoint string
if name == "file" {
endpoint = u.Path
Expand Down
4 changes: 2 additions & 2 deletions pkg/object/object_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func ListAllWithDelimiter(store ObjectStorage, prefix, start, end string, follow
if key < start && !strings.HasPrefix(start, key) {
continue
}
if !entries[i].IsDir() || key == prefix || !followLink && entries[i].IsSymlink() {
if !entries[i].IsDir() || key == prefix {
continue
}

Expand Down Expand Up @@ -244,7 +244,7 @@ func ListAllWithDelimiter(store ObjectStorage, prefix, start, end string, follow
} else if !strings.HasPrefix(start, key) {
continue
}
if !entries[i].IsDir() || key == prefix || !followLink && entries[i].IsSymlink() {
if !e.IsDir() || key == prefix {
continue
}

Expand Down
10 changes: 6 additions & 4 deletions pkg/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,15 +554,17 @@ func worker(tasks <-chan object.Object, src, dst object.ObjectStorage, config *C
break
}
var err error
var dataCopied bool
if config.Links && obj.IsSymlink() {
err = copyLink(src, dst, key)
if err = copyLink(src, dst, key); err == nil {
copied.Increment()
break
}
logger.Errorf("copy link failed: %s", err)
} else {
dataCopied = true
err = copyData(src, dst, key, obj.Size())
}

if err == nil && (config.CheckAll || config.CheckNew) && dataCopied {
if err == nil && (config.CheckAll || config.CheckNew) {
var equal bool
if equal, err = checkSum(src, dst, key, obj.Size()); err == nil && !equal {
err = fmt.Errorf("checksums of copied object %s don't match", key)
Expand Down

0 comments on commit 1635942

Please sign in to comment.