mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-10-05 01:52:20 +08:00
不再每次都 update
This commit is contained in:
parent
b708b63113
commit
930111f2df
31
tool/ssaudit
31
tool/ssaudit
@ -151,9 +151,7 @@ function hash_check() {
|
|||||||
|
|
||||||
# 确保aptss存在
|
# 确保aptss存在
|
||||||
function ensure_aptss_exist() {
|
function ensure_aptss_exist() {
|
||||||
if command -v aptss &>/dev/null; then
|
if ! command -v aptss &>/dev/null; then
|
||||||
aptss update
|
|
||||||
else
|
|
||||||
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
||||||
|
|
||||||
if ! wget -O "$deb_file" "https://amber-ce-resource.spark-app.store/store/depends/spark-store-console-in-container_latest_all.deb"; then
|
if ! wget -O "$deb_file" "https://amber-ce-resource.spark-app.store/store/depends/spark-store-console-in-container_latest_all.deb"; then
|
||||||
@ -264,19 +262,36 @@ function install_in_ace_env() {
|
|||||||
echo "----------------------------------------"
|
echo "----------------------------------------"
|
||||||
|
|
||||||
# 在ACE环境中执行安装
|
# 在ACE环境中执行安装
|
||||||
if ! $ace_cmd "ensure_aptss_exist && { dpkg -i '$deb_path' || aptss install '$deb_path' -yfq; }"; then
|
if $ace_cmd "ensure_aptss_exist && { dpkg -i '$deb_path' || aptss install '$deb_path' -yfq; }"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
# 如果第一次安装失败,执行aptss update后再试一次
|
||||||
|
echo "第一次安装失败,正在更新仓库信息后重试..."
|
||||||
|
$ace_cmd "aptss update"
|
||||||
|
if $ace_cmd "dpkg -i '$deb_path' || aptss install '$deb_path' -yfq"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 在主机安装
|
# 在主机安装
|
||||||
function install_in_host() {
|
function install_in_host() {
|
||||||
local deb_path="$1"
|
local deb_path="$1"
|
||||||
|
|
||||||
dpkg -i "$deb_path" || aptss install "$deb_path" -yfq
|
if dpkg -i "$deb_path" || aptss install "$deb_path" -yfq; then
|
||||||
return $?
|
return 0
|
||||||
|
else
|
||||||
|
# 如果第一次安装失败,执行aptss update后再试一次
|
||||||
|
echo "第一次安装失败,正在更新仓库信息后重试..."
|
||||||
|
aptss update
|
||||||
|
if dpkg -i "$deb_path" || aptss install "$deb_path" -yfq; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# 自动尝试在各种环境中安装
|
# 自动尝试在各种环境中安装
|
||||||
|
@ -151,9 +151,7 @@ function hash_check() {
|
|||||||
|
|
||||||
# 确保aptss存在
|
# 确保aptss存在
|
||||||
function ensure_aptss_exist() {
|
function ensure_aptss_exist() {
|
||||||
if command -v aptss &>/dev/null; then
|
if ! command -v aptss &>/dev/null; then
|
||||||
aptss update
|
|
||||||
else
|
|
||||||
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
||||||
|
|
||||||
if ! wget -O "$deb_file" "https://amber-ce-resource.spark-app.store/store/depends/spark-store-console-in-container_latest_all.deb"; then
|
if ! wget -O "$deb_file" "https://amber-ce-resource.spark-app.store/store/depends/spark-store-console-in-container_latest_all.deb"; then
|
||||||
@ -264,19 +262,36 @@ function install_in_ace_env() {
|
|||||||
echo "----------------------------------------"
|
echo "----------------------------------------"
|
||||||
|
|
||||||
# 在ACE环境中执行安装
|
# 在ACE环境中执行安装
|
||||||
if ! $ace_cmd "ensure_aptss_exist && { dpkg -i '$deb_path' || aptss install '$deb_path' -yfq; }"; then
|
if $ace_cmd "ensure_aptss_exist && { dpkg -i '$deb_path' || aptss install '$deb_path' -yfq; }"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
# 如果第一次安装失败,执行aptss update后再试一次
|
||||||
|
echo "第一次安装失败,正在更新仓库信息后重试..."
|
||||||
|
$ace_cmd "aptss update"
|
||||||
|
if $ace_cmd "dpkg -i '$deb_path' || aptss install '$deb_path' -yfq"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 在主机安装
|
# 在主机安装
|
||||||
function install_in_host() {
|
function install_in_host() {
|
||||||
local deb_path="$1"
|
local deb_path="$1"
|
||||||
|
|
||||||
dpkg -i "$deb_path" || aptss install "$deb_path" -yfq
|
if dpkg -i "$deb_path" || aptss install "$deb_path" -yfq; then
|
||||||
return $?
|
return 0
|
||||||
|
else
|
||||||
|
# 如果第一次安装失败,执行aptss update后再试一次
|
||||||
|
echo "第一次安装失败,正在更新仓库信息后重试..."
|
||||||
|
aptss update
|
||||||
|
if dpkg -i "$deb_path" || aptss install "$deb_path" -yfq; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# 自动尝试在各种环境中安装
|
# 自动尝试在各种环境中安装
|
||||||
|
Loading…
x
Reference in New Issue
Block a user