2017-02-13 14:01:54 -05:00
|
|
|
#!/usr/bin/env bash
|
2013-08-26 18:51:22 -04:00
|
|
|
|
2021-12-15 14:35:04 -05:00
|
|
|
# This file is just wrapper around 'go mod vendor' tool.
|
|
|
|
# For updating dependencies you should change `vendor.mod` file in root of the
|
|
|
|
# project.
|
2016-04-19 09:35:06 -04:00
|
|
|
|
2016-10-31 14:22:28 -04:00
|
|
|
set -e
|
2021-12-15 14:35:04 -05:00
|
|
|
set -x
|
2013-12-19 12:01:55 -05:00
|
|
|
|
2021-12-15 14:35:04 -05:00
|
|
|
SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
2022-02-05 05:25:23 -05:00
|
|
|
"${SCRIPTDIR}"/go-mod-prepare.sh
|
2021-12-15 14:35:04 -05:00
|
|
|
|
|
|
|
if [ $# -eq 0 ] || [ "$1" != "archive/tar" ]; then
|
2022-02-05 05:25:23 -05:00
|
|
|
GO111MODULE=auto go mod tidy -modfile 'vendor.mod' -compat 1.17
|
2021-12-15 14:35:04 -05:00
|
|
|
GO111MODULE=auto go mod vendor -modfile vendor.mod
|
2016-10-31 14:22:28 -04:00
|
|
|
fi
|
2016-07-20 19:11:28 -04:00
|
|
|
|
2020-07-15 07:45:41 -04:00
|
|
|
if [ $# -eq 0 ] || [ "$1" = "archive/tar" ]; then
|
|
|
|
echo "update vendored copy of archive/tar"
|
|
|
|
: "${GO_VERSION:=$(awk -F '[ =]' '$1 == "ARG" && $2 == "GO_VERSION" { print $3; exit }' ./Dockerfile)}"
|
2021-12-15 14:35:04 -05:00
|
|
|
rm -rf vendor/archive/tar
|
|
|
|
mkdir -p vendor/archive/tar
|
2021-08-23 10:41:32 -04:00
|
|
|
echo "downloading: https://golang.org/dl/go${GO_VERSION%.0}.src.tar.gz"
|
|
|
|
curl -fsSL "https://golang.org/dl/go${GO_VERSION%.0}.src.tar.gz" \
|
2020-07-15 07:45:41 -04:00
|
|
|
| tar --extract --gzip --directory=vendor/archive/tar --strip-components=4 go/src/archive/tar
|
|
|
|
patch --strip=4 --directory=vendor/archive/tar --input="$PWD/patches/0001-archive-tar-do-not-populate-user-group-names.patch"
|
|
|
|
fi
|
|
|
|
|