Skip to content

Commit 7f40ccf

Browse files
committed
packit: setup GOPROXY without 'gatekeeping'
We don't need 'gatekeeping' functionality but rather prefer more robust downloading. This also moves the implementation to the Makefile to have it more central.
1 parent 54d9ab4 commit 7f40ccf

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.packit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ srpm_build_deps:
1717
actions:
1818
# v1 just the default prior to having tags
1919
get-current-version: bash -c "make show-version"
20-
post-upstream-clone: bash -c "GOPROXY=https://proxy.golang.org,direct go mod vendor && ./tools/rpm_spec_add_provides_bundle.sh"
20+
post-upstream-clone: bash -c "make patch-spec-in-place"
2121
create-archive: bash -c "make release_artifacts"
2222

2323
# Handle only releases without a "dot" (e.g. v88.2), since "dot" releases should never be released to Fedora

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ RST2MAN ?= rst2man
2525
GOLANGCI_LINT_VERSION=v1.55
2626
GOLANGCI_LINT_CACHE_DIR=$(HOME)/.cache/golangci-lint/$(GOLANGCI_LINT_VERSION)
2727
GOLANGCI_COMPOSER_IMAGE=composer_golangci
28+
29+
# Using pipe instead of comma as we don't need the
30+
# 'gatekeeper' functionality, it should just work.
31+
# https://go.dev/ref/mod#module-proxy
32+
GOPROXY?="https://proxy.golang.org|direct"
33+
2834
#
2935
# Automatic Variables
3036
#
@@ -118,17 +124,22 @@ clean: ## Remove all built binaries
118124
# ./rpmbuild, using rpmbuild's usual directory structure.
119125
#
120126

121-
RPM_SPECFILE=rpmbuild/SPECS/image-builder.spec
127+
RPM_SPECFILE_NAME=image-builder.spec
128+
RPM_SPECFILE=rpmbuild/SPECS/$(RPM_SPECFILE_NAME)
122129
RPM_TARBALL=rpmbuild/SOURCES/$(PACKAGE_NAME_COMMIT).tar.gz
123130
RPM_TARBALL_VERSIONED=rpmbuild/SOURCES/$(PACKAGE_NAME_VERSION).tar.gz
124131

125132
.PHONY: $(RPM_SPECFILE)
126133
$(RPM_SPECFILE):
127134
mkdir -p $(CURDIR)/rpmbuild/SPECS
128-
git show HEAD:image-builder.spec > $(RPM_SPECFILE)
135+
git show HEAD:$(RPM_SPECFILE_NAME) > $(RPM_SPECFILE)
129136
go mod vendor
130137
./tools/rpm_spec_add_provides_bundle.sh $(RPM_SPECFILE)
131138

139+
.PHONY: patch-spec-in-place
140+
patch-spec-in-place: $(RPM_SPECFILE) ## patch image-builder.spec in-place for build systems
141+
cp $< $(RPM_SPECFILE_NAME)
142+
132143
# This is the syntax to essentially get
133144
# either PACKAGE_NAME_COMMIT or PACKAGE_NAME_VERSION dynamically
134145
define get_package_name

0 commit comments

Comments
 (0)