Skip to content

Commit 33a93a7

Browse files
committed
Makefile,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 33a93a7

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-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: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ 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+
export GOPROXY
34+
2835
#
2936
# Automatic Variables
3037
#
@@ -118,17 +125,22 @@ clean: ## Remove all built binaries
118125
# ./rpmbuild, using rpmbuild's usual directory structure.
119126
#
120127

121-
RPM_SPECFILE=rpmbuild/SPECS/image-builder.spec
128+
RPM_SPECFILE_NAME=image-builder.spec
129+
RPM_SPECFILE=rpmbuild/SPECS/$(RPM_SPECFILE_NAME)
122130
RPM_TARBALL=rpmbuild/SOURCES/$(PACKAGE_NAME_COMMIT).tar.gz
123131
RPM_TARBALL_VERSIONED=rpmbuild/SOURCES/$(PACKAGE_NAME_VERSION).tar.gz
124132

125133
.PHONY: $(RPM_SPECFILE)
126134
$(RPM_SPECFILE):
127135
mkdir -p $(CURDIR)/rpmbuild/SPECS
128-
git show HEAD:image-builder.spec > $(RPM_SPECFILE)
136+
git show HEAD:$(RPM_SPECFILE_NAME) > $(RPM_SPECFILE)
129137
go mod vendor
130138
./tools/rpm_spec_add_provides_bundle.sh $(RPM_SPECFILE)
131139

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

0 commit comments

Comments
 (0)