vendor: add vendor-update.sh script

Change-Id: Id4ebb34cf4f2b70c987af60b4b09bb2470f56ad5
Reviewed-on: https://upspin-review.googlesource.com/17501
Reviewed-by: Rob Pike <r@golang.org>
diff --git a/vendor-update.sh b/vendor-update.sh
new file mode 100755
index 0000000..9b85297
--- /dev/null
+++ b/vendor-update.sh
@@ -0,0 +1,21 @@
+#!/bin/bash -e
+
+# vendor-update.sh updates the vendored copy of the upspin.io repository and
+# stages the result, ready for "git commit".
+
+# The dep command can be obtained with "go get github.com/golang/dep/cmd/dep".
+
+# Update the upspin.io package.
+dep ensure -update upspin.io
+# Remove any vendored packages we don't use.
+dep prune
+# Delete test files.
+find vendor -name '*_test.go' -delete
+# Delete Google Cloud JSON API schemas.
+find vendor -name '*-api.json' -delete
+# Delete the cacheserver sources, which appear in the vendor directory because
+# we depend on cacheutil (a bug or deficiency in dep).
+find vendor/upspin.io/cmd/cacheserver -type f -depth 1 -delete
+
+git add vendor Gopkg.lock
+git gofmt