vendor.sh 2.1 KB

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