kumquat-buildroot/support/download/go-post-process
Thomas Petazzoni bfd1a31d0e support/download/go-post-process: drop -o pipefail
This breaks the post_process_unpack() function in
support/download/helpers, which had a sequence of pipe, with "head"
that can abort early and cause the pipe to fail.

Fixes intermitent:

make[1]: *** [package/pkg-generic.mk:190: /builds/tpetazzoni/buildroot/test-output/TestDockerCompose/build/containerd-1.5.8/.stamp_downloaded] Error 141

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-01-09 11:07:37 +01:00

36 lines
738 B
Bash
Executable File

#!/usr/bin/env bash
set -e
. "${0%/*}/helpers"
# Parse our options
while getopts "n:o:" OPT; do
case "${OPT}" in
o) output="${OPTARG}";;
n) base_name="${OPTARG}";;
:) error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
\?) error "unknown option '%s'\n" "${OPTARG}";;
esac
done
# Already vendored tarball, nothing to do
if tar tf "${output}" | grep -q "^[^/]*/vendor" ; then
exit 0
fi
post_process_unpack "${base_name}" "${output}"
# Do the Go vendoring
pushd "${base_name}" > /dev/null
if [ ! -f go.mod ]; then
echo "ERROR: no vendor/ folder and no go.mod, aborting"
exit 1
fi
go mod vendor -v -modcacherw
popd > /dev/null
post_process_repack $(pwd) "${base_name}" "${output}"