mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-08 19:54:13 +08:00
parent
91c94ad012
commit
8a136d973e
15
src/chsrc.c
15
src/chsrc.c
@ -14,7 +14,7 @@
|
|||||||
* chsrc: Change Source —— 全平台通用命令行换源工具
|
* chsrc: Change Source —— 全平台通用命令行换源工具
|
||||||
* ------------------------------------------------------------*/
|
* ------------------------------------------------------------*/
|
||||||
|
|
||||||
#define Chsrc_Version "v0.1.7.pre4-2024/06/20"
|
#define Chsrc_Version "v0.1.7.pre5-2024/06/21"
|
||||||
#define Chsrc_Maintain_URL "https://gitee.com/RubyMetric/chsrc"
|
#define Chsrc_Maintain_URL "https://gitee.com/RubyMetric/chsrc"
|
||||||
|
|
||||||
#include "chsrc.h"
|
#include "chsrc.h"
|
||||||
@ -843,7 +843,7 @@ ensure_apt_sourcelist (int debian_type)
|
|||||||
if (debian_type == Debian_deriv_ubuntu)
|
if (debian_type == Debian_deriv_ubuntu)
|
||||||
{
|
{
|
||||||
makeup = xy_strjoin (9,
|
makeup = xy_strjoin (9,
|
||||||
"# Generated by chsrc " Chsrc_Version "(" Chsrc_Maintain_URL ")\n\n"
|
"# Generated by chsrc " Chsrc_Version "\n\n"
|
||||||
"deb " Chsrc_Maintain_URL "/ubuntu ", codename, " main restricted universe multiverse\n"
|
"deb " Chsrc_Maintain_URL "/ubuntu ", codename, " main restricted universe multiverse\n"
|
||||||
"deb " Chsrc_Maintain_URL "/ubuntu ", codename, "-updates main restricted universe multiverse\n"
|
"deb " Chsrc_Maintain_URL "/ubuntu ", codename, "-updates main restricted universe multiverse\n"
|
||||||
"deb " Chsrc_Maintain_URL "/ubuntu ", codename, "-backports main restricted universe multiverse\n"
|
"deb " Chsrc_Maintain_URL "/ubuntu ", codename, "-backports main restricted universe multiverse\n"
|
||||||
@ -857,7 +857,7 @@ ensure_apt_sourcelist (int debian_type)
|
|||||||
// https://mirrors.tuna.tsinghua.edu.cn/help/debian/
|
// https://mirrors.tuna.tsinghua.edu.cn/help/debian/
|
||||||
// 从 Debian 12 开始,开始有一项 non-free-firmware
|
// 从 Debian 12 开始,开始有一项 non-free-firmware
|
||||||
makeup = xy_strjoin (9,
|
makeup = xy_strjoin (9,
|
||||||
"# Generated by chsrc " Chsrc_Version "(" Chsrc_Maintain_URL ")\n\n"
|
"# Generated by chsrc " Chsrc_Version "\n\n"
|
||||||
"deb " Chsrc_Maintain_URL "/debian ", codename, " main contrib non-free non-free-firmware\n"
|
"deb " Chsrc_Maintain_URL "/debian ", codename, " main contrib non-free non-free-firmware\n"
|
||||||
"deb " Chsrc_Maintain_URL "/debian ", codename, "-updates main contrib non-free non-free-firmware\n"
|
"deb " Chsrc_Maintain_URL "/debian ", codename, "-updates main contrib non-free non-free-firmware\n"
|
||||||
"deb " Chsrc_Maintain_URL "/debian ", codename, "-backports main contrib non-free non-free-firmware\n"
|
"deb " Chsrc_Maintain_URL "/debian ", codename, "-backports main contrib non-free non-free-firmware\n"
|
||||||
@ -2058,11 +2058,16 @@ wr_brew_setsrc (char *option)
|
|||||||
chsrc_yield_source (wr_brew);
|
chsrc_yield_source (wr_brew);
|
||||||
chsrc_confirm_source (&source);
|
chsrc_confirm_source (&source);
|
||||||
|
|
||||||
char *api_domain = xy_strjoin (3, "export HOMEBREW_API_DOMAIN=\"", xy_2strjoin (source.url, "homebrew-bottles/api"), "\"");
|
char *splitter = "\n\n# Generated by chsrc " Chsrc_Version "\n";
|
||||||
char *bottle_domain = xy_strjoin (3, "export HOMEBREW_BOTTLE_DOMAIN=\"", xy_2strjoin (source.url, "homebrew-bottles"), "\"");
|
char *api_domain = xy_strjoin (3, "export HOMEBREW_API_DOMAIN=\"", xy_2strjoin (source.url, "homebrew-bottles/api"), "\"");
|
||||||
|
char *bottle_domain = xy_strjoin (3, "export HOMEBREW_BOTTLE_DOMAIN=\"", xy_2strjoin (source.url, "homebrew-bottles"), "\"");
|
||||||
char *brew_git_remote = xy_strjoin (3, "export HOMEBREW_BREW_GIT_REMOTE=\"", xy_2strjoin (source.url, "git/homebrew/brew.git"), "\"");
|
char *brew_git_remote = xy_strjoin (3, "export HOMEBREW_BREW_GIT_REMOTE=\"", xy_2strjoin (source.url, "git/homebrew/brew.git"), "\"");
|
||||||
char *core_git_remote = xy_strjoin (3, "export HOMEBREW_CORE_GIT_REMOTE=\"", xy_2strjoin (source.url, "git/homebrew/homebrew-core.git"), "\"");
|
char *core_git_remote = xy_strjoin (3, "export HOMEBREW_CORE_GIT_REMOTE=\"", xy_2strjoin (source.url, "git/homebrew/homebrew-core.git"), "\"");
|
||||||
|
|
||||||
|
chsrc_backup ("~/.zshrc");
|
||||||
|
chsrc_backup ("~/.bashrc");
|
||||||
|
|
||||||
|
chsrc_append_to_file (splitter, "~/.bashrc >> ~/.zshrc");
|
||||||
chsrc_append_to_file (api_domain, "~/.bashrc >> ~/.zshrc");
|
chsrc_append_to_file (api_domain, "~/.bashrc >> ~/.zshrc");
|
||||||
chsrc_append_to_file (bottle_domain, "~/.bashrc >> ~/.zshrc");
|
chsrc_append_to_file (bottle_domain, "~/.bashrc >> ~/.zshrc");
|
||||||
chsrc_append_to_file (brew_git_remote, "~/.bashrc >> ~/.zshrc");
|
chsrc_append_to_file (brew_git_remote, "~/.bashrc >> ~/.zshrc");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user