Skip to content

Conversation

@jialinlvcn
Copy link
Contributor

@jialinlvcn jialinlvcn commented Mar 17, 2025

描述

问题的背景

  • 近期Flathub上海交通大学镜像站存在不兼容的问题

相关 issue

这个PR做了什么

  • 修复了Ware Flathub换源
  • mirror.c中区分了上海交通大学思源镜像站和致远镜像站
  • 添加Flathub官方仓库

方案

实现

  • 添加了Flathub.c中用于测试的MirrorSite_t和对应的测试链接

测试

  • 运行 chsrc set flathub
@jialinlvcn jialinlvcn closed this Mar 17, 2025
@jialinlvcn jialinlvcn deleted the dev branch March 17, 2025 03:07
@jialinlvcn jialinlvcn restored the dev branch March 17, 2025 03:08
@jialinlvcn jialinlvcn changed the title Fix flathub Fix flathub chsrc Mar 17, 2025
@jialinlvcn jialinlvcn reopened this Mar 17, 2025
Copy link
Contributor

@ccmywish ccmywish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢你在此问题上的投入!👍 代码还需要一点修改即可被我们接受。我觉得你可以分两次 commit,一次 commit 用于在 mirror.c 中增加思源镜像站,一次 commit 用于调整 flathub 的这个问题。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件的变动似乎是添加了 Sjtug_Siyuan 这个镜像站,但是可能是你的编辑器或者其他操作使得 GitHub 显示对这个文件进行了巨大的更改,以致于无法看清你的修改。

所以能否重新删除这次 commit 重新提交一次,保持 diff 的清晰?

/**
* @update 2023-09-11
* @note 目前只有一个源
* @update 2025-03-17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 @update 表示的是源的最后更新时间,只需要把 2023 那个时间覆盖掉即可。
@note 可以把之前的删掉

/**
* @consult https://mirrors.sjtug.sjtu.edu.cn/docs/flathub
*/
static MirrorSite_t UpstreamFlathub =
Copy link
Contributor

@ccmywish ccmywish Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按照我们之前的命名惯例(可参考 Java.c,Ruby.c),这里应该叫做 wr_flathub_upstream
结构体是 SourceProvider_t

{NotSkip, NA, NA, "https://flathub.org/repo/flathub.gpg"}
},

Sjtug_Siyuan_Flathub =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我理解的是,你通过额外定义两个“虚拟”的镜像站,目的是为了检测 /flathub/flathub.gpg 这个文件能不能访问到,访问到的测速就不为0,就能被选中?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,检测/flathub/flathub.gpg可能存在502的情况,此时需要跳过。

);
puts (note);

char *repo_note = xy_strjoin (1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xy_strjoin(n) 是用于字符串拼接的。这个地方显然不需要拼接,直接用双引号字符串即可

@ccmywish ccmywish added this to the v0.2.1 milestone Mar 17, 2025
@ccmywish ccmywish linked an issue Mar 17, 2025 that may be closed by this pull request
@ccmywish ccmywish added the wr_target ware target label Mar 17, 2025
@ccmywish
Copy link
Contributor

@jialinlvcn

最后分别在:

  1. 你刚才修改的两个文件的头部
  2. https://github.com/RubyMetric/chsrc/blob/main/src/chsrc-main.c#L24

这三个地方加上你的贡献信息即可 👍

@ccmywish ccmywish merged commit 77cf784 into RubyMetric:dev Mar 17, 2025
@ccmywish
Copy link
Contributor

@jialinlvcn

感谢你的贡献,辛苦了 ❤️

Happy changing source~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wr_target ware target

2 participants