mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 13:22:04 +08:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e4dfd39d6 | |||
| 6bbde70dc3 | |||
| 85e3e35e1c | |||
| ea7337ba49 | |||
| 0a32245f63 | |||
| 7a4fbabcda | |||
| b586695b85 | |||
| f66d9b1c9e | |||
| 3866bf07b1 | |||
| e269591fe1 | |||
| 2642028948 | |||
| 542451fc85 | |||
| 0c46bffe7e | |||
| fc0bfd9c52 | |||
| 8a4edc412a | |||
| 25657f9721 | |||
| e9714d4fa9 | |||
| ffcfda0ac2 | |||
| 1f65419394 | |||
| caf1148549 | |||
| 91a48cab05 | |||
| e5df2b098d | |||
| 1253e76c47 |
BIN
pkg/usr/share/icons/hicolor/scalable/apps/spark-store.png
Normal file
BIN
pkg/usr/share/icons/hicolor/scalable/apps/spark-store.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 381 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 34 KiB |
@@ -30,7 +30,7 @@ linkDir() {
|
||||
|
||||
ensureTargetDir "$targetFile"
|
||||
sourceFile=$(realpath --relative-to="$(dirname $targetFile)" "$sourceFile" )
|
||||
if [ ! -e "${targetFile}" ];then
|
||||
if [ ! -e ${targetFile} ];then
|
||||
ln -sv "$sourceFile" "$targetFile"
|
||||
fi
|
||||
done
|
||||
|
||||
38
tool/ssaudit
38
tool/ssaudit
@@ -291,42 +291,16 @@ function create_desktop_file() {
|
||||
export CURRENT_USER_DIR_DESKTOP=$(sudo -u "$user" xdg-user-dir DESKTOP)
|
||||
function exec_create_desktop_file() {
|
||||
local desktop_files=()
|
||||
local package_name_lower=$(echo "$package_name" | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# 只收集指定路径下的桌面文件
|
||||
# 1. /usr/share/applications/ 目录下的 .desktop 文件
|
||||
desktop_files+=($(dpkg -L "$package_name" 2>/dev/null | grep '^/usr/share/applications/.*\.desktop$' || true))
|
||||
|
||||
# 2. /opt/apps/包名/entries/applications/ 目录下的 .desktop 文件
|
||||
# 先尝试精确匹配包名路径
|
||||
desktop_files+=($(dpkg -L "$package_name" 2>/dev/null | grep "^/opt/apps/$package_name/entries/applications/.*\.desktop$" || true))
|
||||
|
||||
# 再尝试小写包名路径(有些包可能使用小写路径)
|
||||
desktop_files+=($(dpkg -L "$package_name" 2>/dev/null | grep "^/opt/apps/$package_name_lower/entries/applications/.*\.desktop$" || true))
|
||||
|
||||
# 如果没有找到任何符合条件的桌面文件,则直接返回
|
||||
if [ ${#desktop_files[@]} -eq 0 ]; then
|
||||
echo "未找到符合条件的桌面快捷方式文件(/usr/share/applications/ 或 /opt/apps/$package_name/entries/applications/)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "找到 ${#desktop_files[@]} 个桌面快捷方式文件:"
|
||||
printf '%s\n' "${desktop_files[@]}"
|
||||
# 收集所有桌面文件
|
||||
desktop_files+=($(dpkg -L "$package_name" | grep '/usr/share/applications/.*\.desktop$'))
|
||||
desktop_files+=($(dpkg -L "$package_name" | grep '/opt/apps/'"$package_name"'/entries/applications/.*\.desktop$'))
|
||||
|
||||
for desktop_file_path in "${desktop_files[@]}"; do
|
||||
# 检查文件是否存在
|
||||
if [ ! -f "$desktop_file_path" ]; then
|
||||
echo "文件不存在,跳过: $desktop_file_path"
|
||||
continue
|
||||
fi
|
||||
|
||||
# 检查是否是 NoDisplay=true 的桌面文件
|
||||
if [ -z "$(grep -i 'NoDisplay=true' "$desktop_file_path")" ]; then
|
||||
echo "安装桌面快捷方式: $desktop_file_path"
|
||||
if [ "$FORCE_CREATE_DESKTOP" -eq 1 ] || [ -z "$(grep 'NoDisplay=true' "$desktop_file_path")" ]; then
|
||||
echo "$desktop_file_path is checked and will be installed to desktop"
|
||||
chmod +x "$desktop_file_path"
|
||||
sudo -u "$user" cp "$desktop_file_path" "${CURRENT_USER_DIR_DESKTOP}/"
|
||||
else
|
||||
echo "跳过 NoDisplay=true 的桌面文件: $desktop_file_path"
|
||||
sudo -u "$user" cp "$desktop_file_path" "${CURRENT_USER_DIR_DESKTOP}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
@@ -291,46 +291,19 @@ function create_desktop_file() {
|
||||
export CURRENT_USER_DIR_DESKTOP=$(sudo -u "$user" xdg-user-dir DESKTOP)
|
||||
function exec_create_desktop_file() {
|
||||
local desktop_files=()
|
||||
local package_name_lower=$(echo "$package_name" | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# 只收集指定路径下的桌面文件
|
||||
# 1. /usr/share/applications/ 目录下的 .desktop 文件
|
||||
desktop_files+=($(dpkg -L "$package_name" 2>/dev/null | grep '^/usr/share/applications/.*\.desktop$' || true))
|
||||
|
||||
# 2. /opt/apps/包名/entries/applications/ 目录下的 .desktop 文件
|
||||
# 先尝试精确匹配包名路径
|
||||
desktop_files+=($(dpkg -L "$package_name" 2>/dev/null | grep "^/opt/apps/$package_name/entries/applications/.*\.desktop$" || true))
|
||||
|
||||
# 再尝试小写包名路径(有些包可能使用小写路径)
|
||||
desktop_files+=($(dpkg -L "$package_name" 2>/dev/null | grep "^/opt/apps/$package_name_lower/entries/applications/.*\.desktop$" || true))
|
||||
|
||||
# 如果没有找到任何符合条件的桌面文件,则直接返回
|
||||
if [ ${#desktop_files[@]} -eq 0 ]; then
|
||||
echo "未找到符合条件的桌面快捷方式文件(/usr/share/applications/ 或 /opt/apps/$package_name/entries/applications/)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "找到 ${#desktop_files[@]} 个桌面快捷方式文件:"
|
||||
printf '%s\n' "${desktop_files[@]}"
|
||||
# 收集所有桌面文件
|
||||
desktop_files+=($(dpkg -L "$package_name" | grep '/usr/share/applications/.*\.desktop$'))
|
||||
desktop_files+=($(dpkg -L "$package_name" | grep '/opt/apps/'"$package_name"'/entries/applications/.*\.desktop$'))
|
||||
|
||||
for desktop_file_path in "${desktop_files[@]}"; do
|
||||
# 检查文件是否存在
|
||||
if [ ! -f "$desktop_file_path" ]; then
|
||||
echo "文件不存在,跳过: $desktop_file_path"
|
||||
continue
|
||||
fi
|
||||
|
||||
# 检查是否是 NoDisplay=true 的桌面文件
|
||||
if [ -z "$(grep -i 'NoDisplay=true' "$desktop_file_path")" ]; then
|
||||
echo "安装桌面快捷方式: $desktop_file_path"
|
||||
if [ "$FORCE_CREATE_DESKTOP" -eq 1 ] || [ -z "$(grep 'NoDisplay=true' "$desktop_file_path")" ]; then
|
||||
echo "$desktop_file_path is checked and will be installed to desktop"
|
||||
chmod +x "$desktop_file_path"
|
||||
sudo -u "$user" cp "$desktop_file_path" "${CURRENT_USER_DIR_DESKTOP}/"
|
||||
else
|
||||
echo "跳过 NoDisplay=true 的桌面文件: $desktop_file_path"
|
||||
sudo -u "$user" cp "$desktop_file_path" "${CURRENT_USER_DIR_DESKTOP}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
export -f exec_create_desktop_file
|
||||
|
||||
# 在ACE环境中创建桌面快捷方式
|
||||
|
||||
Reference in New Issue
Block a user