From 61e43c71f2053a866501e6b697e0ba17f21483d1 Mon Sep 17 00:00:00 2001 From: Ville Aikas Date: Thu, 7 Sep 2023 13:29:26 -0700 Subject: [PATCH] construct the package.full-version in higher context than just pipeline. Signed-off-by: Ville Aikas --- pkg/config/config.go | 1 + pkg/config/config_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/pkg/config/config.go b/pkg/config/config.go index dd204611a..822b13aae 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -474,6 +474,7 @@ func buildConfigMap(cfg *Configuration) map[string]string { SubstitutionPackageVersion: cfg.Package.Version, SubstitutionPackageDescription: cfg.Package.Description, SubstitutionPackageEpoch: strconv.FormatUint(cfg.Package.Epoch, 10), + SubstitutionPackageFullVersion: fmt.Sprintf("%s-r%d", cfg.Package.Version, cfg.Package.Epoch), } for k, v := range cfg.Vars { diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 3b2cb8410..19f17803e 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -14,12 +14,14 @@ func Test_applySubstitutionsInProvides(t *testing.T) { package: name: replacement-provides version: 0.0.1 + epoch: 7 description: example using a replacement in provides dependencies: provides: - replacement-provides-version=${{package.version}} - replacement-provides-foo=${{vars.foo}} - replacement-provides-bar=${{vars.bar}} + - replacement-provides=${{package.full-version}} vars: foo: FOO @@ -43,6 +45,7 @@ subpackages: "replacement-provides-version=0.0.1", "replacement-provides-foo=FOO", "replacement-provides-bar=BAR", + "replacement-provides=0.0.1-r7", }, cfg.Package.Dependencies.Provides) require.Equal(t, []string{