From aa94ce1740d5122d11dfb3bc10a4be892da99245 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Sun, 28 Apr 2024 17:17:29 +0100 Subject: [PATCH] build: ensure KDE Neon is in the supported dist list. See #312 --- pkg/prebuild/cfg/os.go | 2 +- pkg/prebuild/cfg/os_test.go | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pkg/prebuild/cfg/os.go b/pkg/prebuild/cfg/os.go index 17713c6a6..b742a3988 100644 --- a/pkg/prebuild/cfg/os.go +++ b/pkg/prebuild/cfg/os.go @@ -23,7 +23,7 @@ var ( supportedDists = map[string][]string{ "arch": {}, "debian": {}, - "ubuntu": {}, + "ubuntu": {"neon"}, "opensuse": {"suse", "opensuse-tumbleweed"}, "whonix": {}, } diff --git a/pkg/prebuild/cfg/os_test.go b/pkg/prebuild/cfg/os_test.go index b0fbd050f..9ab45925c 100644 --- a/pkg/prebuild/cfg/os_test.go +++ b/pkg/prebuild/cfg/os_test.go @@ -67,6 +67,20 @@ PLATFORM_ID="platform:f37" PRETTY_NAME="Fedora Linux 37 (Workstation Edition)" ANSI_COLOR="0;38;2;60;110;180" LOGO=fedora-logo-icon` + + osReleaseNeon = `PRETTY_NAME="KDE neon 6.0" +NAME="KDE neon" +VERSION_ID="22.04" +VERSION="6.0" +VERSION_CODENAME=jammy +ID=neon +ID_LIKE="ubuntu debian" +HOME_URL="https://neon.kde.org/" +SUPPORT_URL="https://neon.kde.org/" +BUG_REPORT_URL="https://bugs.kde.org/" +PRIVACY_POLICY_URL="https://kde.org/privacypolicy/" +UBUNTU_CODENAME=jammy +LOGO=start-here-kde-neon` ) func Test_getOSRelease(t *testing.T) { @@ -156,6 +170,11 @@ func Test_getDistribution(t *testing.T) { osRelease: osReleaseFedora, want: "fedora", }, + { + name: "Neon", + osRelease: osReleaseNeon, + want: "neon", + }, } osReleaseFile = "/tmp/os-release" @@ -200,6 +219,11 @@ func Test_getFamily(t *testing.T) { dist: "opensuse", want: "zypper", }, + { + name: "Neon", + dist: "neon", + want: "", + }, } for _, tt := range tests {