提交 5cb8d80b 作者: Tommi Virtanen 提交者: Juan Batiz-Benet

LevelDB is no longer "the" datastore, adjust identifiers

上级 7eb4a92a
...@@ -25,7 +25,7 @@ import ( ...@@ -25,7 +25,7 @@ import (
) )
const ( const (
defaultDataStoreDirectory = "datastore" leveldbDirectory = "datastore"
) )
var ( var (
...@@ -190,8 +190,8 @@ func Init(repoPath string, conf *config.Config) error { ...@@ -190,8 +190,8 @@ func Init(repoPath string, conf *config.Config) error {
// The actual datastore contents are initialized lazily when Opened. // The actual datastore contents are initialized lazily when Opened.
// During Init, we merely check that the directory is writeable. // During Init, we merely check that the directory is writeable.
p := path.Join(repoPath, defaultDataStoreDirectory) leveldbPath := path.Join(repoPath, leveldbDirectory)
if err := dir.Writable(p); err != nil { if err := dir.Writable(leveldbPath); err != nil {
return fmt.Errorf("datastore: %s", err) return fmt.Errorf("datastore: %s", err)
} }
...@@ -236,8 +236,8 @@ func (r *FSRepo) openConfig() error { ...@@ -236,8 +236,8 @@ func (r *FSRepo) openConfig() error {
// openDatastore returns an error if the config file is not present. // openDatastore returns an error if the config file is not present.
func (r *FSRepo) openDatastore() error { func (r *FSRepo) openDatastore() error {
dsPath := path.Join(r.path, defaultDataStoreDirectory) leveldbPath := path.Join(r.path, leveldbDirectory)
ds, err := levelds.NewDatastore(dsPath, &levelds.Options{ ds, err := levelds.NewDatastore(leveldbPath, &levelds.Options{
Compression: ldbopts.NoCompression, Compression: ldbopts.NoCompression,
}) })
if err != nil { if err != nil {
...@@ -430,7 +430,7 @@ func isInitializedUnsynced(repoPath string) bool { ...@@ -430,7 +430,7 @@ func isInitializedUnsynced(repoPath string) bool {
if !configIsInitialized(repoPath) { if !configIsInitialized(repoPath) {
return false return false
} }
if !util.FileExists(path.Join(repoPath, defaultDataStoreDirectory)) { if !util.FileExists(path.Join(repoPath, leveldbDirectory)) {
return false return false
} }
return true return true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论