Distinguish two sjtu mirror sites

[GitHub #191 #178]
This commit is contained in:
Aoran Zeng 2025-05-27 18:18:22 +08:00
parent b8034c44e7
commit 283acfa4ba
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
2 changed files with 38 additions and 16 deletions

View File

@ -8,7 +8,7 @@
* | Jialin Lyu <jialinlvcn@aliyun.com>
* |
* Created On : <2023-08-29>
* Last Modified : <2025-03-09>
* Last Modified : <2025-05-27>
*
*
* ------------------------------------------------------------*/
@ -44,13 +44,13 @@ Tuna =
Sjtug_Zhiyuan =
{
"sjtu", "SJTUG-zhiyuan", "上海交通大学致远镜像站", "https://mirrors.sjtug.sjtu.edu.cn/",
"sjtu-zy", "SJTUG-zhiyuan", "上海交通大学致远镜像站", "https://mirrors.sjtug.sjtu.edu.cn/",
{NotSkip, NA, NA, "https://mirrors.sjtug.sjtu.edu.cn/ctan" Big_File_ctan}
},
Sjtug_Siyuan =
{
"sjtu", "SJTUG-siyuan", "上海交通大学思源镜像站", "https://mirror.sjtu.edu.cn/",
"sjtu-sy", "SJTUG-siyuan", "上海交通大学思源镜像站", "https://mirror.sjtu.edu.cn/",
{NotSkip, NA, NA, "https://mirror.sjtu.edu.cn/ctan" Big_File_ctan}
},

View File

@ -3,39 +3,44 @@
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Jialin Lyu <jialinlvcn@aliyun.com>
* |
* Created On : <2023-09-11>
* Last Modified : <2025-03-17>
* Last Modified : <2025-05-27>
* ------------------------------------------------------------*/
/**
* @update 2025-03-17
* @note
* @note SJTUG分为两个镜像站 访
* @update 2025-05-27
*/
static SourceProvider_t wr_flathub_upstream =
{
"Flathub", "Flathub", "Flathub官方仓库", "https://flathub.org/repo",
// 没有找到 DaoCloud 合适的下载链接,先随便给一个,以规避 chsrc 自动测速时所有 dockerhub 镜像站都没有测速链接带来的 bug
def_upstream, "https://flathub.org/repo",
{NotSkip, NA, NA, "https://flathub.org/repo/flathub.gpg"}
},
/**
* @note 使使访 (GitHub-#178)
* : flathub.gpg
* 访
* 使
*/
wr_flathub_siyuan =
{
"sjtu", "SJTUG-siyuan", "上海交通大学思源镜像站Flathub", "https://mirror.sjtu.edu.cn/",
"sjtu-sy", "SJTUG-siyuan", "上海交通大学思源镜像站Flathub", "https://mirror.sjtu.edu.cn/",
{NotSkip, NA, NA, "https://mirror.sjtu.edu.cn/flathub/flathub.gpg"}
},
wr_flathub_zhiyuan =
{
"sjtu", "SJTUG-zhiyuan", "上海交通大学致远镜像站Flathub", "https://mirrors.sjtug.sjtu.edu.cn/",
"sjtu-zy", "SJTUG-zhiyuan", "上海交通大学致远镜像站Flathub", "https://mirrors.sjtug.sjtu.edu.cn/",
{NotSkip, NA, NA, "https://mirrors.sjtug.sjtu.edu.cn/flathub/flathub.gpg"}
};
static Source_t wr_flathub_sources[] =
{
{&wr_flathub_upstream, "https://flathub.org/repo"},
{&wr_flathub_upstream, "https://flathub.org/repo"},
{&wr_flathub_siyuan, "https://mirror.sjtu.edu.cn/flathub"},
{&wr_flathub_zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/flathub"},
{&wr_flathub_zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/flathub"},
};
def_sources_n(wr_flathub);
@ -53,12 +58,12 @@ wr_flathub_setsrc (char *option)
"wget ", source.url, "/flathub.gpg\n"
"flatpak remote-modify --gpg-import=flathub.gpg flathub"
);
puts (note);
say (note);
char *repo_note = "Flathub 中部分软件由于重分发授权问题,需要从官方服务器下载,无法使用镜像站加速\n"
"比如 NVIDIA 驱动、JetBrains 系列软件等\n"
"尝试运行 flatpak remote-modify flathub --url=https://flathub.org/repo";
puts (repo_note);
say (repo_note);
char *cmd = xy_2strjoin ("flatpak remote-modify flathub --url=", source.url);
chsrc_run (cmd, RunOpt_Default);
@ -67,4 +72,21 @@ wr_flathub_setsrc (char *option)
chsrc_conclude (&source);
}
def_target_s (wr_flathub);
Feature_t
wr_flathub_feat (char *option)
{
Feature_t f = {0};
f.can_get = false;
f.can_reset = false;
f.cap_locally = CanNot;
f.cap_locally_explain = NULL;
f.can_english = false;
f.can_user_define = true;
return f;
}
def_target_sf (wr_flathub);