mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-08 20:32:21 +08:00
新增文案提示用户发生了什么
This commit is contained in:
parent
6ace772a09
commit
ad25606ef9
@ -15,6 +15,19 @@ function pkexec_as_current_user() {
|
||||
sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus pkexec "$@"
|
||||
}
|
||||
|
||||
function zenity() {
|
||||
#Detect the name of the display in use
|
||||
local display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)"
|
||||
|
||||
#Detect the user using such display
|
||||
local user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1)
|
||||
|
||||
#Detect the id of the user
|
||||
local uid=$(id -u $user)
|
||||
|
||||
sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus zenity "$@"
|
||||
}
|
||||
|
||||
#################检测文件是否存在
|
||||
if [ $# -eq 0 ];then
|
||||
echo "没有接收到参数,退出"
|
||||
@ -55,9 +68,9 @@ dpkg -i "$1" || aptss install -yf
|
||||
|
||||
else
|
||||
|
||||
echo "校验失败,该deb不是星火已经上架的软件包,这可能是因为你正在尝试安装一个尚未上架的软件包"
|
||||
echo "如果你是审核人员,这是正常的"
|
||||
echo "为确保安全,将会询问密码"
|
||||
|
||||
zenity --info --icon-name=spark-store --height 270 --width 500 --text "软件包校验失败!这不应该发生!\n可能是因为软件包已损坏,星火仓库未同步,或者最坏的情况:恶意软件尝试利用自动安装来入侵系统!\n如果你不清楚发生了什么,请在接下来的认证窗口中选择取消认证\n执行 sudo aptss ssupdate 后再尝试安装。\n如果问题仍然存在,请在应用信息界面点击 应用反馈 来提交反馈给我们!\n\n如果你是审核人员,这是正常现象,在审核通过前星火仓库不会保存相关信息。请在接下来的弹窗中进行认证即可"
|
||||
|
||||
|
||||
pkexec_as_current_user bash -c "dpkg -i "$1" || aptss install -yf "
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user