Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change go-os-rename to standard #34

Merged
merged 1 commit into from
Mar 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/query"
"github.com/jbenet/go-os-rename"
)

func UpgradeV0toV1(path string, prefixLen int) error {
Expand Down Expand Up @@ -152,7 +151,7 @@ func Move(oldPath string, newPath string, out io.Writer) error {
// else we found something unexpected, so to be safe just move it
log.Warningf("found unexpected file in datastore directory: \"%s\", moving anyway\n", fn)
newPath := filepath.Join(newDS.path, fn)
err := osrename.Rename(oldPath, newPath)
err := os.Rename(oldPath, newPath)
if err != nil {
return err
}
Expand All @@ -173,7 +172,7 @@ func moveKey(oldDS *Datastore, newDS *Datastore, key datastore.Key) error {
if err != nil {
return err
}
err = osrename.Rename(oldPath, newPath)
err = os.Rename(oldPath, newPath)
if err != nil {
return err
}
Expand Down
5 changes: 2 additions & 3 deletions flatfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (

"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/query"
"github.com/jbenet/go-os-rename"

logging "github.com/ipfs/go-log"
)
Expand Down Expand Up @@ -286,7 +285,7 @@ func (fs *Datastore) renameAndUpdateDiskUsage(tmpPath, path string) error {
// Rename and add new file's diskUsage. If the rename fails,
// it will either a) Re-add the size of an existing file, which
// was sustracted before b) Add 0 if there is no existing file.
err = osrename.Rename(tmpPath, path)
err = os.Rename(tmpPath, path)
fs.updateDiskUsage(path, true)
return err
}
Expand Down Expand Up @@ -779,7 +778,7 @@ func (fs *Datastore) persistDiskUsageFile() {
return
}

osrename.Rename(tmp.Name(), filepath.Join(fs.path, DiskUsageFile))
os.Rename(tmp.Name(), filepath.Join(fs.path, DiskUsageFile))
}

func (fs *Datastore) readDiskUsageFile() int64 {
Expand Down
6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
"name": "go-log",
"version": "1.4.0"
},
{
"author": "jbenet",
"hash": "QmaeRR9SpXumU5tYLRkq6x6pfMe8qKzxn4ujBpsTJ2zQG7",
"name": "go-os-rename",
"version": "0.0.0"
},
{
"author": "jbenet",
"hash": "QmeiCcJfDW1GJnWUArudsv5rQsihpi4oyddPhdqo3CfX6i",
Expand Down