mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
[CI:BUILD] Packit: fix pre-sync action for downstream tasks
One of the reasons the last propose-downstream task failed for Fedora was the `golist` tool wasn't available in the Packit environment. This commit adds golist to the environment by downloading and extracting the golist rpm. This dependency could've been added in packit's upstream config but there were a few blockers, so it's easiest to add them in our action script. Ref: https://github.com/containers/podman/issues/19094 [NO NEW TESTS NEEDED] Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
@ -4,14 +4,25 @@
|
||||
# packaging, via the `propose-downstream` packit action.
|
||||
# The goimports don't need to be present upstream.
|
||||
|
||||
set -eo pipefail
|
||||
set -eox pipefail
|
||||
|
||||
PACKAGE=podman
|
||||
# script is run from git root directory
|
||||
SPEC_FILE=rpm/$PACKAGE.spec
|
||||
|
||||
GOPATHDIR=~/go/src/github.com/containers/
|
||||
mkdir -p $GOPATHDIR
|
||||
ln -sf $(pwd) $GOPATHDIR/.
|
||||
|
||||
# Packit sandbox doesn't allow root
|
||||
# Install golist by downloading and extracting rpm
|
||||
# We could handle this in packit `sandcastle` upstream itself
|
||||
# but that depends on golist existing in epel
|
||||
# https://github.com/packit/sandcastle/pull/186
|
||||
dnf download golist
|
||||
rpm2cpio golist-*.rpm | cpio -idmv
|
||||
|
||||
sed -i '/Provides: bundled(golang.*/d' $SPEC_FILE
|
||||
|
||||
GO_IMPORTS=$(golist --imported --package-path github.com/containers/$PACKAGE --skip-self | sort -u | xargs -I{} echo "Provides: bundled(golang({}))")
|
||||
|
||||
GO_IMPORTS=$(./usr/bin/golist --imported --package-path github.com/containers/$PACKAGE --skip-self | sort -u | xargs -I{} echo "Provides: bundled(golang({}))")
|
||||
awk -v r="$GO_IMPORTS" '/^# vendored libraries/ {print; print r; next} 1' $SPEC_FILE > temp && mv temp $SPEC_FILE
|
||||
|
Reference in New Issue
Block a user