mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-08 19:38:55 +08:00
Split anolis out
This commit is contained in:
parent
415d5d2092
commit
62781f54c3
56
README.md
56
README.md
@ -166,23 +166,23 @@ chsrc set -local pdm
|
|||||||
## 编程语言开发
|
## 编程语言开发
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
chsrc set ruby 或 set gem
|
chsrc set ruby 或 gem
|
||||||
chsrc set python 或 set pip / poetry / pdm # 同时换pip、poetry 和 pdm 这3个
|
chsrc set python 或 pip / poetry / pdm # 同时换pip、poetry 和 pdm 这3个
|
||||||
chsrc set node 或 set npm / nodejs / yarn / pnpm # 同时换这3个
|
chsrc set node 或 npm / nodejs / yarn / pnpm # 同时换npm, yarn 和 pnpm 这3个
|
||||||
chsrc set perl 或 set cpan
|
chsrc set perl 或 cpan
|
||||||
chsrc set php 或 set composer
|
chsrc set php 或 composer
|
||||||
chsrc set lua 或 set luarocks
|
chsrc set lua 或 luarocks
|
||||||
|
|
||||||
chsrc set go
|
chsrc set go
|
||||||
chsrc set rust 或 set cargo / crate
|
chsrc set rust 或 cargo / crate
|
||||||
chsrc set java 或 set maven / mvn / gradle
|
chsrc set java 或 maven / mvn / gradle
|
||||||
chsrc set clojure 或 set clojars
|
chsrc set clojure 或 clojars
|
||||||
chsrc set dart 或 set pub / flutter # 同时会为flutter换源
|
chsrc set dart 或 pub / flutter # 同时会为flutter换源
|
||||||
chsrc set haskell 或 set hackage/cabal/stack
|
chsrc set haskell 或 hackage/cabal/stack
|
||||||
chsrc set ocaml 或 set opam
|
chsrc set ocaml 或 opam
|
||||||
|
|
||||||
# 同时会为 bioconductor 换源
|
# 同时会为 bioconductor 换源
|
||||||
chsrc set r 或 set cran
|
chsrc set r 或 cran
|
||||||
chsrc set julia
|
chsrc set julia
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -195,30 +195,30 @@ sudo chsrc set ubuntu
|
|||||||
sudo chsrc set linuxmint 或 mint
|
sudo chsrc set linuxmint 或 mint
|
||||||
sudo chsrc set debian
|
sudo chsrc set debian
|
||||||
sudo chsrc set fedora
|
sudo chsrc set fedora
|
||||||
sudo chsrc set suse 或 set opensuse
|
sudo chsrc set suse 或 opensuse
|
||||||
sudo chsrc set kali
|
sudo chsrc set kali
|
||||||
sudo chsrc set arch
|
sudo chsrc set arch
|
||||||
sudo chsrc set archlinuxcn
|
sudo chsrc set archlinuxcn
|
||||||
sudo chsrc set manjaro
|
sudo chsrc set manjaro
|
||||||
sudo chsrc set gentoo
|
sudo chsrc set gentoo
|
||||||
sudo chsrc set rocky 或 set rockylinux
|
sudo chsrc set rocky 或 rockylinux
|
||||||
sudo chsrc set alma 或 set almalinux
|
sudo chsrc set alma 或 almalinux
|
||||||
sudo chsrc set alpine
|
sudo chsrc set alpine
|
||||||
sudo chsrc set void 或 set voidlinux
|
sudo chsrc set void 或 voidlinux
|
||||||
sudo chsrc set solus
|
sudo chsrc set solus
|
||||||
sudo chsrc set ros 或 set ros2
|
sudo chsrc set ros 或 ros2
|
||||||
sudo chsrc set trisquel
|
sudo chsrc set trisquel
|
||||||
sudo chsrc set lite 或 set linuxlite
|
sudo chsrc set lite 或 linuxlite
|
||||||
sudo chsrc set raspi 或 set raspberrypi
|
sudo chsrc set raspi 或 raspberrypi
|
||||||
sudo chsrc set armbian
|
sudo chsrc set armbian
|
||||||
sudo chsrc set openwrt
|
sudo chsrc set openwrt
|
||||||
|
|
||||||
sudo chsrc set openeuler
|
sudo chsrc set openeuler
|
||||||
sudo chsrc set openanolis
|
sudo chsrc set openanolis 或 anolis
|
||||||
sudo chsrc set openkylin
|
sudo chsrc set openkylin
|
||||||
sudo chsrc set deepin
|
sudo chsrc set deepin
|
||||||
|
|
||||||
chsrc set msys2 或 set msys
|
chsrc set msys2 或 msys
|
||||||
|
|
||||||
# BSD
|
# BSD
|
||||||
sudo chsrc set freebsd
|
sudo chsrc set freebsd
|
||||||
@ -232,15 +232,15 @@ sudo chsrc set netbsd
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
chsrc set winget
|
chsrc set winget
|
||||||
chsrc set brew 或 set homebrew
|
chsrc set brew 或 homebrew
|
||||||
chsrc set cocoapods 或 set cocoa / pod
|
chsrc set cocoapods 或 cocoa / pod
|
||||||
chsrc set dockerhub 或 set docker
|
chsrc set dockerhub 或 docker
|
||||||
chsrc set flathub
|
chsrc set flathub
|
||||||
chsrc set nix
|
chsrc set nix
|
||||||
chsrc set guix
|
chsrc set guix
|
||||||
chsrc set emacs 或 set elpa
|
chsrc set emacs 或 elpa
|
||||||
chsrc set tex 或 set ctan / latex / texlive / miktex
|
chsrc set tex 或 ctan / latex / texlive / miktex
|
||||||
chsrc set conda 或 set anaconda
|
chsrc set conda 或 anaconda
|
||||||
```
|
```
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
@ -169,23 +169,10 @@ os_msys2_sources[] = {
|
|||||||
{&Huawei, "https://mirrors.huaweicloud.com/msys2"},
|
{&Huawei, "https://mirrors.huaweicloud.com/msys2"},
|
||||||
{&Netease, "https://mirrors.163.com/msys2"},
|
{&Netease, "https://mirrors.163.com/msys2"},
|
||||||
{&Sohu, "https://mirrors.sohu.com/msys2"}
|
{&Sohu, "https://mirrors.sohu.com/msys2"}
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @time 2024-06-12 更新
|
|
||||||
*/
|
|
||||||
os_anolis_sources[] = {
|
|
||||||
{&Upstream, NULL},
|
|
||||||
{&Ali, "https://mirrors.aliyun.com/anolis"},
|
|
||||||
{&Hust, "https://mirrors.hust.edu.cn/anolis"}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @time 2024-06-07 更新
|
* @time 2024-06-07 更新
|
||||||
* @note 目前仅有一个源
|
* @note 目前仅有一个源
|
||||||
@ -298,8 +285,6 @@ def_sources_n(pl_dotnet);
|
|||||||
|
|
||||||
def_sources_n(os_msys2);
|
def_sources_n(os_msys2);
|
||||||
|
|
||||||
def_sources_n(os_anolis);
|
|
||||||
|
|
||||||
def_sources_n(wr_winget);
|
def_sources_n(wr_winget);
|
||||||
def_sources_n(wr_brew); def_sources_n(wr_cocoapods);
|
def_sources_n(wr_brew); def_sources_n(wr_cocoapods);
|
||||||
|
|
||||||
|
23
src/chsrc.c
23
src/chsrc.c
@ -98,6 +98,7 @@ pl_clojure_setsrc (char *option)
|
|||||||
#include "recipe/os/yum-family/AlmaLinux.c"
|
#include "recipe/os/yum-family/AlmaLinux.c"
|
||||||
#include "recipe/os/yum-family/Rocky-Linux.c"
|
#include "recipe/os/yum-family/Rocky-Linux.c"
|
||||||
#include "recipe/os/yum-family/openEuler.c"
|
#include "recipe/os/yum-family/openEuler.c"
|
||||||
|
#include "recipe/os/yum-family/Anolis-OS.c"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HELP: 未经测试
|
* HELP: 未经测试
|
||||||
@ -157,28 +158,6 @@ os_manjaro_setsrc (char *option)
|
|||||||
#include "recipe/os/openwrt.c"
|
#include "recipe/os/openwrt.c"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参考: https://mirrors.hust.edu.cn/docs/anolis
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
os_anolis_setsrc (char *option)
|
|
||||||
{
|
|
||||||
chsrc_ensure_root ();
|
|
||||||
|
|
||||||
SourceInfo source;
|
|
||||||
chsrc_yield_source (os_anolis);
|
|
||||||
chsrc_confirm_source (&source);
|
|
||||||
|
|
||||||
char *cmd = xy_strjoin (3, "sed -i.bak -E 's|https?://(mirrors\\.openanolis\\.cn/anolis)|", source.url, "|g' /etc/yum.repos.d/*.repo");
|
|
||||||
chsrc_run (cmd, RunOpt_Default);
|
|
||||||
|
|
||||||
chsrc_run ("dnf makecache", RunOpt_Default);
|
|
||||||
chsrc_run ("dnf update", RunOpt_No_Last_New_Line);
|
|
||||||
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#include "recipe/os/freebsd.c"
|
#include "recipe/os/freebsd.c"
|
||||||
#include "recipe/os/netbsd.c"
|
#include "recipe/os/netbsd.c"
|
||||||
#include "recipe/os/openbsd.c"
|
#include "recipe/os/openbsd.c"
|
||||||
|
@ -39,7 +39,6 @@ static const char
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
def_target_noget(os_anolis);
|
|
||||||
def_target_noget(os_msys2);
|
def_target_noget(os_msys2);
|
||||||
TargetInfo os_manjaro_target = {NULL, os_manjaro_setsrc, NULL, NULL, 0};
|
TargetInfo os_manjaro_target = {NULL, os_manjaro_setsrc, NULL, NULL, 0};
|
||||||
|
|
||||||
@ -70,7 +69,7 @@ static const char
|
|||||||
|
|
||||||
*os_openkylin [] = {"openkylin", NULL, t(&os_openkylin_target)},
|
*os_openkylin [] = {"openkylin", NULL, t(&os_openkylin_target)},
|
||||||
*os_openeuler [] = {"openeuler", NULL, t(&os_openeuler_target)},
|
*os_openeuler [] = {"openeuler", NULL, t(&os_openeuler_target)},
|
||||||
*os_anolis [] = {"openanolis", NULL, t(&os_anolis_target)},
|
*os_anolis [] = {"openanolis", "anolis", NULL, t(&os_anolis_target)},
|
||||||
*os_deepin [] = {"deepin", NULL, t(&os_deepin_target)},
|
*os_deepin [] = {"deepin", NULL, t(&os_deepin_target)},
|
||||||
|
|
||||||
*os_freebsd [] = {"freebsd", NULL, t(&os_freebsd_target)},
|
*os_freebsd [] = {"freebsd", NULL, t(&os_freebsd_target)},
|
||||||
|
44
src/recipe/os/yum-family/Anolis-OS.c
Normal file
44
src/recipe/os/yum-family/Anolis-OS.c
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/** ------------------------------------------------------------
|
||||||
|
* 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-24>
|
||||||
|
* Last Modified : <2024-08-16>
|
||||||
|
*
|
||||||
|
* Anolis OS 为这个操作系统的名字,OpenAnolis(龙蜥社区) 只是社区名
|
||||||
|
* ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @time 2024-06-12 更新
|
||||||
|
*/
|
||||||
|
static SourceInfo
|
||||||
|
os_anolis_sources[] = {
|
||||||
|
{&Upstream, NULL},
|
||||||
|
{&Ali, "https://mirrors.aliyun.com/anolis"},
|
||||||
|
{&Hust, "https://mirrors.hust.edu.cn/anolis"}
|
||||||
|
};
|
||||||
|
def_sources_n(os_anolis);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参考: https://mirrors.hust.edu.cn/docs/anolis
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
os_anolis_setsrc (char *option)
|
||||||
|
{
|
||||||
|
chsrc_ensure_root ();
|
||||||
|
|
||||||
|
SourceInfo source;
|
||||||
|
chsrc_yield_source (os_anolis);
|
||||||
|
chsrc_confirm_source (&source);
|
||||||
|
|
||||||
|
char *cmd = xy_strjoin (3, "sed -i.bak -E 's|https?://(mirrors\\.openanolis\\.cn/anolis)|", source.url, "|g' /etc/yum.repos.d/*.repo");
|
||||||
|
chsrc_run (cmd, RunOpt_Default);
|
||||||
|
|
||||||
|
chsrc_run ("dnf makecache", RunOpt_Default);
|
||||||
|
chsrc_run ("dnf update", RunOpt_No_Last_New_Line);
|
||||||
|
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
||||||
|
}
|
||||||
|
|
||||||
|
def_target_noget(os_anolis);
|
Loading…
x
Reference in New Issue
Block a user