Merge remote-tracking branch 'upstream/master' into dev

This commit is contained in:
lizhiyuan 2022-08-07 23:34:33 +08:00
commit e8612f304a
13 changed files with 117 additions and 60 deletions

29
debian/changelog vendored
View File

@ -1,3 +1,32 @@
spark-store (3.1.4-1) stable; urgency=medium
* 安装脚本和检测更新脚本检查网络时间超时时间延长至5s
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
spark-store (3.1.4) stable; urgency=medium
* 发布正式版,同步到官网
* 修复安装时使用wget的问题
* 合并3.1.3-1和3.1.3-2的更改
* 屏蔽了ssinstall之外的安装方式
* 调整了报错框的形式
* 修复pkexec下ssinstall不处理依赖
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
spark-store (3.1.3-2) stable; urgency=medium
* 调整 现在与系统更新分开,不再导致更新失败
* 支持直接更新软件源文件不再让d.吃全部更新流量
* ss-apt-fast不再强制root权限
* 修改ss-apt-fast的策略现在除了安装下载和更新都改用apt
* ssinstall 现在也会在不适用ss-apt-fast的时候模拟源了针对UOS
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
spark-store (3.1.3-1) stable; urgency=medium
* 修复 下载提前退出

View File

@ -16,12 +16,23 @@ case "$1" in
# Download and install key
wget -O /tmp/spark-store-install/spark-store.asc https://d.store.deepinos.org.cn/dcs-repo.gpg-key.asc
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
apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
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
@ -42,6 +53,8 @@ case "$1" in
# Remove temp dir
rm -rf /tmp/spark-store-install
;;
triggered)

View File

