github.com/dougm/docker@v1.5.0/project/vendor.sh (about)

     1  #!/usr/bin/env bash
     2  set -e
     3  
     4  cd "$(dirname "$BASH_SOURCE")/.."
     5  
     6  # Downloads dependencies into vendor/ directory
     7  mkdir -p vendor
     8  cd vendor
     9  
    10  clone() {
    11  	vcs=$1
    12  	pkg=$2
    13  	rev=$3
    14  	
    15  	pkg_url=https://$pkg
    16  	target_dir=src/$pkg
    17  	
    18  	echo -n "$pkg @ $rev: "
    19  	
    20  	if [ -d $target_dir ]; then
    21  		echo -n 'rm old, '
    22  		rm -fr $target_dir
    23  	fi
    24  	
    25  	echo -n 'clone, '
    26  	case $vcs in
    27  		git)
    28  			git clone --quiet --no-checkout $pkg_url $target_dir
    29  			( cd $target_dir && git reset --quiet --hard $rev )
    30  			;;
    31  		hg)
    32  			hg clone --quiet --updaterev $rev $pkg_url $target_dir
    33  			;;
    34  	esac
    35  	
    36  	echo -n 'rm VCS, '
    37  	( cd $target_dir && rm -rf .{git,hg} )
    38  	
    39  	echo done
    40  }
    41  
    42  clone git github.com/kr/pty 05017fcccf
    43  
    44  clone git github.com/gorilla/context 14f550f51a
    45  
    46  clone git github.com/gorilla/mux 136d54f81f
    47  
    48  clone git github.com/tchap/go-patricia v1.0.1
    49  
    50  clone hg code.google.com/p/go.net 84a4013f96e0
    51  
    52  clone hg code.google.com/p/gosqlite 74691fb6f837
    53  
    54  clone git github.com/docker/libtrust 230dfd18c232
    55  
    56  clone git github.com/Sirupsen/logrus v0.6.0
    57  
    58  clone git github.com/go-fsnotify/fsnotify v1.0.4
    59  
    60  # get Go tip's archive/tar, for xattr support and improved performance
    61  # TODO after Go 1.4 drops, bump our minimum supported version and drop this vendored dep
    62  if [ "$1" = '--go' ]; then
    63  	# Go takes forever and a half to clone, so we only redownload it when explicitly requested via the "--go" flag to this script.
    64  	clone hg code.google.com/p/go 1b17b3426e3c
    65  	mv src/code.google.com/p/go/src/pkg/archive/tar tmp-tar
    66  	rm -rf src/code.google.com/p/go
    67  	mkdir -p src/code.google.com/p/go/src/pkg/archive
    68  	mv tmp-tar src/code.google.com/p/go/src/pkg/archive/tar
    69  fi
    70  
    71  clone git github.com/docker/libcontainer eb74393a3d2daeafbef4f5f27c0821cbdd67559c
    72  # see src/github.com/docker/libcontainer/update-vendor.sh which is the "source of truth" for libcontainer deps (just like this file)
    73  rm -rf src/github.com/docker/libcontainer/vendor
    74  eval "$(grep '^clone ' src/github.com/docker/libcontainer/update-vendor.sh | grep -v 'github.com/codegangsta/cli')"
    75  # we exclude "github.com/codegangsta/cli" here because it's only needed for "nsinit", which Docker doesn't include