From b36d4aba372162db1e543a803d9f1241494cb9b2 Mon Sep 17 00:00:00 2001 From: siddontang Date: Sat, 14 Mar 2015 10:57:18 +0800 Subject: [PATCH] move some pkgs to vendor godep can not handle some pkgs which have build tags So we put these into vendor explicitly --- Godeps/Godeps.json | 4 ---- .../src/github.com/szferi/gomdb/.gitignore | 22 ------------------- Makefile | 4 ++-- server/cmd_script.go | 2 +- server/script.go | 2 +- server/script_test.go | 2 +- store/mdb/mdb.go | 2 +- store/mdb/snapshot.go | 2 +- store/mdb/tx.go | 2 +- vendor/README.md | 3 +++ .../szferi => vendor}/gomdb/LICENSE | 0 .../szferi => vendor}/gomdb/README.md | 0 .../szferi => vendor}/gomdb/bench_test.go | 2 ++ .../szferi => vendor}/gomdb/cursor.go | 2 ++ .../github.com/szferi => vendor}/gomdb/env.go | 2 ++ .../szferi => vendor}/gomdb/env_test.go | 2 ++ .../szferi => vendor}/gomdb/error_test.go | 4 +++- .../szferi => vendor}/gomdb/example_test.go | 2 ++ .../github.com/szferi => vendor}/gomdb/lmdb.h | 2 ++ .../github.com/szferi => vendor}/gomdb/mdb.c | 2 ++ .../github.com/szferi => vendor}/gomdb/mdb.go | 2 ++ .../szferi => vendor}/gomdb/mdb_test.go | 2 ++ .../github.com/szferi => vendor}/gomdb/midl.c | 2 ++ .../github.com/szferi => vendor}/gomdb/midl.h | 2 ++ .../github.com/szferi => vendor}/gomdb/txn.go | 18 ++++++++------- .../github.com/szferi => vendor}/gomdb/val.go | 2 ++ .../szferi => vendor}/gomdb/val_test.go | 2 ++ vendor/lua/LICENSE | 22 +++++++++++++++++++ {lua => vendor/lua}/c-golua.c | 0 {lua => vendor/lua}/golua.go | 0 {lua => vendor/lua}/golua.h | 0 {lua => vendor/lua}/golua_license | 0 {lua => vendor/lua}/lauxlib.go | 0 {lua => vendor/lua}/lua.go | 0 {lua => vendor/lua}/lua_cjson.c | 0 {lua => vendor/lua}/lua_cmsgpack.c | 0 {lua => vendor/lua}/lua_defs.go | 0 {lua => vendor/lua}/lua_struct.c | 0 {lua => vendor/lua}/lua_test.go | 0 {lua => vendor/lua}/strbuf.c | 0 {lua => vendor/lua}/strbuf.h | 0 41 files changed, 72 insertions(+), 43 deletions(-) delete mode 100644 Godeps/_workspace/src/github.com/szferi/gomdb/.gitignore create mode 100644 vendor/README.md rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/LICENSE (100%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/README.md (100%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/bench_test.go (99%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/cursor.go (99%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/env.go (99%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/env_test.go (98%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/error_test.go (96%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/example_test.go (98%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/lmdb.h (99%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/mdb.c (99%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/mdb.go (96%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/mdb_test.go (99%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/midl.c (99%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/midl.h (99%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/txn.go (95%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/val.go (98%) rename {Godeps/_workspace/src/github.com/szferi => vendor}/gomdb/val_test.go (97%) create mode 100644 vendor/lua/LICENSE rename {lua => vendor/lua}/c-golua.c (100%) rename {lua => vendor/lua}/golua.go (100%) rename {lua => vendor/lua}/golua.h (100%) rename {lua => vendor/lua}/golua_license (100%) rename {lua => vendor/lua}/lauxlib.go (100%) rename {lua => vendor/lua}/lua.go (100%) rename {lua => vendor/lua}/lua_cjson.c (100%) rename {lua => vendor/lua}/lua_cmsgpack.c (100%) rename {lua => vendor/lua}/lua_defs.go (100%) rename {lua => vendor/lua}/lua_struct.c (100%) rename {lua => vendor/lua}/lua_test.go (100%) rename {lua => vendor/lua}/strbuf.c (100%) rename {lua => vendor/lua}/strbuf.h (100%) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index b572bdd..47038a6 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -74,10 +74,6 @@ "ImportPath": "github.com/syndtr/gosnappy/snappy", "Rev": "ce8acff4829e0c2458a67ead32390ac0a381c862" }, - { - "ImportPath": "github.com/szferi/gomdb", - "Rev": "6bcb5a8059f9655a259774650dbe0cad422767a3" - }, { "ImportPath": "github.com/ugorji/go/codec", "Rev": "71c2886f5a673a35f909803f38ece5810165097b" diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/.gitignore b/Godeps/_workspace/src/github.com/szferi/gomdb/.gitignore deleted file mode 100644 index 0026861..0000000 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe diff --git a/Makefile b/Makefile index 3c240de..524b408 100644 --- a/Makefile +++ b/Makefile @@ -16,13 +16,13 @@ all: build build: $(GO) install -tags 'linenoise $(GO_BUILD_TAGS)' ./... -build_use_lmdb: +build_lmdb: $(GO) install -tags 'linenoise $(GO_BUILD_TAGS) lmdb' ./... test: $(GO) test --race -tags '$(GO_BUILD_TAGS)' ./... -test_use_lmdb: +test_lmdb: $(GO) test --race -tags '$(GO_BUILD_TAGS) lmdb' ./... test_ledis: diff --git a/server/cmd_script.go b/server/cmd_script.go index dc1d795..1148fa9 100644 --- a/server/cmd_script.go +++ b/server/cmd_script.go @@ -8,7 +8,7 @@ import ( "fmt" "github.com/siddontang/go/hack" - "github.com/siddontang/ledisdb/lua" + "github.com/siddontang/ledisdb/vendor/lua" "strconv" "strings" ) diff --git a/server/script.go b/server/script.go index ee8c684..fb10924 100644 --- a/server/script.go +++ b/server/script.go @@ -8,7 +8,7 @@ import ( "github.com/siddontang/go/hack" "github.com/siddontang/go/num" "github.com/siddontang/ledisdb/ledis" - "github.com/siddontang/ledisdb/lua" + "github.com/siddontang/ledisdb/vendor/lua" "io" "sync" ) diff --git a/server/script_test.go b/server/script_test.go index 4586ac8..f127876 100644 --- a/server/script_test.go +++ b/server/script_test.go @@ -5,7 +5,7 @@ package server import ( "fmt" "github.com/siddontang/ledisdb/config" - "github.com/siddontang/ledisdb/lua" + "github.com/siddontang/ledisdb/vendor/lua" "testing" ) diff --git a/store/mdb/mdb.go b/store/mdb/mdb.go index db27b33..21a2047 100644 --- a/store/mdb/mdb.go +++ b/store/mdb/mdb.go @@ -5,7 +5,7 @@ package mdb import ( "github.com/siddontang/ledisdb/config" "github.com/siddontang/ledisdb/store/driver" - mdb "github.com/szferi/gomdb" + mdb "github.com/siddontang/ledisdb/vendor/gomdb" "os" ) diff --git a/store/mdb/snapshot.go b/store/mdb/snapshot.go index 0882cd6..0e26ba9 100644 --- a/store/mdb/snapshot.go +++ b/store/mdb/snapshot.go @@ -4,7 +4,7 @@ package mdb import ( "github.com/siddontang/ledisdb/store/driver" - mdb "github.com/szferi/gomdb" + mdb "github.com/siddontang/ledisdb/vendor/gomdb" ) type Snapshot struct { diff --git a/store/mdb/tx.go b/store/mdb/tx.go index a4fc01b..0d13034 100644 --- a/store/mdb/tx.go +++ b/store/mdb/tx.go @@ -4,7 +4,7 @@ package mdb import ( "github.com/siddontang/ledisdb/store/driver" - mdb "github.com/szferi/gomdb" + mdb "github.com/siddontang/ledisdb/vendor/gomdb" ) type Tx struct { diff --git a/vendor/README.md b/vendor/README.md new file mode 100644 index 0000000..25080ae --- /dev/null +++ b/vendor/README.md @@ -0,0 +1,3 @@ +[godep](https://github.com/tools/godep) can not save packages which have build tags. + +So we put these packages here explicitly. \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/LICENSE b/vendor/gomdb/LICENSE similarity index 100% rename from Godeps/_workspace/src/github.com/szferi/gomdb/LICENSE rename to vendor/gomdb/LICENSE diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/README.md b/vendor/gomdb/README.md similarity index 100% rename from Godeps/_workspace/src/github.com/szferi/gomdb/README.md rename to vendor/gomdb/README.md diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/bench_test.go b/vendor/gomdb/bench_test.go similarity index 99% rename from Godeps/_workspace/src/github.com/szferi/gomdb/bench_test.go rename to vendor/gomdb/bench_test.go index 21a1b54..8dd6f0b 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/bench_test.go +++ b/vendor/gomdb/bench_test.go @@ -1,3 +1,5 @@ +// +build lmdb + package mdb import ( diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/cursor.go b/vendor/gomdb/cursor.go similarity index 99% rename from Godeps/_workspace/src/github.com/szferi/gomdb/cursor.go rename to vendor/gomdb/cursor.go index 75e0d14..ef97aac 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/cursor.go +++ b/vendor/gomdb/cursor.go @@ -1,3 +1,5 @@ +// +build lmdb + package mdb /* diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/env.go b/vendor/gomdb/env.go similarity index 99% rename from Godeps/_workspace/src/github.com/szferi/gomdb/env.go rename to vendor/gomdb/env.go index 08b4d0a..531833c 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/env.go +++ b/vendor/gomdb/env.go @@ -1,3 +1,5 @@ +// +build lmdb + package mdb /* diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/env_test.go b/vendor/gomdb/env_test.go similarity index 98% rename from Godeps/_workspace/src/github.com/szferi/gomdb/env_test.go rename to vendor/gomdb/env_test.go index 94abb0d..8225eaf 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/env_test.go +++ b/vendor/gomdb/env_test.go @@ -1,3 +1,5 @@ +// +build lmdb + package mdb import ( diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/error_test.go b/vendor/gomdb/error_test.go similarity index 96% rename from Godeps/_workspace/src/github.com/szferi/gomdb/error_test.go rename to vendor/gomdb/error_test.go index 5faf0fb..3c87745 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/error_test.go +++ b/vendor/gomdb/error_test.go @@ -1,8 +1,10 @@ +// +build lmdb + package mdb import ( - "testing" "syscall" + "testing" ) func TestErrno(t *testing.T) { diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/example_test.go b/vendor/gomdb/example_test.go similarity index 98% rename from Godeps/_workspace/src/github.com/szferi/gomdb/example_test.go rename to vendor/gomdb/example_test.go index 348d1e2..817e273 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/example_test.go +++ b/vendor/gomdb/example_test.go @@ -1,3 +1,5 @@ +// +build lmdb + package mdb import ( diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/lmdb.h b/vendor/gomdb/lmdb.h similarity index 99% rename from Godeps/_workspace/src/github.com/szferi/gomdb/lmdb.h rename to vendor/gomdb/lmdb.h index 11b46bf..c00fcae 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/lmdb.h +++ b/vendor/gomdb/lmdb.h @@ -1,3 +1,5 @@ +// +build lmdb + /** @file lmdb.h * @brief Lightning memory-mapped database library * diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/mdb.c b/vendor/gomdb/mdb.c similarity index 99% rename from Godeps/_workspace/src/github.com/szferi/gomdb/mdb.c rename to vendor/gomdb/mdb.c index c87886d..4f3bec3 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/mdb.c +++ b/vendor/gomdb/mdb.c @@ -1,3 +1,5 @@ +// +build lmdb + /** @file mdb.c * @brief Lightning memory-mapped database library * diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/mdb.go b/vendor/gomdb/mdb.go similarity index 96% rename from Godeps/_workspace/src/github.com/szferi/gomdb/mdb.go rename to vendor/gomdb/mdb.go index ae23c00..b29e06f 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/mdb.go +++ b/vendor/gomdb/mdb.go @@ -1,3 +1,5 @@ +// +build lmdb + /* A thin wrapper for the lmdb C library. These are low-level bindings for the C API. The C documentation should be used as a reference while developing diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/mdb_test.go b/vendor/gomdb/mdb_test.go similarity index 99% rename from Godeps/_workspace/src/github.com/szferi/gomdb/mdb_test.go rename to vendor/gomdb/mdb_test.go index 76b47b7..0eefbf0 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/mdb_test.go +++ b/vendor/gomdb/mdb_test.go @@ -1,3 +1,5 @@ +// +build lmdb + package mdb import ( diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/midl.c b/vendor/gomdb/midl.c similarity index 99% rename from Godeps/_workspace/src/github.com/szferi/gomdb/midl.c rename to vendor/gomdb/midl.c index 88a3aff..bc2e51e 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/midl.c +++ b/vendor/gomdb/midl.c @@ -1,3 +1,5 @@ +// +build lmdb + /** @file midl.c * @brief ldap bdb back-end ID List functions */ /* $OpenLDAP$ */ diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/midl.h b/vendor/gomdb/midl.h similarity index 99% rename from Godeps/_workspace/src/github.com/szferi/gomdb/midl.h rename to vendor/gomdb/midl.h index a7f2502..d17e0ff 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/midl.h +++ b/vendor/gomdb/midl.h @@ -1,3 +1,5 @@ +// +build lmdb + /** @file midl.h * @brief LMDB ID List header file. * diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/txn.go b/vendor/gomdb/txn.go similarity index 95% rename from Godeps/_workspace/src/github.com/szferi/gomdb/txn.go rename to vendor/gomdb/txn.go index f08b894..e4552e6 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/txn.go +++ b/vendor/gomdb/txn.go @@ -1,3 +1,5 @@ +// +build lmdb + package mdb /* @@ -66,20 +68,20 @@ func (env *Env) BeginTxn(parent *Txn, flags uint) (*Txn, error) { func (txn *Txn) Commit() error { ret := C.mdb_txn_commit(txn._txn) runtime.UnlockOSThread() - // The transaction handle is freed if there was no error - if ret == C.MDB_SUCCESS { - txn._txn = nil - } + // The transaction handle is freed if there was no error + if ret == C.MDB_SUCCESS { + txn._txn = nil + } return errno(ret) } func (txn *Txn) Abort() { if txn._txn == nil { - return - } - C.mdb_txn_abort(txn._txn) + return + } + C.mdb_txn_abort(txn._txn) runtime.UnlockOSThread() - // The transaction handle is always freed. + // The transaction handle is always freed. txn._txn = nil } diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/val.go b/vendor/gomdb/val.go similarity index 98% rename from Godeps/_workspace/src/github.com/szferi/gomdb/val.go rename to vendor/gomdb/val.go index d8bfb34..e6bc407 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/val.go +++ b/vendor/gomdb/val.go @@ -1,3 +1,5 @@ +// +build lmdb + package mdb /* diff --git a/Godeps/_workspace/src/github.com/szferi/gomdb/val_test.go b/vendor/gomdb/val_test.go similarity index 97% rename from Godeps/_workspace/src/github.com/szferi/gomdb/val_test.go rename to vendor/gomdb/val_test.go index 1fe7b37..8e16dd5 100644 --- a/Godeps/_workspace/src/github.com/szferi/gomdb/val_test.go +++ b/vendor/gomdb/val_test.go @@ -1,3 +1,5 @@ +// +build lmdb + package mdb import ( diff --git a/vendor/lua/LICENSE b/vendor/lua/LICENSE new file mode 100644 index 0000000..cc485b0 --- /dev/null +++ b/vendor/lua/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 siddontang + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/lua/c-golua.c b/vendor/lua/c-golua.c similarity index 100% rename from lua/c-golua.c rename to vendor/lua/c-golua.c diff --git a/lua/golua.go b/vendor/lua/golua.go similarity index 100% rename from lua/golua.go rename to vendor/lua/golua.go diff --git a/lua/golua.h b/vendor/lua/golua.h similarity index 100% rename from lua/golua.h rename to vendor/lua/golua.h diff --git a/lua/golua_license b/vendor/lua/golua_license similarity index 100% rename from lua/golua_license rename to vendor/lua/golua_license diff --git a/lua/lauxlib.go b/vendor/lua/lauxlib.go similarity index 100% rename from lua/lauxlib.go rename to vendor/lua/lauxlib.go diff --git a/lua/lua.go b/vendor/lua/lua.go similarity index 100% rename from lua/lua.go rename to vendor/lua/lua.go diff --git a/lua/lua_cjson.c b/vendor/lua/lua_cjson.c similarity index 100% rename from lua/lua_cjson.c rename to vendor/lua/lua_cjson.c diff --git a/lua/lua_cmsgpack.c b/vendor/lua/lua_cmsgpack.c similarity index 100% rename from lua/lua_cmsgpack.c rename to vendor/lua/lua_cmsgpack.c diff --git a/lua/lua_defs.go b/vendor/lua/lua_defs.go similarity index 100% rename from lua/lua_defs.go rename to vendor/lua/lua_defs.go diff --git a/lua/lua_struct.c b/vendor/lua/lua_struct.c similarity index 100% rename from lua/lua_struct.c rename to vendor/lua/lua_struct.c diff --git a/lua/lua_test.go b/vendor/lua/lua_test.go similarity index 100% rename from lua/lua_test.go rename to vendor/lua/lua_test.go diff --git a/lua/strbuf.c b/vendor/lua/strbuf.c similarity index 100% rename from lua/strbuf.c rename to vendor/lua/strbuf.c diff --git a/lua/strbuf.h b/vendor/lua/strbuf.h similarity index 100% rename from lua/strbuf.h rename to vendor/lua/strbuf.h