Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Update go-vitess Makefile #384

Merged
merged 1 commit into from
Sep 28, 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
57 changes: 21 additions & 36 deletions _scripts/go-vitess/Makefile
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions _scripts/go-vitess/etc/doc.go → _scripts/go-vitess/doc.go
Original file line number Diff line number Diff line change
@@ -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"
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy