File: vendor.sh

package info (click to toggle)
docker.io 20.10.24%2Bdfsg1-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-proposed-updates
  • size: 60,824 kB
  • sloc: sh: 5,621; makefile: 593; ansic: 179; python: 162; asm: 7
file content (28 lines) | stat: -rwxr-xr-x 1,114 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash

# This file is just wrapper around vndr (github.com/LK4D4/vndr) tool.
# For updating dependencies you should change `vendor.conf` file in root of the
# project. Please refer to https://github.com/LK4D4/vndr/blob/master/README.md for
# vndr usage.

set -e

if ! hash vndr; then
	echo "Please install vndr with \"go get github.com/LK4D4/vndr\" and put it in your \$GOPATH"
	exit 1
fi

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)}"
	rm -rf vendor/archive
	mkdir -p ./vendor/archive/tar
	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" \
		| 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

if [ $# -eq 0 ] || [ "$1" != "archive/tar" ]; then
	vndr -whitelist=^archive/tar "$@"
fi