chsrc/src/recipe/ware/Flathub.c

44 lines
1.2 KiB
C
Raw Normal View History

2024-08-16 04:28:50 +08:00
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Nil Null <nil@null.org>
* Created On : <2023-09-11>
* Last Modified : <2024-08-15>
* ------------------------------------------------------------*/
/**
* @time 2023-09-11
* @note
*/
static SourceInfo
wr_flathub_sources[] = {
{&Upstream, NULL},
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/flathub"},
};
def_sources_n(wr_flathub);
/**
* : https://mirrors.sjtug.sjtu.edu.cn/docs/flathub
*/
void
wr_flathub_setsrc (char *option)
{
2024-08-18 09:27:22 +08:00
chsrc_yield_source_and_confirm (wr_flathub);
2024-08-16 04:28:50 +08:00
chsrc_note2 ("若出现问题,可先调用以下命令:");
char *note = xy_strjoin (3,
"wget ", source.url, "/flathub.gpg\n"
"flatpak remote-modify --gpg-import=flathub.gpg flathub"
);
puts (note);
char *cmd = xy_2strjoin ("flatpak remote-modify flathub --url=", source.url);
chsrc_run (cmd, RunOpt_Default);
2024-08-18 09:27:22 +08:00
chsrc_conclude (&source, ChsrcTypeAuto);
2024-08-16 04:28:50 +08:00
}
2024-08-16 21:07:33 +08:00
def_target_s (wr_flathub);