From 19799d25f91780d8eb507754ed1ec10a63b83f52 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 10 Oct 2023 12:48:39 +0000 Subject: [PATCH] fix(apk): alpine conventional file name Signed-off-by: Carlos Alexandro Becker --- apk/apk.go | 4 ++-- apk/apk_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apk/apk.go b/apk/apk.go index a7c9c816..702d8f49 100644 --- a/apk/apk.go +++ b/apk/apk.go @@ -90,11 +90,11 @@ func (a *Apk) ConventionalFileName(info *nfpm.Info) string { version := info.Version if info.Prerelease != "" { - version += "" + info.Prerelease + version += "_" + info.Prerelease } if info.Release != "" { - version += "-" + info.Release + version += "_p" + info.Release } return fmt.Sprintf("%s_%s_%s.apk", info.Name, version, info.Arch) diff --git a/apk/apk_test.go b/apk/apk_test.go index f94bbe20..bdfd23d3 100644 --- a/apk/apk_test.go +++ b/apk/apk_test.go @@ -478,19 +478,19 @@ func TestAPKConventionalFileName(t *testing.T) { }, { Arch: "386", Version: "1.2.3", Prerelease: "git", - Expect: "default_1.2.3git_x86.apk", + Expect: "default_1.2.3_git_x86.apk", }, { Arch: "386", Version: "1.2.3", Prerelease: "git", Release: "1", - Expect: "default_1.2.3git-1_x86.apk", + Expect: "default_1.2.3_git_p1_x86.apk", }, { Arch: "all", Version: "1.2.3", Expect: "default_1.2.3_all.apk", }, { - Arch: "386", Version: "1.2.3", Release: "1", Prerelease: "beta", - Expect: "default_1.2.3beta-1_x86.apk", + Arch: "386", Version: "1.2.3", Release: "1", Prerelease: "beta1", + Expect: "default_1.2.3_beta1_p1_x86.apk", }, }