From 1912ae36e62bc384e3ec4e4367dcb53984c559d5 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Mon, 17 Jul 2023 21:11:06 +0800 Subject: [PATCH] separate system tools list --- src/SPC/doctor/item/LinuxToolCheckList.php | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/SPC/doctor/item/LinuxToolCheckList.php b/src/SPC/doctor/item/LinuxToolCheckList.php index b8b92ff0..f563e79f 100644 --- a/src/SPC/doctor/item/LinuxToolCheckList.php +++ b/src/SPC/doctor/item/LinuxToolCheckList.php @@ -15,25 +15,29 @@ class LinuxToolCheckList { use UnixSystemUtilTrait; + public const TOOLS_ALPINE = [ + 'make', 'bison', 'flex', + 'git', 'autoconf', 'automake', + 'tar', 'unzip', 'gzip', + 'bzip2', 'cmake', 'gcc', + 'g++', 'patch', + ]; + + public const TOOLS_DEBIAN = [ + 'make', 'bison', 'flex', + 'git', 'autoconf', 'automake', + 'tar', 'unzip', 'gzip', + 'bzip2', 'cmake', 'patch', + ]; + #[AsCheckItem('if necessary tools are installed', limit_os: 'Linux')] public function checkCliTools(): ?CheckResult { $distro = SystemUtil::getOSRelease(); $required = match ($distro['dist']) { - 'alpine' => [ - 'make', 'bison', 'flex', - 'git', 'autoconf', 'automake', - 'tar', 'unzip', 'gzip', - 'bzip2', 'cmake', 'gcc', - 'g++', 'patch', - ], - default => [ - 'make', 'bison', 'flex', - 'git', 'autoconf', 'automake', - 'tar', 'unzip', 'gzip', - 'bzip2', 'cmake', 'patch', - ], + 'alpine' => self::TOOLS_ALPINE, + default => self::TOOLS_DEBIAN, }; $missing = []; foreach ($required as $cmd) {