summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-05-12 06:51:23 -0500
committerStan Hu <stanhu@gmail.com>2016-05-12 07:01:51 -0500
commite88ec0a4ac7e89f078ef8fd53fa74ec5d6a4812d (patch)
tree43597f05afc78e4eccf0c1f4919c69820cbb7b95 /Makefile
parent729470d3346fe321cb8ef8c6d5e9d7bf0fa4b430 (diff)
downloadgitlab-shell-e88ec0a4ac7e89f078ef8fd53fa74ec5d6a4812d.tar.gz
Put redis library in lib/vendor/ and adjust LOAD_PATHuse-redis-rb-client
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 4 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 17ff653..2a78178 100644
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,12 @@
REDIS_RB_VERSION=v3.3.0
-REDIS_RB_TMP_DIR := $(shell mktemp -d)
-REDIS_RB_VENDOR_DIR=lib/vendor
+REDIS_RB_VENDOR_DIR=lib/vendor/redis
PWD=`pwd`
all:
update-redis:
- git clone https://github.com/redis/redis-rb.git $(REDIS_RB_TMP_DIR)
- cd $(REDIS_RB_TMP_DIR); git checkout $(REDIS_RB_VERSION)
- cd $(PWD)
- mkdir -p $(REDIS_RB_VENDOR_DIR)
- cp -r $(REDIS_RB_TMP_DIR)/lib/* $(REDIS_RB_VENDOR_DIR)
- # Adjust all 'require redis/' paths to relative paths
- sed -i.orig -e 's/require "redis/require_relative "redis/g' $(REDIS_RB_VENDOR_DIR)/redis.rb
- find $(REDIS_RB_VENDOR_DIR)/redis -name \*.rb -maxdepth 1 -exec sed -i.orig -e "s/require \"redis\//require_relative \"/g" {} \;
- find $(REDIS_RB_VENDOR_DIR)/redis/connection -name \*.rb -maxdepth 1 -exec sed -i.orig -e 's/require "redis\/connection\//require_relative "/g' *.rb {} \;
- find $(REDIS_RB_VENDOR_DIR)/redis/connection -name \*.rb -maxdepth 1 -exec sed -i.orig -e 's/require "redis\//require_relative "..\//g' *.rb {} \;
+ rm -rf $(REDIS_RB_VENDOR_DIR)
+ git clone -b $(REDIS_RB_VERSION) https://github.com/redis/redis-rb.git $(REDIS_RB_VENDOR_DIR)
+ rm -rf $(REDIS_RB_VENDOR_DIR)/.git
.PHONY=update-redis