mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-24 11:32:01 +08:00
Split opensuse out
This commit is contained in:
59
src/chsrc.c
59
src/chsrc.c
@@ -10,7 +10,7 @@
|
||||
* | BlockLune <blocklune@gmail.com>
|
||||
* |
|
||||
* Created On : <2023-08-28>
|
||||
* Last Modified : <2024-08-15>
|
||||
* Last Modified : <2024-08-16>
|
||||
*
|
||||
* chsrc: Change Source —— 全平台通用命令行换源工具
|
||||
* ------------------------------------------------------------*/
|
||||
@@ -517,62 +517,7 @@ os_fedora_setsrc (char *option)
|
||||
chsrc_say_lastly (&source, ChsrcTypeAuto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* HELP: 未经测试
|
||||
*/
|
||||
void
|
||||
os_opensuse_setsrc (char *option)
|
||||
{
|
||||
chsrc_ensure_root (); // HELP: 不知道是否需要确保root权限
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (os_opensuse);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
char *source_nselect = "zypper mr -da";
|
||||
chsrc_run (source_nselect, RunOpt_Default);
|
||||
|
||||
char *cmd1 = xy_strjoin (3,
|
||||
"zypper ar -cfg '",
|
||||
source.url,
|
||||
"/opensuse/distribution/leap/$releasever/repo/oss/' mirror-oss");
|
||||
char *cmd2 = xy_strjoin (3,
|
||||
"zypper ar -cfg '",
|
||||
source.url,
|
||||
"/opensuse/distribution/leap/$releasever/repo/non-oss/' mirror-non-oss");
|
||||
char *cmd3 = xy_strjoin (3,
|
||||
"zypper ar -cfg '",
|
||||
source.url,
|
||||
"/opensuse/distribution/leap/$releasever/oss/' mirror-update");
|
||||
char *cmd4 = xy_strjoin (3,
|
||||
"zypper ar -cfg '",
|
||||
source.url,
|
||||
"/opensuse/distribution/leap/$releasever/non-oss/' mirror-update-non-oss");
|
||||
char *cmd5 = xy_strjoin (3,
|
||||
"zypper ar -cfg '",
|
||||
source.url,
|
||||
"/opensuse/distribution/leap/$releasever/sle/' mirror-sle-update");
|
||||
char *cmd6 = xy_strjoin (3,
|
||||
"zypper ar -cfg '",
|
||||
source.url,
|
||||
"/opensuse/distribution/leap/$releasever/backports/' mirror-backports-update");
|
||||
|
||||
chsrc_run (cmd1, RunOpt_Default);
|
||||
chsrc_run (cmd2, RunOpt_Default);
|
||||
chsrc_run (cmd3, RunOpt_Default);
|
||||
chsrc_run (cmd4, RunOpt_Default);
|
||||
|
||||
chsrc_note2 ("leap 15.3用户还需要添加sle和backports源");
|
||||
chsrc_note2 ("另外请确保系统在更新后仅启用了六个软件源,可以使用 zypper lr 检查软件源状态");
|
||||
chsrc_note2 ("并使用 zypper mr -d 禁用多余的软件源");
|
||||
|
||||
chsrc_run (cmd5, RunOpt_Default);
|
||||
chsrc_run (cmd6, RunOpt_Default);
|
||||
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
||||
}
|
||||
|
||||
#include "recipe/os/opensuse.c"
|
||||
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user