mirror of
https://gitee.com/amber-ce/amber-pm
synced 2025-12-17 10:51:36 +08:00
1.0.7 修复直接安装在主机时无法找到图标
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
Package: apm
|
||||
Version: 1.0
|
||||
Version: 1.1
|
||||
Maintainer: shenmo <jifengshenmo@outlook.com>
|
||||
Priority: optional
|
||||
Section: utils
|
||||
|
||||
@@ -114,9 +114,52 @@ function exec_uos_package_update(){
|
||||
|
||||
}
|
||||
|
||||
function exec_debian_compatibile_links(){
|
||||
# 源目录和目标目录定义
|
||||
local SOURCE_DIR="/var/lib/apm"
|
||||
local TARGET_DIR="/var/lib/apm/apm/files/ace-env/var/lib/apm"
|
||||
|
||||
# 检查目标目录是否存在
|
||||
if [[ ! -d "$TARGET_DIR" ]]; then
|
||||
mkdir -p $TARGET_DIR
|
||||
fi
|
||||
|
||||
# 第一部分:为缺失的目录创建软链接
|
||||
echo "检查并创建缺失的软链接..."
|
||||
for dir in "$SOURCE_DIR"/*/; do
|
||||
# 获取目录名(去掉路径和尾部斜杠)
|
||||
dirname=$(basename "$dir")
|
||||
|
||||
# 跳过 apm 目录
|
||||
if [[ "$dirname" == "apm" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# 检查目标目录中是否已存在对应的软链接或目录
|
||||
target_link="$TARGET_DIR/$dirname"
|
||||
if [[ ! -e "$target_link" ]]; then
|
||||
echo "创建软链接: $target_link -> $dir"
|
||||
ln -sv "$dir" "$target_link"
|
||||
fi
|
||||
done
|
||||
|
||||
# 第二部分:清理无效的软链接
|
||||
echo "清理无效的软链接..."
|
||||
for link in "$TARGET_DIR"/*; do
|
||||
# 检查是否为软链接
|
||||
if [[ -L "$link" ]]; then
|
||||
# 检查软链接是否有效(指向的目标是否存在)
|
||||
if [[ ! -e "$link" ]]; then
|
||||
echo "删除无效软链接: $link"
|
||||
rm "$link"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
#########################################################################################
|
||||
echo "----------------Running APM Dstore Patch----------------"
|
||||
|
||||
# execute linkApp function for each app and print output
|
||||
exec_uos_package_link
|
||||
|
||||
|
||||
@@ -124,4 +167,8 @@ exec_uos_package_link
|
||||
exec_link_clean
|
||||
wait
|
||||
exec_uos_package_update
|
||||
if [[ "${IS_APM_ENV}" = "" ]];then
|
||||
exec_debian_compatibile_links
|
||||
fi
|
||||
|
||||
echo "----------------Finished----------------"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
Package: apm
|
||||
Source: amber-ce
|
||||
Version: 1.0.6
|
||||
Version: 1.0.7
|
||||
Architecture: amd64
|
||||
Maintainer: shenmo <shenmo@spark-app.store>
|
||||
Installed-Size: 48540
|
||||
Installed-Size: 49036
|
||||
Depends: bubblewrap, flatpak, policykit-1 | pkexec | polkit-1 | polkit, systemd, procps,coreutils,fuse-overlayfs
|
||||
Section: misc
|
||||
Conflicts: ace-host-integration
|
||||
|
||||
@@ -114,6 +114,48 @@ function exec_uos_package_update(){
|
||||
|
||||
}
|
||||
|
||||
function exec_debian_compatibile_links(){
|
||||
# 源目录和目标目录定义
|
||||
local SOURCE_DIR="/var/lib/apm"
|
||||
local TARGET_DIR="/var/lib/apm/apm/files/ace-env/var/lib/apm"
|
||||
|
||||
# 检查目标目录是否存在
|
||||
if [[ ! -d "$TARGET_DIR" ]]; then
|
||||
mkdir -p $TARGET_DIR
|
||||
fi
|
||||
|
||||
# 第一部分:为缺失的目录创建软链接
|
||||
echo "检查并创建缺失的软链接..."
|
||||
for dir in "$SOURCE_DIR"/*/; do
|
||||
# 获取目录名(去掉路径和尾部斜杠)
|
||||
dirname=$(basename "$dir")
|
||||
|
||||
# 跳过 apm 目录
|
||||
if [[ "$dirname" == "apm" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# 检查目标目录中是否已存在对应的软链接或目录
|
||||
target_link="$TARGET_DIR/$dirname"
|
||||
if [[ ! -e "$target_link" ]]; then
|
||||
echo "创建软链接: $target_link -> $dir"
|
||||
ln -sv "$dir" "$target_link"
|
||||
fi
|
||||
done
|
||||
|
||||
# 第二部分:清理无效的软链接
|
||||
echo "清理无效的软链接..."
|
||||
for link in "$TARGET_DIR"/*; do
|
||||
# 检查是否为软链接
|
||||
if [[ -L "$link" ]]; then
|
||||
# 检查软链接是否有效(指向的目标是否存在)
|
||||
if [[ ! -e "$link" ]]; then
|
||||
echo "删除无效软链接: $link"
|
||||
rm "$link"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
#########################################################################################
|
||||
echo "----------------Running APM Dstore Patch----------------"
|
||||
|
||||
@@ -125,4 +167,8 @@ exec_uos_package_link
|
||||
exec_link_clean
|
||||
wait
|
||||
exec_uos_package_update
|
||||
if [[ "${IS_APM_ENV}" = "" ]];then
|
||||
exec_debian_compatibile_links
|
||||
fi
|
||||
|
||||
echo "----------------Finished----------------"
|
||||
|
||||
@@ -21,6 +21,7 @@ Commands:
|
||||
install 安装软件包
|
||||
remove 卸载软件包
|
||||
update 更新软件包信息
|
||||
download 下载包
|
||||
clean 清除缓存软件包
|
||||
autoremove 自动移除不需要的包
|
||||
full-upgrade 完全升级软件包
|
||||
@@ -110,13 +111,21 @@ case "$1" in
|
||||
command=$1
|
||||
shift
|
||||
amber-pm-debug aptss "$command" "$@"
|
||||
amber-pm-debug amber-pm-dstore-patch
|
||||
apm-nvidia-toggle
|
||||
;;
|
||||
remove|autoremove|search|policy|list|update|purge|autopurge|clean)
|
||||
download|search|policy|list|update|clean)
|
||||
command=$1
|
||||
shift
|
||||
amber-pm-debug aptss "$command" "$@"
|
||||
;;
|
||||
|
||||
remove|autoremove|purge|autopurge)
|
||||
# 特殊APT命令:移除第一个参数后传递其余参数
|
||||
command=$1
|
||||
shift
|
||||
amber-pm-debug aptss "$command" "$@"
|
||||
amber-pm-debug amber-pm-dstore-patch
|
||||
;;
|
||||
run)
|
||||
# 运行包命令:第二个参数必须是包名
|
||||
|
||||
Reference in New Issue
Block a user