diff --git a/debian/spark-store.postinst b/debian/spark-store.postinst index 220933e..0e22c2d 100755 --- a/debian/spark-store.postinst +++ b/debian/spark-store.postinst @@ -29,7 +29,7 @@ case "$1" in # Check if /usr/local/bin existed mkdir -p /usr/local/bin - + ## I hate /usr/local/bin. We will abandon them later # 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/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/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/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/bin/aptss @@ -72,18 +73,7 @@ case "$1" in ;; triggered) - # Quit if deepin-app-store-tool existed - if [ -x "/usr/bin/deepin-app-store-tool" ] ; then - exit 0 - fi + spark-dstore-patch - # 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 diff --git a/debian/spark-store.prerm b/debian/spark-store.prerm index 5337647..f266bb6 100755 --- a/debian/spark-store.prerm +++ b/debian/spark-store.prerm @@ -22,6 +22,7 @@ if [ "$1" = "remove" -o "$1" = "purge" ] ; then unlink /usr/bin/ssinstall unlink /usr/bin/ssaudit unlink /usr/local/bin/spark-dstore-patch + unlink /usr/bin/spark-dstore-patch unlink /usr/local/bin/ss-apt-fast unlink /usr/bin/aptss diff --git a/debian/spark-store.triggers b/debian/spark-store.triggers index 96a1351..739b708 100644 --- a/debian/spark-store.triggers +++ b/debian/spark-store.triggers @@ -1 +1,2 @@ interest-noawait /opt/apps +interest-noawait /usr/share/icons diff --git a/tool/spark-dstore-patch b/tool/spark-dstore-patch index 07fd244..c955fcd 100755 --- a/tool/spark-dstore-patch +++ b/tool/spark-dstore-patch @@ -1,6 +1,6 @@ #!/bin/bash -echo "----------------Running Spark DStore Patch----------------" + @@ -63,14 +63,16 @@ linkApp() { done } +function exec_uos_package_link(){ -# execute linkApp function for each app and print output for app in $(enumAppInfoList); do linkApp "$app" & done wait +} +function exec_v23_icon_link(){ # Fix v23 broken icon if [ ! -d "/usr/share/icons/hicolor/scalable/apps" ];then 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 fi done +} +function exec_link_clean(){ # remove broken links in /usr/share 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-mime-database -V /usr/share/mime > /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----------------"