diff --git a/hack/.vendor-helpers.sh b/hack/.vendor-helpers.sh deleted file mode 100644 index 895ad9c1..00000000 --- a/hack/.vendor-helpers.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env bash - -PROJECT=github.com/kubernetes-incubator/cri-o - -# Downloads dependencies into vendor/ directory -mkdir -p vendor - -original_GOPATH=$GOPATH -export GOPATH="${PWD}/vendor:$GOPATH" - -find="/usr/bin/find" - -clone() { - local delete_vendor=true - if [ "x$1" = x--keep-vendor ]; then - delete_vendor=false - shift - fi - - local vcs="$1" - local pkg="$2" - local rev="$3" - local url="$4" - - : ${url:=https://$pkg} - local target="vendor/$pkg" - - echo -n "$pkg @ $rev: " - - if [ -d "$target" ]; then - echo -n 'rm old, ' - rm -rf "$target" - fi - - echo -n 'clone, ' - case "$vcs" in - git) - git clone --quiet --no-checkout "$url" "$target" - ( cd "$target" && git checkout --quiet "$rev" && git reset --quiet --hard "$rev" -- ) - ;; - hg) - hg clone --quiet --updaterev "$rev" "$url" "$target" - ;; - esac - - echo -n 'rm VCS, ' - ( cd "$target" && rm -rf .{git,hg} ) - - if $delete_vendor; then - echo -n 'rm vendor, ' - ( cd "$target" && rm -rf vendor Godeps/_workspace ) - fi - - echo done -} - -clean() { - # If $GOPATH starts with ./vendor, (go list) shows the short-form import paths for packages inside ./vendor. - # So, reset GOPATH to the external value (without ./vendor), so that the grep -v works. - local packages=($(GOPATH=$original_GOPATH go list -e ./... | grep -v "^${PROJECT}/vendor")) - local platforms=( linux/amd64 linux/386 ) - - local buildTagSets=( seccomp ) - - echo - - echo -n 'collecting import graph, ' - local IFS=$'\n' - local imports=( $( - for platform in "${platforms[@]}"; do - for buildTags in "" "${buildTagSets[@]}"; do - export GOOS="${platform%/*}"; - export GOARCH="${platform##*/}"; - go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]}" - go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${packages[@]}" - done - done | grep -vE "^${PROJECT}" | sort -u - ) ) - # .TestImports does not include indirect dependencies, so do one more iteration. - imports+=( $( - go list -e -f '{{join .Deps "\n"}}' "${imports[@]}" | grep -vE "^${PROJECT}" | sort -u - ) ) - imports=( $(go list -e -f '{{if not .Standard}}{{.ImportPath}}{{end}}' "${imports[@]}") ) - unset IFS - - echo -n 'pruning unused packages, ' - findArgs=( - # This directory contains only .c and .h files which are necessary - # -path vendor/github.com/mattn/go-sqlite3/code - ) - for import in "${imports[@]}"; do - [ "${#findArgs[@]}" -eq 0 ] || findArgs+=( -or ) - findArgs+=( -path "vendor/$import" ) - done - local IFS=$'\n' - local prune=( $($find vendor -depth -type d -not '(' "${findArgs[@]}" ')') ) - unset IFS - for dir in "${prune[@]}"; do - $find "$dir" -maxdepth 1 -not -type d -not -name 'LICENSE*' -not -name 'COPYING*' -exec rm -v -f '{}' ';' - rmdir "$dir" 2>/dev/null || true - done - - echo -n 'pruning unused files, ' - $find vendor -type f -name '*_test.go' -exec rm -v '{}' ';' - - echo done -} - -# Fix up hard-coded imports that refer to Godeps paths so they'll work with our vendoring -fix_rewritten_imports () { - local pkg="$1" - local remove="${pkg}/Godeps/_workspace/src/" - local target="vendor/$pkg" - - echo "$pkg: fixing rewritten imports" - $find "$target" -name \*.go -exec sed -i -e "s|\"${remove}|\"|g" {} \; -} diff --git a/hack/vendor.sh b/hack/vendor.sh deleted file mode 100755 index 8a5815b2..00000000 --- a/hack/vendor.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env bash -set -e - -# this script is used to update vendored dependencies -# -# Usage: -# vendor.sh revendor all dependencies -# vendor.sh github.com/docker/engine-api revendor only the engine-api dependency. -# vendor.sh github.com/docker/engine-api v0.3.3 vendor only engine-api at the specified tag/commit. -# vendor.sh git github.com/docker/engine-api v0.3.3 is the same but specifies the VCS for cases where the VCS is something else than git -# vendor.sh git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git vendor only golang.org/x/sys downloading from the specified URL - -cd "$(dirname "$BASH_SOURCE")/.." -source 'hack/.vendor-helpers.sh' - -case $# in -0) - rm -rf vendor/ - ;; -# If user passed arguments to the script -1) - path="$PWD/hack/vendor.sh" - if ! cloneGrep="$(grep -E "^clone [^ ]+ $1" "$path")"; then - echo >&2 "error: failed to find 'clone ... $1' in $path" - exit 1 - fi - eval "$cloneGrep" - clean - exit 0 - ;; -2) - rm -rf "vendor/$1" - clone git "$1" "$2" - clean - exit 0 - ;; -[34]) - rm -rf "vendor/$2" - clone "$@" - clean - exit 0 - ;; -*) - >&2 echo "error: unexpected parameters" - exit 1 - ;; -esac - -clone git github.com/coreos/go-systemd master -clone git github.com/BurntSushi/toml v0.2.0 -clone git github.com/Sirupsen/logrus v0.10.0 - -clone git github.com/containers/storage master -clone git github.com/mistifyio/go-zfs master -clone git github.com/pborman/uuid master - -clone git github.com/containers/image master -clone git github.com/mtrmac/gpgme master -clone git gopkg.in/cheggaaa/pb.v1 master -clone git github.com/mattn/go-runewidth master -clone git github.com/docker/engine-api v0.4.0 - -clone git github.com/opencontainers/image-spec master -clone git golang.org/x/net 991d3e32f76f19ee6d9caadb3a22eae8d23315f7 https://github.com/golang/net.git -clone git github.com/docker/docker master -clone git github.com/urfave/cli v1.19.1 -clone git github.com/opencontainers/runtime-tools master -clone git github.com/tchap/go-patricia v2.2.6 -clone git github.com/containernetworking/cni master -clone git k8s.io/kubernetes 550f8be73aac92c7c23b1783d3db17f8660019f6 https://github.com/kubernetes/kubernetes -clone git k8s.io/apimachinery master https://github.com/kubernetes/apimachinery -clone git google.golang.org/grpc v1.0.1-GA https://github.com/grpc/grpc-go.git -clone git github.com/opencontainers/runtime-spec bb6925ea99f0e366a3f7d1c975f6577475ca25f0 -clone git github.com/docker/distribution d22e09a6686c32be8c17b684b639da4b90efe320 -clone git github.com/vbatts/tar-split v0.10.1 -clone git github.com/docker/go-units f2145db703495b2e525c59662db69a7344b00bb8 -clone git github.com/docker/go-connections 4ccf312bf1d35e5dbda654e57a9be4c3f3cd0366 -clone git github.com/docker/libtrust 9cbd2a1374f46905c68a4eb3694a130610adc62a -clone git github.com/ghodss/yaml 73d445a93680fa1a78ae23a5839bad48f32ba1ee -clone git gopkg.in/yaml.v2 d466437aa4adc35830964cffc5b5f262c63ddcb4 -clone git github.com/golang/protobuf 3c84672111d91bb5ac31719e112f9f7126a0e26e -clone git github.com/golang/glog 44145f04b68cf362d9c4df2182967c2275eaefed -clone git github.com/gorilla/mux v1.1 -clone git github.com/imdario/mergo 6633656539c1639d9d78127b7d47c622b5d7b6dc -clone git github.com/opencontainers/runc 3abefdff18bc201199c5dfd0e91e941cb4c61376 -clone git github.com/syndtr/gocapability 2c00daeb6c3b45114c80ac44119e7b8801fdd852 -clone git github.com/gogo/protobuf 43a2e0b1c32252bfbbdf81f7faa7a88fb3fa4028 -clone git github.com/gorilla/context v1.1 -clone git golang.org/x/sys 8f0908ab3b2457e2e15403d3697c9ef5cb4b57a9 https://github.com/golang/sys.git -clone git github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0 -clone git github.com/mistifyio/go-zfs master -clone git github.com/pborman/uuid master -clone git github.com/mtrmac/gpgme master -clone git gopkg.in/cheggaaa/pb.v1 master -clone git github.com/mattn/go-runewidth master -clone git github.com/docker/engine-api v0.4.0 -clone git github.com/pkg/errors master -clone git github.com/opencontainers/go-digest master - -clean