修复:vim-common卸载失败

This commit is contained in:
shenmo 2023-11-15 16:55:17 +08:00
parent f89f92533f
commit caadd5d785
2 changed files with 7 additions and 7 deletions
src
DEBIAN
opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin

@ -4,5 +4,5 @@ Section: misc
Priority: optional Priority: optional
Depends: bubblewrap,flatpak,zenity,policykit-1 Depends: bubblewrap,flatpak,zenity,policykit-1
Maintainer: shenmo <shenmo@spark-app.store> Maintainer: shenmo <shenmo@spark-app.store>
Architecture: amd64 Architecture: arm64
Description: bwrap wrapper for install and running debs inside a bookworm container Description: bwrap wrapper for install and running debs inside a bookworm container

@ -42,7 +42,7 @@ if [ -f "$DPKG_INFO_PATH/$PKGNAME_GUESS.list" ]; then
elif ls "$DPKG_INFO_PATH/${PKGNAME_GUESS}:*.list" 1> /dev/null 2>&1; then elif ls "$DPKG_INFO_PATH/${PKGNAME_GUESS}:*.list" 1> /dev/null 2>&1; then
DPKG_LIST_FILE=$(ls "$DPKG_INFO_PATH/${PKGNAME_GUESS}:*.list" | head -n 1) DPKG_LIST_FILE=$(ls "$DPKG_INFO_PATH/${PKGNAME_GUESS}:*.list" | head -n 1)
else else
echo "No dpkg list file found for $PKGNAME_GUESS.desktop,try to scan to search for the package" echo "Warn:No dpkg list file found for $PKGNAME_GUESS.desktop,try to scan to search for the package"
fi fi
# 验证文件并执行操作 # 验证文件并执行操作
@ -53,17 +53,17 @@ if [ -f "$DPKG_LIST_FILE" ]; then
ret=$? ret=$?
if [ "$ret" = "0" ];then if [ "$ret" = "0" ];then
echo "Operation succeeded." echo "Operation succeeded."
exit
else else
echo "Operation failed." echo "Operation failed."
exit $ret exit $ret
fi fi
else else
echo "Error: Path not found in the dpkg list file." echo "Warn: Path not found in the dpkg list file,try to scan to search for the package"
exit 1
fi fi
else fi
# 遍历所有list文件 # 遍历所有list文件 As fallback
for file in "$DPKG_INFO_PATH"/*.list; do for file in "$DPKG_INFO_PATH"/*.list; do
if grep -q "$IN_CONTAINER_PATH" "$file"; then if grep -q "$IN_CONTAINER_PATH" "$file"; then
PKGNAME_GUESS=$(basename "$file" .list | cut -d':' -f1) PKGNAME_GUESS=$(basename "$file" .list | cut -d':' -f1)
@ -82,5 +82,5 @@ else
done done
echo "Error: No matching package found." echo "Error: No matching package found."
exit 1 exit 1
fi