diff options
| author | Shulhan <ms@kilabit.info> | 2018-05-26 18:05:33 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-05-26 18:05:33 +0700 |
| commit | 0e71a52f36ea9884c91ed802c49bd7563b0bb3be (patch) | |
| tree | fbedd7490cf8a77afcd900c4c26a49eed31732fa | |
| parent | 324379e7e5db26bbd56ae4cde039af9a7db70b80 (diff) | |
| download | beku-0e71a52f36ea9884c91ed802c49bd7563b0bb3be.tar.xz | |
Change default database file name from "gopath.deps" to "beku.db"
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | README.md | 9 | ||||
| -rw-r--r-- | beku.go | 2 | ||||
| -rw-r--r-- | cmd/beku/main.go | 6 | ||||
| -rw-r--r-- | env.go | 5 | ||||
| -rw-r--r-- | env_test.go | 12 | ||||
| -rw-r--r-- | testdata/beku.db (renamed from testdata/gopath.deps) | 0 |
7 files changed, 21 insertions, 15 deletions
@@ -1,4 +1,4 @@ -testdata/gopath.deps.save +/testdata/beku.db.save /beku.test /cover.html /cover.out @@ -14,13 +14,13 @@ For beku as program see the below documentation or at Beku is command line program to manage packages in $GOPATH. Beku provide syntax like `pacman`. -Beku read and write the package database into a file named "gopath.deps". +Beku read and write the package database into a file named "beku.db". At first execution, beku will try to open the package database in current directory. If no file found, it will try to open -"$GOPATH/var/beku/gopath.deps". When both locations does not provide +"$GOPATH/var/beku/beku.db". When both locations does not provide package database, beku will scan entire "$GOPATH/src" and write the -package database into "$GOPATH/var/beku/gopath.deps". +package database into "$GOPATH/var/beku/beku.db". ## Query Operation @@ -72,6 +72,9 @@ on database file. Sync operation will not install missing dependencies. +If no parameter is given, beku will rescan GOPATH, checking for new +packages. + ### Options [--into <destination>] @@ -8,7 +8,7 @@ import ( const ( // DefDBName define default database name, where the dependencies will // be saved and loaded. - DefDBName = "gopath.deps" + DefDBName = "beku.db" ) const ( diff --git a/cmd/beku/main.go b/cmd/beku/main.go index efac93f..2a3f268 100644 --- a/cmd/beku/main.go +++ b/cmd/beku/main.go @@ -6,13 +6,13 @@ // Beku is a command line program to manage packages in $GOPATH. Beku provide // syntax like `pacman`. // -// Beku read and write the package database into a file named "gopath.deps". +// Beku read and write the package database into a file named "beku.db". // // At first execution, beku will try to open the package database in current // directory. If no file found, it will try to open -// "$GOPATH/var/beku/gopath.deps". When both locations does not provide +// "$GOPATH/var/beku/beku.db". When both locations does not provide // package database, beku will scan entire "$GOPATH/src" and write the -// package database into "$GOPATH/var/beku/gopath.deps". +// package database into "$GOPATH/var/beku/beku.db". // // ## Query Operation // @@ -705,7 +705,10 @@ func (env *Env) update(curPkg, newPkg *Package) (ok bool, err error) { // func (env *Env) updateMissing(newPkg *Package) { var updated bool - fmt.Println(">>> Update missing:", newPkg.ImportPath) + + if Debug >= DebugL1 { + fmt.Println(">>> Update missing:", newPkg.ImportPath) + } for x := 0; x < len(env.pkgs); x++ { updated = env.pkgs[x].UpdateMissingDep(newPkg) diff --git a/env_test.go b/env_test.go index 62ade9c..78b74be 100644 --- a/env_test.go +++ b/env_test.go @@ -25,7 +25,7 @@ func testEnvLoad(t *testing.T) { expErr: fmt.Sprintf("open %s: no such file or directory", testEnv.dbDefFile), }, { desc: `With valid file`, - file: "testdata/gopath.deps", + file: "testdata/beku.db", }} var err error @@ -239,13 +239,13 @@ func testEnvSave(t *testing.T) { }{{ desc: "Not dirty", dirty: false, - file: "testdata/gopath.deps.save", - expStatErr: "stat testdata/gopath.deps.save: no such file or directory", + file: "testdata/beku.db.save", + expStatErr: "stat testdata/beku.db.save: no such file or directory", }, { desc: "Dirty", dirty: true, - file: "testdata/gopath.deps.save", - expStatErr: "stat testdata/gopath.deps.save: no such file or directory", + file: "testdata/beku.db.save", + expStatErr: "stat testdata/beku.db.save: no such file or directory", }} for _, c := range cases { @@ -264,7 +264,7 @@ func testEnvSave(t *testing.T) { continue } - diffs, err := diff.Files("testdata/gopath.deps", c.file, diff.LevelLines) + diffs, err := diff.Files("testdata/beku.db", c.file, diff.LevelLines) if err != nil { t.Fatal(err) } diff --git a/testdata/gopath.deps b/testdata/beku.db index 2d288bf..2d288bf 100644 --- a/testdata/gopath.deps +++ b/testdata/beku.db |