@ -3,7 +3,7 @@
function network-check()
{
#超时时间
local timeout=1
local timeout=5
#目标网站
local target=www.baidu.com

View File

@ -1,3 +0,0 @@
Package: *
Pin: origin *.deepinos.org.cn
Pin-Priority: 400

View File

@ -45,18 +45,18 @@ downloadlist::downloadlist(QWidget *parent) :
menu_install->addAction(action_dpkg);
}
QFile deepin("/usr/bin/deepin-deb-installer");
deepin.open(QIODevice::ReadOnly);
if(deepin.isOpen())
{
menu_install->addAction(action_deepin);
}
QFile gdebi("/usr/bin/gdebi");
gdebi.open(QIODevice::ReadOnly);
if(gdebi.isOpen())
{
menu_install->addAction(action_gdebi);
}
// QFile deepin("/usr/bin/deepin-deb-installer");
// deepin.open(QIODevice::ReadOnly);
// if(deepin.isOpen())
// {
// menu_install->addAction(action_deepin);
// }
// QFile gdebi("/usr/bin/gdebi");
// gdebi.open(QIODevice::ReadOnly);
// if(gdebi.isOpen())
// {
// menu_install->addAction(action_gdebi);
// }
}
@ -219,6 +219,7 @@ void downloadlist::on_pushButton_3_clicked()
{
textbrowser->setLineWidth(0);
textbrowser->setText(out);
textbrowser->setMinimumHeight(500);
output_w->setMinimumHeight(600);
output_w->setAttribute(Qt::WA_TranslucentBackground);

View File

@ -30,7 +30,7 @@ int main(int argc, char *argv[])
DAboutDialog dialog;
a.setAboutDialog(&dialog);
dialog.setLicense(QObject::tr("We publish this program under GPL V3"));
dialog.setVersion(DApplication::buildVersion("Version 3.1.3-1"));
dialog.setVersion(DApplication::buildVersion("Version 3.1.4-1"));
dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo
dialog.setProductName(QLabel::tr("Spark Store"));
dialog.setDescription(
@ -51,7 +51,7 @@ int main(int argc, char *argv[])
a.setOrganizationName("spark-union");
a.setOrganizationDomain("https://www.deepinos.org/");
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文
a.setApplicationVersion(DApplication::buildVersion("3.1.3-1"));
a.setApplicationVersion(DApplication::buildVersion("3.1.4-1"));
a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
a.setApplicationDescription(
QObject::tr(

View File

@ -0,0 +1 @@
deb [by-hash=force] https://d.store.deepinos.org.cn /

View File

@ -1,19 +1,42 @@
#/bin/bash
if [ "$(id -u)" != "0" ]
then
echo "ss-apt-fast需要在root下运行"
exit
fi
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] || [ "$1" = "download" ] ; then
###刷新apt-fast配置
mkdir -p /tmp/ss-apt-fast-conf/sources.list.d
# 创建文件夹
echo "从服务器获取配置和镜像列表..."
echo "Getting server and mirror lists..."
echo
curl --progress-bar -o /tmp/ss-apt-fast-conf/apt-fast.conf "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/apt-fast.conf"
chmod -R 755 /tmp/ss-apt-fast-conf
DEPEND=`which apt-fast`
if [ "$DEPEND" = "" ] ; then
echo "未安装依赖apt-fast 开始安装"
apt install apt-fast -y
sudo 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 && sudo 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 install apt-fast -y
fi
###执行安装
bwrap --dev-bind / / \
--bind '/tmp/ss-apt-fast-conf/apt-fast.conf' /etc/apt-fast.conf \
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
apt-fast "$@"
rm -rf /tmp/ss-apt-fast-conf
elif [ "$1" = "ssupdate" ];then
sudo 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"
sudo 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"
#只更新星火源
else
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 "$@"
fi
rm /opt/durapps/spark-store/bin/apt-fast-conf/apt-fast.conf
echo "从服务器获取配置和镜像列表..."
curl -s --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/apt-fast.conf "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/apt-fast.conf"
bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/apt-fast.conf' /etc/apt-fast.conf apt-fast "$@"

View File

@ -46,61 +46,45 @@ isuos=`cat /etc/os-release | grep UnionTech`
##############判断是否是root运行如果是则正常走如果不是则代输密码
if [ "$(id -u)" != "0" ];then
#############################无root权限时
#临时提升星火源的优先级
echo "$upass" | sudo -S sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore
IS_INSTALLED=`which apt-fast`
if [ "$IS_INSTALLED" = "" ] ; then
echo "未安装依赖apt-fast 开始安装"
echo "$upass" | sudo -S apt install apt-fast -y
fi
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast"
echo ----------------------------------------------------------------------------------
echo "$upass" | sudo -S dpkg -i $1 || sudo apt install -yf
echo "$upass" | sudo -S dpkg -i $1 || sudo /usr/local/bin/ss-apt-fast ssupdate && sudo 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 install -yf
fi
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
echo "检测到apt-fast使用ss-apt-fast进行多线程下载加速"
echo "检测到apt-fast使用/usr/local/bin/ss-apt-fast进行多线程下载加速"
echo ----------------------------------------------------------------------------------
echo "$upass" | sudo -S dpkg -i $1 || sudo ss-apt-fast install -yf
echo "$upass" | sudo -S dpkg -i $1 || sudo /usr/local/bin/ss-apt-fast ssupdate && sudo /usr/local/bin/ss-apt-fast install -yf
fi
echo "$upass" | sudo -S sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore
#恢复优先级
else
###########################有root权限时
#临时提升星火源的优先级
sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore
IS_INSTALLED=`which apt-fast`
if [ "$IS_INSTALLED" = "" ] ; then
echo "未安装依赖apt-fast 开始安装"
apt install apt-fast -y
fi
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast"
echo ----------------------------------------------------------------------------------
dpkg -i $1 || apt install -yf
dpkg -i $1 || /usr/local/bin/ss-apt-fast ssupdate && 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 && sudo 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 install -yf
fi
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
echo "检测到apt-fast使用ss-apt-fast进行多线程下载加速"
echo "检测到apt-fast使用/usr/local/bin/ss-apt-fast进行多线程下载加速"
echo ----------------------------------------------------------------------------------
dpkg -i $1 || ss-apt-fast install -yf
dpkg -i $1 || /usr/local/bin/ss-apt-fast ssupdate && /usr/local/bin/ss-apt-fast install -yf
fi
sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore
#恢复优先级

View File

@ -3,7 +3,12 @@
echo "以上可升级,是否升级?[y/n]"
read yes_or_no
if [ "$yes_or_no" = "y" ];then
sudo ss-apt-fast upgrade -y -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
mkdir -p /tmp/ss-apt-fast-conf/sources.list.d
sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list ss-apt-fast upgrade -y -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
else
exit
fi

View File

@ -73,7 +73,8 @@ case $option in
2)
echo "请注意:如果有些更新需要从系统获取更多依赖,你将需要手动操作 sudo ss-apt-fast upgrade"
echo "执行以下操作需要授权..."
/opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh
sudo ss-apt-fast ssupdate
/opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
echo "---请按回车返回"
read

View File

@ -9,7 +9,7 @@ LANG=en.US
function network()
{
#超时时间
local timeout=1
local timeout=5
#目标网站
local target=www.baidu.com
@ -36,8 +36,11 @@ fi
#The code above is modified from https://blog.csdn.net/yaxuan88521/article/details/120516298
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"
# 每日更新星火源文件
updatetext=`ss-apt-fast ssupdate`
updatetext=`sudo apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"`
mkdir -p /tmp/spark-store-updatenum/

View File

@ -3,4 +3,4 @@ set -e
echo "---可更新的应用有:"
sudo apt list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
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 list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"