diff --git a/_scripts/go-vitess/Makefile b/_scripts/go-vitess/Makefile index 23f9038aa..7ffd81055 100644 --- a/_scripts/go-vitess/Makefile +++ b/_scripts/go-vitess/Makefile @@ -1,56 +1,41 @@ -# Tooling to create the package `gopkg.in/src-d/go-vitess.v0`. +# Tooling to create the package `gopkg.in/src-d/go-vitess.v1`. # config -PACKAGE := gopkg.in/src-d/go-vitess.v0 +PACKAGE := gopkg.in/src-d/go-vitess.v1 REMOTE := git@github.com:src-d/go-vitess.git -VITESS_GIT := https://github.com/youtube/vitess -VITESS_PKG := github.com/youtube/vitess/go/mysql -DEPENDENCIES := \ - github.com/novalagung/gorep \ - github.com/youtube/vitess - +VITESS_GIT := git@github.com:vitessio/vitess.git +VITESS_PKG := vitess.io/vitess/go VITESS_SRC := ${GOPATH}/src/${PACKAGE} -PACKAGES := $(VITESS_PKG) $(shell go list -f '{{ join .Deps "\n" }}' ${VITESS_PKG} | grep -i vitess) -FOLDERS := $(shell echo ${PACKAGES} | sed -e 's/github.com\/youtube\/vitess\///g') -GIT_COMMIT := $(shell cd ${VITESS_SRC} && git show-ref refs/original/refs/heads/master --hash) -ETC_PATH := $(PWD)/etc -all: prepare-package -prepare-package: | filter-branch rename-packages replace-glog prepare-git commit +CWD := $(PWD) -$(VITESS_SRC): - git clone --single-branch --no-tags ${VITESS_GIT} $@ +all: prepare-package +prepare-package: | filter-branch rename-packages prepare-git commit -filter-branch: $(VITESS_SRC) - cd ${VITESS_SRC} && \ - git filter-branch --index-filter ' \ - git rm --cached -qr --ignore-unmatch -- . && \ - git reset -q $$GIT_COMMIT -- ${FOLDERS} \ - ' \ - --prune-empty \ - -- --all +clone: + git clone --single-branch --depth 1 --no-tags ${VITESS_GIT} ${VITESS_SRC} -commit: +filter-branch: clone cd ${VITESS_SRC} && \ - cp -rf ${ETC_PATH}/* . && git add * && \ - git commit -m "update from upstream ${VITESS_GIT}/commit/${GIT_COMMIT}" -a -s + git filter-branch --subdirectory-filter go && \ + rm -fr README.md cacheservice cmd exit ioutil2 memcache race ratelimiter stats/influxdbbackend stats/opentsdb stats/prometheusbackend testfiles vtbench zk vt/mysqlctl/cephbackupstorage && \ + cp -f "${CWD}/doc.go" "${CWD}/README.md" ${VITESS_SRC} rename-packages: cd ${VITESS_SRC} && \ - git mv go/* . && \ - gorep -from=github.com/youtube/vitess/go -to=${PACKAGE} + gorep -from=${VITESS_PKG} -to=${PACKAGE} -replace-glog: +prepare-git: cd ${VITESS_SRC} && \ - gorep -from=github.com/golang/glog -to=github.com/sirupsen/logrus && \ - grep -lr --exclude-dir=".git" -e "Exitf" . | xargs sed -i 's/log\.Exitf/log\.Panicf/g' + git remote rm origin && \ + git remote add origin $(REMOTE) -prepare-git: +commit: cd ${VITESS_SRC} && \ - git remote rm origin && \ - git remote add origin $(REMOTE) + git add . && \ + git commit -m "update from upstream ${VITESS_GIT}" -a -s clean: rm -rf ${VITESS_SRC} -.PHONY: $(PACKAGES) test clean +.PHONY: clean diff --git a/_scripts/go-vitess/etc/README.md b/_scripts/go-vitess/README.md similarity index 51% rename from _scripts/go-vitess/etc/README.md rename to _scripts/go-vitess/README.md index 725a52960..7a2090c83 100644 --- a/_scripts/go-vitess/etc/README.md +++ b/_scripts/go-vitess/README.md @@ -1,20 +1,20 @@ -# go-vitess [![GoDoc](https://godoc.org/gopkg.in/src-d/go-vitess.v0?status.svg)](https://godoc.org/gopkg.in/src-d/go-vitess.v0) +# go-vitess [![GoDoc](https://godoc.org/gopkg.in/src-d/go-vitess.v1?status.svg)](https://godoc.org/gopkg.in/src-d/go-vitess.v1) -`go-vitess` is an automatic filter-branch done by an [script](https://github.com/src-d/go-mysql-server/blob/master/_scripts/go-vitess/Makefile), of the great [Vitess](github.com/youtube/vitess) project. +`go-vitess` is an automatic filter-branch done by an [script](https://github.com/src-d/go-mysql-server/blob/master/_scripts/go-vitess/Makefile), of the great [Vitess](github.com/vitessio/vitess) project. -The goal is keeping the `github.com/youtube/vitess/go/mysql` package and all the dependent packages as a standalone versioned golang library, to be used by other projects. +The goal is keeping the `vitess.io/vitess/go` package and all the dependent packages as a standalone versioned golang library, to be used by other projects. It holds all the packages to create your own MySQL server and a full SQL parser. ## Installation ```sh -go get -v -u gopkg.in/src-d/go-vitess.v0/... +go get -v -u gopkg.in/src-d/go-vitess.v1/... ``` ## Contributions -Since the code belongs to the upstream of [Vitess](github.com/youtube/vitess), +Since the code belongs to the upstream of [Vitess](github.com/vitessio/vitess), the issue neither pull requests aren't accepted to this repository. ## License diff --git a/_scripts/go-vitess/etc/doc.go b/_scripts/go-vitess/doc.go similarity index 66% rename from _scripts/go-vitess/etc/doc.go rename to _scripts/go-vitess/doc.go index 82b11de32..c6ed7951d 100644 --- a/_scripts/go-vitess/etc/doc.go +++ b/_scripts/go-vitess/doc.go @@ -1,9 +1,9 @@ // Package vitess is an automatic filter-branch, of the great Vitess project. // -// The goal is keeping the `github.com/youtube/vitess/go/mysql` package and all +// The goal is keeping the `vitess.io/vitess/go` package and all // the dependent packages as a standalone versioned golang library, to be used // by other projects. // // It holds all the packages to create your own MySQL server and a full SQL // parser. -package vitess // import "gopkg.in/src-d/go-vitess.v0" +package vitess // import "gopkg.in/src-d/go-vitess.v1"