From 1e05aa0f38aa49294386d70cb703d0854a448eb4 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 10 Jan 2025 18:15:33 +0800 Subject: [PATCH] update utils --- core/xim/base/utils.lua | 2 +- core/xim/pm/wrapper/aur.lua | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/xim/base/utils.lua b/core/xim/base/utils.lua index accfe1e..c18a95c 100644 --- a/core/xim/base/utils.lua +++ b/core/xim/base/utils.lua @@ -114,7 +114,7 @@ function local_package_manager() pm = "winget" elseif osinfo.name == "ubuntu" then pm = "apt" - elseif osinfo.name == "archlinux" then + elseif osinfo.name == "archlinux" or osinfo.name == "manjaro" then pm = "pacman" elseif is_host("macosx") then -- TODO diff --git a/core/xim/pm/wrapper/aur.lua b/core/xim/pm/wrapper/aur.lua index 2ec40c0..0c324c4 100644 --- a/core/xim/pm/wrapper/aur.lua +++ b/core/xim/pm/wrapper/aur.lua @@ -23,16 +23,18 @@ function install(name) -- 克隆 AUR 仓库 if not os.isdir(name) then local git_url = to_git_url(name) + cprint("cloning %s...", git_url) os.run("git clone %s", git_url) os.cd(name) else - cpint("%s already exists, try to update...", name) + cprint("${bright}%s${clear} already exists, try to update...", name) os.cd(name) os.run("git pull") end -- 构建并安装包 - os.run("makepkg -si") + cprint("building %s...", name) + os.exec("makepkg -si") return true end @@ -42,6 +44,11 @@ function uninstall(name) end function info(name) + + if installed(name) then + return pacman.info(name) + end + local info = aur_info(name) return format([[ ${bright}[ XVM-AUR Package Info ]${clear}