feat: ssaudit功能同步

feat: 修复翻译问题和缺fi
This commit is contained in:
shenmo 2023-10-31 22:17:52 +08:00
parent 7bde95a65c
commit 4de6b167da
9 changed files with 182 additions and 97 deletions

@ -1,50 +1,134 @@
#!/bin/bash
echo "Spark Store Audit script.星火商店审核脚本"
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
load_transhell_debug
case $(arch) in
x86_64)
STORE_URL="store"
;;
aarch64)
STORE_URL="aarch64-store"
;;
esac
echo "Spark Store Install script. 星火商店安装脚本"
function pkexec_as_current_user() {
local user=$(who | awk '{print $1}' | head -n 1)
local uid=$(id -u "$user")
sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus pkexec "$@"
}
function create_desktop_file() {
if [ -e $(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-show-upgrade-notify ];then
echo "It is configured that do not create desktop file. Give up"
else
create_desktop_file
fi
]
function exec_create_desktop_file() {
local user=$(who | awk '{print $1}' | head -n 1)
for desktop_file_path in $(dpkg -L "$package_name" | grep .desktop); do
if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then
echo $desktop_file_path is checked and will be installed to desktop
sudo -u "$user" cp "$desktop_file_path" "$(sudo -u "$user" xdg-user-dir DESKTOP)/"
fi
done
}
function zenity() {
local user=$(who | awk '{print $1}' | head -n 1)
local uid=$(id -u "$user")
sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus zenity "$@"
}
function hash_check() {
if [ ! -e "/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \
[ ! -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \
[ ! -e "/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages" ]; then
echo "接收星火仓库软件信息中..."
aptss ssupdate
fi
if [ -e "/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then
PACKAGES_DATA_PATH="/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages"
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH是星火域名单目录仓库配置"
elif [ -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then
PACKAGES_DATA_PATH="/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages"
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH是星火域名单目录仓库配置"
else
PACKAGES_DATA_PATH="/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages"
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH是SDU镜像仓库配置"
fi
echo "正在运行包验证..."
echo "Running Spark Package Verify..."
DEB_SHA512SUM=$(sha512sum "$1" | cut -d ' ' -f 1)
IS_SHA512SUM_CHECKED=$(cat "$PACKAGES_DATA_PATH" | grep "$DEB_SHA512SUM")
}
#################检测文件是否存在
if [ $# -eq 0 ];then
echo "没有接收到参数,退出"
echo "用法:$0 deb路径"
exit
fi
if [ ! -f "$1" ]
then
echo "文件不存在"
exit 1
fi
####################################
if [ "$(id -u)" != "0" ];then
#############################无root权限时
echo "请使用root启动ssaudit"
exit 1
fi
###
DEBPATH=`realpath $1`
echo ------------------------------------------------------------
try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH")
try_run_ret="$?"
if [ "$try_run_ret" -ne 0 ]
then
if [ $# -eq 0 ]; then
echo "没有接收到参数,退出"
echo "用法:$0 deb路径"
echo "OMG-IT-GOES-WRONG"
echo -e "${try_run_output}"
exit "$try_run_ret"
fi
exit
fi
dpkg -i "$DEBPATH" || aptss install -yf
install_ret="$?"
if [ "$install_ret" -ne 0 ]
then
if [ ! -f "$1" ]; then
echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST}"
echo "OMG-IT-GOES-WRONG"
exit "$install_ret"
fi
echo ---------------安装结束---------------
exit 1
fi
if [ "$(id -u)" != "0" ]; then
echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}"
echo "OMG-IT-GOES-WRONG"
exit 1
fi
DEBPATH=$(realpath "$1")
package_name=$(dpkg-deb -f "$DEBPATH" Package)
echo "Package name is $package_name"
try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH")
try_run_ret="$?"
if [ "$try_run_ret" -ne 0 ]; then
echo "OMG-IT-GOES-WRONG"
echo -e "${try_run_output}"
exit "$try_run_ret"
fi
dpkg -i "$DEBPATH" || aptss install -yf
if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then
if dpkg -s "$package_name" >/dev/null 2>&1; then
echo "软件包已安装:$package_name"
create_desktop_file
rm "$DEBPATH"
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
else
echo "软件包未安装:$package_name"
echo "安装异常!抛出错误"
echo "OMG-IT-GOES-WRONG"
fi
else
echo "${TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB}"
if dpkg -s "$package_name" >/dev/null 2>&1; then
echo "软件包已安装:$package_name"
create_desktop_file
else
echo "软件包未安装:$package_name"
echo "安装异常!抛出错误"
echo "OMG-IT-GOES-WRONG"
fi
fi

@ -24,7 +24,7 @@ fi
update_transhell
option=`zenity --list --text="${TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN}" --column 数字 --column=${TRANSHELL_CONTENT_OPTIONS} --print-column=2 --height 350 --width 760 0 "${TRANSHELL_CONTENT_OPEN_OR_CLOSE_UPGRADE_CHECK}" 1 "${CONTENT_SET_CREATE_DESKTOP}" 2 "${TRANSHELL_CONTENT_CHECK_FOR_UPDATE}" 3 "${TRANSHELL_CONTENT_EXIT}" --hide-column=1 --print-column=1`
option=$(zenity --list --text="${TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN}" --column 数字 --column=${TRANSHELL_CONTENT_OPTIONS} --print-column=2 --height 350 --width 760 0 "${TRANSHELL_CONTENT_OPEN_OR_CLOSE_UPGRADE_CHECK}" 1 "${CONTENT_SET_CREATE_DESKTOP}" 2 "${TRANSHELL_CONTENT_CHECK_FOR_UPDATE}" 3 "${TRANSHELL_CONTENT_EXIT}" --hide-column=1 --print-column=1)
case $option in
0)
@ -45,6 +45,7 @@ case $option in
else
rm -f $HOME/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop
zenity --info --icon-name=spark-store --height 150 --width 200 --text "${TRANSHELL_CONTENT_OPENED}" --timeout=2
fi
;;
2)
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh

@ -480,33 +480,33 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="189"/>
<location filename="../src/mainwindow-dtk.cpp" line="188"/>
<source>Submit App</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="190"/>
<location filename="../src/mainwindow-dtk.cpp" line="189"/>
<source>Submit App with client(Recommanded)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="191"/>
<location filename="../src/mainwindow-dtk.cpp" line="190"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="192"/>
<location filename="../src/mainwindow-dtk.cpp" line="191"/>
<source>APP Upgrade and Install Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="148"/>
<location filename="../src/mainwindow-dtk.cpp" line="243"/>
<location filename="../src/mainwindow-dtk.cpp" line="147"/>
<location filename="../src/mainwindow-dtk.cpp" line="242"/>
<source>Spark Store</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="153"/>
<location filename="../src/mainwindow-dtk.cpp" line="152"/>
<source>Search or enter spk://</source>
<translation type="unfinished"></translation>
</message>
@ -516,7 +516,7 @@
<message>
<location filename="../src/application.cpp" line="35"/>
<location filename="../src/application.cpp" line="36"/>
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
<location filename="../src/mainwindow-dtk.cpp" line="126"/>
<source>Spark Store</source>
<translation type="unfinished"></translation>
</message>
@ -536,7 +536,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="246"/>
<location filename="../src/mainwindow-dtk.cpp" line="245"/>
<source>Show MainWindow</source>
<translation type="unfinished"></translation>
</message>
@ -658,12 +658,12 @@
<context>
<name>TitleBarMenu</name>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="247"/>
<location filename="../src/mainwindow-dtk.cpp" line="246"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="248"/>
<location filename="../src/mainwindow-dtk.cpp" line="247"/>
<source>Exit</source>
<translation type="unfinished"></translation>
</message>

@ -480,33 +480,33 @@
<translation>Actualización de app</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="189"/>
<location filename="../src/mainwindow-dtk.cpp" line="188"/>
<source>Submit App</source>
<translation>Presentación de la aplicación</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="190"/>
<location filename="../src/mainwindow-dtk.cpp" line="189"/>
<source>Submit App with client(Recommanded)</source>
<translation>Enviar la aplicación al cliente (recomendación)</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="191"/>
<location filename="../src/mainwindow-dtk.cpp" line="190"/>
<source>Settings</source>
<translation>Configuración</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="192"/>
<location filename="../src/mainwindow-dtk.cpp" line="191"/>
<source>APP Upgrade and Install Settings</source>
<translation>Actualización e instalación de app</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="148"/>
<location filename="../src/mainwindow-dtk.cpp" line="243"/>
<location filename="../src/mainwindow-dtk.cpp" line="147"/>
<location filename="../src/mainwindow-dtk.cpp" line="242"/>
<source>Spark Store</source>
<translation>SPARK Store</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="153"/>
<location filename="../src/mainwindow-dtk.cpp" line="152"/>
<source>Search or enter spk://</source>
<translation>Buscar o introducir spk: /%</translation>
</message>
@ -516,7 +516,7 @@
<message>
<location filename="../src/application.cpp" line="35"/>
<location filename="../src/application.cpp" line="36"/>
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
<location filename="../src/mainwindow-dtk.cpp" line="126"/>
<source>Spark Store</source>
<translation>SPARK Store</translation>
</message>
@ -536,7 +536,7 @@
<translation>Descargar lista</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="246"/>
<location filename="../src/mainwindow-dtk.cpp" line="245"/>
<source>Show MainWindow</source>
<translation>Mostrar la ventana principal</translation>
</message>
@ -658,12 +658,12 @@
<context>
<name>TitleBarMenu</name>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="247"/>
<location filename="../src/mainwindow-dtk.cpp" line="246"/>
<source>About</source>
<translation>Sobre</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="248"/>
<location filename="../src/mainwindow-dtk.cpp" line="247"/>
<source>Exit</source>
<translation>Exportaciones</translation>
</message>

@ -480,33 +480,33 @@
<translation>Mise à niveau app</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="189"/>
<location filename="../src/mainwindow-dtk.cpp" line="188"/>
<source>Submit App</source>
<translation>Soumettre une application</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="190"/>
<location filename="../src/mainwindow-dtk.cpp" line="189"/>
<source>Submit App with client(Recommanded)</source>
<translation>Soumettre une demande au client (recommandé)</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="191"/>
<location filename="../src/mainwindow-dtk.cpp" line="190"/>
<source>Settings</source>
<translation>Paramètres</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="192"/>
<location filename="../src/mainwindow-dtk.cpp" line="191"/>
<source>APP Upgrade and Install Settings</source>
<translation>Paramètres de mise à niveau et d&apos;installation de l&apos;app</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="148"/>
<location filename="../src/mainwindow-dtk.cpp" line="243"/>
<location filename="../src/mainwindow-dtk.cpp" line="147"/>
<location filename="../src/mainwindow-dtk.cpp" line="242"/>
<source>Spark Store</source>
<translation>Le Spark store</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="153"/>
<location filename="../src/mainwindow-dtk.cpp" line="152"/>
<source>Search or enter spk://</source>
<translation>Rechercher ou entrer SPK /</translation>
</message>
@ -516,7 +516,7 @@
<message>
<location filename="../src/application.cpp" line="35"/>
<location filename="../src/application.cpp" line="36"/>
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
<location filename="../src/mainwindow-dtk.cpp" line="126"/>
<source>Spark Store</source>
<translation>Le Spark store</translation>
</message>
@ -536,7 +536,7 @@
<translation>Télécharger la Liste</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="246"/>
<location filename="../src/mainwindow-dtk.cpp" line="245"/>
<source>Show MainWindow</source>
<translation>Afficher la fenêtre principale</translation>
</message>
@ -658,12 +658,12 @@
<context>
<name>TitleBarMenu</name>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="247"/>
<location filename="../src/mainwindow-dtk.cpp" line="246"/>
<source>About</source>
<translation>À propos</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="248"/>
<location filename="../src/mainwindow-dtk.cpp" line="247"/>
<source>Exit</source>
<translation>Exportations</translation>
</message>

@ -480,33 +480,33 @@
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="189"/>
<location filename="../src/mainwindow-dtk.cpp" line="188"/>
<source>Submit App</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="190"/>
<location filename="../src/mainwindow-dtk.cpp" line="189"/>
<source>Submit App with client(Recommanded)</source>
<translation>使稿</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="191"/>
<location filename="../src/mainwindow-dtk.cpp" line="190"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="192"/>
<location filename="../src/mainwindow-dtk.cpp" line="191"/>
<source>APP Upgrade and Install Settings</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="148"/>
<location filename="../src/mainwindow-dtk.cpp" line="243"/>
<location filename="../src/mainwindow-dtk.cpp" line="147"/>
<location filename="../src/mainwindow-dtk.cpp" line="242"/>
<source>Spark Store</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="153"/>
<location filename="../src/mainwindow-dtk.cpp" line="152"/>
<source>Search or enter spk://</source>
<translation></translation>
</message>
@ -516,7 +516,7 @@
<message>
<location filename="../src/application.cpp" line="35"/>
<location filename="../src/application.cpp" line="36"/>
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
<location filename="../src/mainwindow-dtk.cpp" line="126"/>
<source>Spark Store</source>
<translation></translation>
</message>
@ -536,7 +536,7 @@
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="246"/>
<location filename="../src/mainwindow-dtk.cpp" line="245"/>
<source>Show MainWindow</source>
<translation></translation>
</message>
@ -658,12 +658,12 @@
<context>
<name>TitleBarMenu</name>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="247"/>
<location filename="../src/mainwindow-dtk.cpp" line="246"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="248"/>
<location filename="../src/mainwindow-dtk.cpp" line="247"/>
<source>Exit</source>
<translation>退</translation>
</message>

@ -480,33 +480,33 @@
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="189"/>
<location filename="../src/mainwindow-dtk.cpp" line="188"/>
<source>Submit App</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="190"/>
<location filename="../src/mainwindow-dtk.cpp" line="189"/>
<source>Submit App with client(Recommanded)</source>
<translation>()</translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="191"/>
<location filename="../src/mainwindow-dtk.cpp" line="190"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="192"/>
<location filename="../src/mainwindow-dtk.cpp" line="191"/>
<source>APP Upgrade and Install Settings</source>
<translation> </translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="148"/>
<location filename="../src/mainwindow-dtk.cpp" line="243"/>
<location filename="../src/mainwindow-dtk.cpp" line="147"/>
<location filename="../src/mainwindow-dtk.cpp" line="242"/>
<source>Spark Store</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="153"/>
<location filename="../src/mainwindow-dtk.cpp" line="152"/>
<source>Search or enter spk://</source>
<translation></translation>
</message>
@ -516,7 +516,7 @@
<message>
<location filename="../src/application.cpp" line="35"/>
<location filename="../src/application.cpp" line="36"/>
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
<location filename="../src/mainwindow-dtk.cpp" line="126"/>
<source>Spark Store</source>
<translation></translation>
</message>
@ -536,7 +536,7 @@
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="246"/>
<location filename="../src/mainwindow-dtk.cpp" line="245"/>
<source>Show MainWindow</source>
<translation></translation>
</message>
@ -658,12 +658,12 @@
<context>
<name>TitleBarMenu</name>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="247"/>
<location filename="../src/mainwindow-dtk.cpp" line="246"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow-dtk.cpp" line="248"/>
<location filename="../src/mainwindow-dtk.cpp" line="247"/>
<source>Exit</source>
<translation>退</translation>
</message>