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

Commit

Permalink
go-vitess: replace glog with logrus
Browse files Browse the repository at this point in the history
  • Loading branch information
mcuadros committed Feb 19, 2018
1 parent b84400d commit 031d7f7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions _scripts/go-vitess/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ DEPENDENCIES := \
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 log --format='%H' -n 1)
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 prepare-git
prepare-package: | filter-branch rename-packages replace-glog prepare-git commit

$(VITESS_SRC):
git clone --single-branch --no-tags ${VITESS_GIT} $@
Expand All @@ -30,13 +30,21 @@ filter-branch: $(VITESS_SRC)
--prune-empty \
-- --all

rename-packages:
commit:
cd ${VITESS_SRC} && \
git mv go/* . && \
gorep -from=github.com/youtube/vitess/go -to=${PACKAGE} && \
cp -rf ${ETC_PATH}/* . && git add * && \
git commit -m "update from upstream ${VITESS_GIT}/commit/${GIT_COMMIT}" -a -s

rename-packages:
cd ${VITESS_SRC} && \
git mv go/* . && \
gorep -from=github.com/youtube/vitess/go -to=${PACKAGE}

replace-glog:
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'

prepare-git:
cd ${VITESS_SRC} && \
git remote rm origin && \
Expand Down

0 comments on commit 031d7f7

Please sign in to comment.