From 12a71882db771db5de195173745b770bc5401de4 Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Mon, 4 Dec 2017 18:23:13 +0000 Subject: [PATCH] Add support to install from alternative repo Signed-off-by: Lantao Liu --- hack/install-deps.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hack/install-deps.sh b/hack/install-deps.sh index 8b7df187f..76b53a069 100755 --- a/hack/install-deps.sh +++ b/hack/install-deps.sh @@ -72,12 +72,17 @@ GOPATH=${GOPATH%%:*} # checkout_repo checks out specified repository # and switch to specified version. # Varset: -# 1) Repo name; +# 1) Pkg name; # 2) Version. +# 3) Repo name (optional); checkout_repo() { - repo=$1 + pkg=$1 version=$2 - path="${GOPATH}/src/${repo}" + repo=${3:-""} + if [ -z "${repo}" ]; then + repo=${pkg} + fi + path="${GOPATH}/src/${pkg}" if [ ! -d ${path} ]; then mkdir -p ${path} git clone https://${repo} ${path} @@ -130,7 +135,7 @@ EOF' fi # Install containerd -checkout_repo ${CONTAINERD_PKG} ${CONTAINERD_VERSION} +checkout_repo ${CONTAINERD_PKG} ${CONTAINERD_VERSION} ${CONTAINERD_REPO} cd ${GOPATH}/src/${CONTAINERD_PKG} make ${sudo} make install -e DESTDIR=${CONTAINERD_DIR}