1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/vendor.sh
Tianon Gravi 40b40cffb1 Clean and simplify vendor.sh while making it easier to maintain as well
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-15 22:20:51 -07:00

52 lines
911 B
Bash
Executable file

#!/bin/bash
set -e
cd "$(dirname "$BASH_SOURCE")/.."
# Downloads dependencies into vendor/ directory
mkdir -p vendor
cd vendor
clone() {
vcs=$1
pkg=$2
rev=$3
pkg_url=https://$pkg
target_dir=src/$pkg
echo -n "$pkg @ $rev: "
if [ -d $target_dir ]; then
echo -n 'rm old, '
rm -fr $target_dir
fi
echo -n 'clone, '
case $vcs in
git)
git clone --quiet --no-checkout $pkg_url $target_dir
( cd $target_dir && git reset --quiet --hard $rev )
;;
hg)
hg clone --quiet --updaterev $rev $pkg_url $target_dir
;;
esac
echo -n 'rm VCS, '
( cd $target_dir && rm -rf .{git,hg} )
echo done
}
clone git github.com/kr/pty 3b1f6487b
clone git github.com/gorilla/context 708054d61e5
clone git github.com/gorilla/mux 9b36453141c
clone git github.com/syndtr/gocapability 3454319be2
clone hg code.google.com/p/go.net 84a4013f96e0
clone hg code.google.com/p/gosqlite 74691fb6f837