Skip to content

Commit 24439cd

Browse files
committed
[CI:BUILD] Packit: downstream task action fix
The downstream `pre-sync` task action script needs GOPATH to be specified for the golist tool mentioned in the script to work. [NO NEW TESTS NEEDED] Signed-off-by: Lokesh Mandvekar <[email protected]> (cherry picked from commit 12dc546) Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent 981e532 commit 24439cd

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

rpm/update-spec-provides.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,26 @@
44
# packaging, via the `propose-downstream` packit action.
55
# The goimports don't need to be present upstream.
66

7-
set -eo pipefail
7+
set -eox pipefail
88

99
PACKAGE=podman
1010
# script is run from git root directory
1111
SPEC_FILE=rpm/$PACKAGE.spec
1212

13-
sed -i '/Provides: bundled(golang.*/d' $SPEC_FILE
13+
export GOPATH=~/go
14+
GOPATHDIR=$GOPATH/src/github.com/containers/
15+
mkdir -p $GOPATHDIR
16+
ln -sf $(pwd) $GOPATHDIR/.
17+
18+
# Packit sandbox doesn't allow root
19+
# Install golist by downloading and extracting rpm
20+
# We could handle this in packit `sandcastle` upstream itself
21+
# but that depends on golist existing in epel
22+
# https://github.com/packit/sandcastle/pull/186
23+
dnf download golist
24+
rpm2cpio golist-*.rpm | cpio -idmv
1425

15-
GO_IMPORTS=$(golist --imported --package-path github.com/containers/$PACKAGE --skip-self | sort -u | xargs -I{} echo "Provides: bundled(golang({}))")
26+
sed -i '/Provides: bundled(golang.*/d' $SPEC_FILE
1627

28+
GO_IMPORTS=$(./usr/bin/golist --imported --package-path github.com/containers/$PACKAGE --skip-self | sort -u | xargs -I{} echo "Provides: bundled(golang({}))")
1729
awk -v r="$GO_IMPORTS" '/^# vendored libraries/ {print; print r; next} 1' $SPEC_FILE > temp && mv temp $SPEC_FILE

0 commit comments

Comments
 (0)