adjust: modify dstore patch

This commit is contained in:
2024-04-17 16:47:30 +08:00
parent 804db2e623
commit e0a62a88d9
4 changed files with 23 additions and 15 deletions

View File

@@ -29,7 +29,7 @@ case "$1" in
# Check if /usr/local/bin existed # Check if /usr/local/bin existed
mkdir -p /usr/local/bin mkdir -p /usr/local/bin
## I hate /usr/local/bin. We will abandon them later
# Create symbol links for binary files # Create symbol links for binary files
ln -s -f /opt/durapps/spark-store/bin/spark-store /usr/local/bin/spark-store ln -s -f /opt/durapps/spark-store/bin/spark-store /usr/local/bin/spark-store
ln -s -f /opt/durapps/spark-store/bin/ssinstall /usr/local/bin/ssinstall ln -s -f /opt/durapps/spark-store/bin/ssinstall /usr/local/bin/ssinstall
@@ -37,6 +37,7 @@ case "$1" in
ln -s -f /opt/durapps/spark-store/bin/ssinstall /usr/bin/ssinstall ln -s -f /opt/durapps/spark-store/bin/ssinstall /usr/bin/ssinstall
ln -s -f /opt/durapps/spark-store/bin/ssaudit /usr/bin/ssaudit ln -s -f /opt/durapps/spark-store/bin/ssaudit /usr/bin/ssaudit
ln -s -f /opt/durapps/spark-store/bin/spark-dstore-patch /usr/local/bin/spark-dstore-patch ln -s -f /opt/durapps/spark-store/bin/spark-dstore-patch /usr/local/bin/spark-dstore-patch
ln -s -f /opt/durapps/spark-store/bin/spark-dstore-patch /usr/bin/spark-dstore-patch
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/local/bin/ss-apt-fast ln -s -f /opt/durapps/spark-store/bin/aptss /usr/local/bin/ss-apt-fast
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/bin/aptss ln -s -f /opt/durapps/spark-store/bin/aptss /usr/bin/aptss
@@ -72,18 +73,7 @@ case "$1" in
;; ;;
triggered) triggered)
# Quit if deepin-app-store-tool existed spark-dstore-patch
if [ -x "/usr/bin/deepin-app-store-tool" ] ; then
exit 0
fi
# Trigger for UOS debs installation
echo '--------检测到Uniontech标准软件包运行补丁以修正安装--------'
if [ -x "/usr/local/bin/spark-dstore-patch" ] ; then
/usr/local/bin/spark-dstore-patch
echo '-----------spark-dstore-patch补丁工具已运行完毕-----------'
else
echo '------------spark-dstore-patch补丁工具运行失败------------'
fi
;; ;;
esac esac

View File

@@ -22,6 +22,7 @@ if [ "$1" = "remove" -o "$1" = "purge" ] ; then
unlink /usr/bin/ssinstall unlink /usr/bin/ssinstall
unlink /usr/bin/ssaudit unlink /usr/bin/ssaudit
unlink /usr/local/bin/spark-dstore-patch unlink /usr/local/bin/spark-dstore-patch
unlink /usr/bin/spark-dstore-patch
unlink /usr/local/bin/ss-apt-fast unlink /usr/local/bin/ss-apt-fast
unlink /usr/bin/aptss unlink /usr/bin/aptss

View File

@@ -1 +1,2 @@
interest-noawait /opt/apps interest-noawait /opt/apps
interest-noawait /usr/share/icons

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
echo "----------------Running Spark DStore Patch----------------"
@@ -63,14 +63,16 @@ linkApp() {
done done
} }
function exec_uos_package_link(){
# execute linkApp function for each app and print output
for app in $(enumAppInfoList); do for app in $(enumAppInfoList); do
linkApp "$app" & linkApp "$app" &
done done
wait wait
}
function exec_v23_icon_link(){
# Fix v23 broken icon # Fix v23 broken icon
if [ ! -d "/usr/share/icons/hicolor/scalable/apps" ];then if [ ! -d "/usr/share/icons/hicolor/scalable/apps" ];then
mkdir -p /usr/share/icons/hicolor/scalable/apps mkdir -p /usr/share/icons/hicolor/scalable/apps
@@ -83,7 +85,9 @@ if [ ! -e ${target_icon_path} ];then
ln -sv $(realpath --relative-to=/usr/share/icons/hicolor/scalable/apps ${icon_root_icon_path}) /usr/share/icons/hicolor/scalable/apps ln -sv $(realpath --relative-to=/usr/share/icons/hicolor/scalable/apps ${icon_root_icon_path}) /usr/share/icons/hicolor/scalable/apps
fi fi
done done
}
function exec_link_clean(){
# remove broken links in /usr/share # remove broken links in /usr/share
find /usr/share/applications -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; & find /usr/share/applications -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; &
@@ -103,4 +107,16 @@ done
update-desktop-database -q > /dev/null 2>&1 & update-desktop-database -q > /dev/null 2>&1 &
update-mime-database -V /usr/share/mime > /dev/null 2>&1 & update-mime-database -V /usr/share/mime > /dev/null 2>&1 &
glib-compile-schemas /usr/share/glib-2.0/schemas/ > /dev/null 2>&1 & glib-compile-schemas /usr/share/glib-2.0/schemas/ > /dev/null 2>&1 &
}
#########################################################################################
echo "----------------Running Spark DStore Patch----------------"
if [ ! -e /usr/bin/deepin-app-store-tool ];then
# execute linkApp function for each app and print output
exec_uos_package_link
fi
exec_v23_icon_link
exec_link_clean
echo "----------------Finished----------------" echo "----------------Finished----------------"