spark-store/debian/spark-store.postinst
shenmo 49c5583ea9 !65 修复安装时使用wget的问题
修复安装时使用wget但是依赖未写明的问题(改用curl)
准备发布3.1.4
2022-08-06 02:24:00 +00:00

76 lines
2.8 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
case "$1" in
configure)
# Check if /usr/local/bin existed
mkdir -p /usr/local/bin
# Create symbol links for binary files
ln -s -f /opt/durapps/spark-store/bin/ussinstall /usr/local/bin/ussinstall
ln -s -f /opt/durapps/spark-store/bin/ussremove /usr/local/bin/ussremove
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/spark-dstore-patch /usr/local/bin/spark-dstore-patch
ln -s -f /opt/durapps/spark-store/bin/ss-apt-fast /usr/local/bin/ss-apt-fast
# Download and install key
curl --progress-bar -o /tmp/spark-store-install/spark-store.asc https://d.store.deepinos.org.cn/dcs-repo.gpg-key.asc
gpg --dearmor /tmp/spark-store-install/spark-store.asc
cp -f /tmp/spark-store-install/spark-store.asc.gpg /etc/apt/trusted.gpg.d/spark-store.gpg
# Remove existing source file
rm -f /etc/apt/preferences.d/sparkstore
rm -f /etc/apt/sources.list.d/sparkstore.list
# Run apt update to avoid users being fucked up by the non-exist dependency problem
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list"
# 下载源列表
bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
# 更新
# Create symbo links to start upgrade detect
ln -s /opt/durapps/spark-store/bin/update-upgrade/autostart/spark-update-notifier.desktop /etc/xdg/autostart/spark-update-notifier.desktop
# Start upgrade detect service
systemctl enable spark-update-notifier
service spark-update-notifier start
# Update certain caches
update-icon-caches /usr/share/icons/hicolor || true
update-desktop-database /usr/share/applications || true
xdg-mime default spark-store.desktop x-scheme-handler/spk
update-mime-database /usr/share/mime || true
# Send email for statistics
# /tmp/spark-store-install/feedback.sh
# Remove temp dir
rm -rf /tmp/spark-store-install
;;
triggered)
# Quit if deepin-app-store-tool existed
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