Fix wr recipes

This commit is contained in:
Aoran Zeng 2025-08-10 21:24:42 +08:00
parent 0ecd128f8f
commit 797563c1db
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
16 changed files with 106 additions and 103 deletions

View File

@ -37,8 +37,8 @@
* chsrc: Change Source
* ------------------------------------------------------------*/
#define Chsrc_Version "0.2.2.2"
#define Chsrc_Release_Date "2025/08/09"
#define Chsrc_Version "0.2.2.3"
#define Chsrc_Release_Date "2025/08/10"
#define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc"
#define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc"
@ -86,6 +86,7 @@
#include "recipe/lang/NuGet.c"
#include "recipe/lang/Clojure.c"
#include "recipe/os/rawstr4c.h"
#include "recipe/os/APT/common.h"
// Debian-based
@ -127,6 +128,21 @@
#include "recipe/os/BSD/NetBSD.c"
#include "recipe/os/BSD/OpenBSD.c"
#include "recipe/ware/TeX-Live.c"
#include "recipe/ware/Emacs.c"
#include "recipe/ware/WinGet.c"
#include "recipe/ware/Homebrew/Homebrew.c"
#include "recipe/ware/CocoaPods.c"
#include "recipe/ware/Nix.c"
#include "recipe/ware/Guix.c"
#include "recipe/ware/Flathub.c"
#include "recipe/ware/Docker-Hub/Docker-Hub.c"
#include "recipe/ware/Anaconda/Anaconda.c"
#include "recipe/menu.c"
#include "rawstr4c.h"

View File

@ -8,7 +8,7 @@ void
pl_php_prelude ()
{
use_this(pl_php);
chef_allow_gsr(pl_php);
chef_allow_gs(pl_php);
chef_set_created_on (this, "2023-08-30");
chef_set_last_updated (this, "2025-08-10");

View File

@ -8,7 +8,7 @@ void
pl_perl_prelude ()
{
use_this(pl_perl);
chef_allow_gsr(pl_perl);
chef_allow_gs(pl_perl);
chef_set_created_on (this, "2023-09-31");
chef_set_last_updated (this, "2025-08-10");

View File

@ -5,41 +5,43 @@
* Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
* |
* Created On : <2023-09-01>
* Major Revision : 2
* Last Modified : <2025-08-09>
* Major Revision : 3
* Last Modified : <2025-08-10>
* ------------------------------------------------------------*/
#define t(o) &o##_target, &o##_prelude
TargetRegisterInfo_t
chsrc_pl_menu[] =
{
{&pl_ruby_target, NULL, "gem ruby rb rubygem rubygems bundler"},
{&pl_python_group_target, NULL, "python pypi py"},
{&pl_python_pip_target, NULL, "pip"},
{&pl_python_poetry_target, NULL, "poetry"},
{&pl_python_pdm_target, NULL, "pdm"},
{&pl_python_rye_target, NULL, "rye"},
{&pl_python_uv_target, NULL, "uv"},
{&pl_js_group_target, NULL, "node nodejs"},
{&pl_js_bun_target, NULL, "bun"},
{&pl_js_npm_target, NULL, "npm"},
{&pl_js_yarn_target, NULL, "yarn"},
{&pl_js_pnpm_target, NULL, "pnpm"},
{&pl_js_nvm_target, NULL, "nvm"},
{&pl_perl_target, NULL, "perl cpan"},
{&pl_php_target, NULL, "php composer"},
{&pl_lua_target, NULL, "lua luarocks"},
{&pl_go_target, NULL, "go golang goproxy"},
{&pl_rust_cargo_target, NULL, "rust cargo crate crates"},
{&pl_rust_rustup_target, NULL, "rustup"},
{&pl_java_target, NULL, "java maven mvn gradle"},
{&pl_clojure_target, NULL, "clojure clojars cloj lein"},
{&pl_dart_target, NULL, "dart pub"},
{&pl_dart_flutter_target, NULL, "flutter"},
{&pl_nuget_target, NULL, "nuget net .net dotnet"},
{&pl_haskell_target, NULL, "haskell cabal stack hackage"},
{&pl_ocaml_target, NULL, "ocaml opam"},
{&pl_r_target, NULL, "cran r"},
{&pl_julia_target, NULL, "julia"},
{t(pl_ruby), "gem ruby rb rubygem rubygems bundler"},
{t(pl_python_group), "python pypi py"},
{t(pl_python_pip), "pip"},
{t(pl_python_poetry), "poetry"},
{t(pl_python_pdm), "pdm"},
{t(pl_python_rye), "rye"},
{t(pl_python_uv), "uv"},
{t(pl_js_group), "node nodejs"},
{t(pl_js_bun), "bun"},
{t(pl_js_npm), "npm"},
{t(pl_js_yarn), "yarn"},
{t(pl_js_pnpm), "pnpm"},
{t(pl_js_nvm), "nvm"},
{t(pl_perl), "perl cpan"},
{t(pl_php), "php composer"},
{t(pl_lua), "lua luarocks"},
{t(pl_go), "go golang goproxy"},
{t(pl_rust_cargo), "rust cargo crate crates"},
{t(pl_rust_rustup), "rustup"},
{t(pl_java), "java maven mvn gradle"},
{t(pl_clojure), "clojure clojars cloj lein"},
{t(pl_dart), "dart pub"},
{t(pl_dart_flutter), "flutter"},
{t(pl_nuget), "nuget net .net dotnet"},
{t(pl_haskell), "haskell cabal stack hackage"},
{t(pl_ocaml), "ocaml opam"},
{t(pl_r), "cran r"},
{t(pl_julia), "julia"},
};
@ -48,53 +50,54 @@ TargetRegisterInfo_t
chsrc_os_menu[] =
{
/* Zorin OS 完全使用 Ubuntu 的换源方法,二者兼容 */
{&os_ubuntu_target, NULL, "ubuntu zorinos"},
{&os_linuxmint_target, NULL, "linuxmint"},
{&os_debian_target, NULL, "debian"},
{&os_fedora_target, NULL, "fedora"},
{&os_opensuse_target, NULL, "opensuse opensuse-leap opensuse-tumbleweed"},
{&os_kali_target, NULL, "kali"},
{&os_msys2_target, NULL, "msys2 msys"},
{&os_arch_target, NULL, "arch archlinux"},
{&os_archlinuxcn_target, NULL, "archlinuxcn archcn"},
{&os_manjaro_target, NULL, "manjaro"},
{&os_gentoo_target, NULL, "gentoo"},
{&os_rockylinux_target, NULL, "rocky rockylinux"},
{&os_almalinux_target, NULL, "alma almalinux"},
{&os_alpine_target, NULL, "alpine"},
{&os_voidlinux_target, NULL, "voidlinux"},
{&os_solus_target, NULL, "solus"},
{&os_trisquel_target, NULL, "trisquel"},
{&os_linuxlite_target, NULL, "linuxlite"},
{&os_ros_target, NULL, "ros ros2"},
{&os_raspberrypi_target, NULL, "raspi raspberrypi"},
{&os_armbian_target, NULL, "armbian"},
{&os_openwrt_target, NULL, "openwrt opkg LEDE"},
{&os_termux_target, NULL, "termux"},
{&os_openkylin_target, NULL, "openkylin"},
{&os_openeuler_target, NULL, "openeuler"},
{&os_anolis_target, NULL, "openanolis anolis"},
{&os_deepin_target, NULL, "deepin"},
{&os_freebsd_target, NULL, "freebsd"},
{&os_netbsd_target, NULL, "netbsd"},
{&os_openbsd_target, NULL, "openbsd"},
{t(os_ubuntu), "ubuntu zorinos"},
{t(os_linuxmint), "linuxmint"},
{t(os_debian), "debian"},
{t(os_fedora), "fedora"},
{t(os_opensuse), "opensuse opensuse-leap opensuse-tumbleweed"},
{t(os_kali), "kali"},
{t(os_msys2), "msys2 msys"},
{t(os_arch), "arch archlinux"},
{t(os_archlinuxcn),"archlinuxcn archcn"},
{t(os_manjaro), "manjaro"},
{t(os_gentoo), "gentoo"},
{t(os_rockylinux), "rocky rockylinux"},
{t(os_almalinux), "alma almalinux"},
{t(os_alpine), "alpine"},
{t(os_voidlinux), "voidlinux"},
{t(os_solus), "solus"},
{t(os_trisquel), "trisquel"},
{t(os_linuxlite), "linuxlite"},
{t(os_ros), "ros ros2"},
{t(os_raspberrypi),"raspi raspberrypi"},
{t(os_armbian), "armbian"},
{t(os_openwrt), "openwrt opkg LEDE"},
{t(os_termux), "termux"},
{t(os_openkylin), "openkylin"},
{t(os_openeuler), "openeuler"},
{t(os_anolis), "openanolis anolis"},
{t(os_deepin), "deepin"},
{t(os_freebsd), "freebsd"},
{t(os_netbsd), "netbsd"},
{t(os_openbsd), "openbsd"},
};
TargetRegisterInfo_t
chsrc_wr_menu[] =
{
{&wr_winget_target, NULL, "winget"},
{&wr_homebrew_target, NULL, "brew homebrew"},
{&wr_cocoapods_target, NULL, "cocoa cocoapods cocoapod"},
{&wr_dockerhub_target, NULL, "dockerhub docker"},
{&wr_flathub_target, wr_flathub_prelude, "flathub flatpak"},
{&wr_nix_target, NULL, "nix"},
{&wr_guix_target, NULL, "guix"},
{&wr_emacs_target, NULL, "emacs elpa"},
{&wr_tex_target, NULL, "latex ctan tex texlive miktex tlmgr mpm"},
{&wr_anaconda_target, NULL, "conda anaconda"},
{t(wr_winget), "winget"},
{t(wr_homebrew), "brew homebrew"},
{t(wr_cocoapods), "cocoa cocoapods cocoapod"},
{t(wr_dockerhub), "dockerhub docker"},
{t(wr_flathub), "flathub flatpak"},
{t(wr_nix), "nix"},
{t(wr_guix), "guix"},
{t(wr_emacs), "emacs elpa"},
{t(wr_tex), "latex ctan tex texlive miktex tlmgr mpm"},
{t(wr_anaconda), "conda anaconda"},
};
#undef t
@ -112,8 +115,6 @@ chsrc_available_mirrors[] = {
&Cqupt, &Cqu, &Neosoft,
/* ------------------------ 商业公司(通用镜像站) ------------------------ */
&Ali, // &Ali_ECS_VPC, &Ali_ECS_classic,
&Tencent, // &Tencent_Intra,
@ -125,16 +126,11 @@ chsrc_available_mirrors[] = {
&Api7, &Fit2Cloud, &DaoCloud,
/* ------------------------ 专用镜像站 ------------------------ */
&RubyChina, &EmacsChina, &NpmMirror, &GoProxyIO, &GoProxyCN, &RsProxyCN, &FlutterCN,
/* 暂不支持 &NugetOrg */
/* ------------------------ chsrc 内部实现 ------------------------ */
/* 不要列出 &UpstreamProvider 和 &UserDefinedProvider */
};

View File

@ -8,7 +8,7 @@ void
os_linuxmint_prelude ()
{
use_this(os_linuxmint);
chef_allow_gsr(os_linuxmint);
chef_allow_gs(os_linuxmint);
chef_set_created_on (this, "2023-09-29");
chef_set_last_updated (this, "2025-08-10");

View File

@ -8,7 +8,7 @@ void
os_ros_prelude ()
{
use_this(os_ros);
chef_allow_gsr(os_ros);
chef_allow_gs(os_ros);
chef_set_created_on (this, "2023-09-03");
chef_set_last_updated (this, "2025-08-10");

View File

@ -56,8 +56,7 @@ wr_anaconda_getsrc (char *option)
void
wr_anaconda_setsrc (char *option)
{
use_this(wr_anaconda);
Source_t source = chsrc_yield_source_and_confirm (this, option);
use_this_source(wr_anaconda);
char *w = xy_str_gsub (RAWSTR_wr_anaconda_condarc, "@1@", source.url);

View File

@ -40,8 +40,7 @@ wr_cocoapods_prelude ()
void
wr_cocoapods_setsrc (char *option)
{
use_this(wr_cocoapods);
Source_t source = chsrc_yield_source_and_confirm (this, option);
use_this_source(wr_cocoapods);
chsrc_note2 ("请手动执行以下命令:");
p("cd ~/.cocoapods/repos");

View File

@ -74,8 +74,8 @@ void
wr_dockerhub_setsrc (char *option)
{
chsrc_ensure_root ();
use_this(wr_dockerhub);
Source_t source = chsrc_yield_source_and_confirm (this, option);
use_this_source(wr_dockerhub);
if (xy_on_linux || xy_on_bsd)
{

View File

@ -49,8 +49,7 @@ wr_emacs_prelude ()
void
wr_emacs_setsrc (char *option)
{
use_this(wr_emacs);
Source_t source = chsrc_yield_source_and_confirm (this, option);
use_this_source(wr_emacs);
chsrc_note2 ("Emacs换源涉及Elisp, 需要手动查阅并换源:");
p (source.url);

View File

@ -66,8 +66,7 @@ wr_flathub_getsrc (char *option)
void
wr_flathub_setsrc (char *option)
{
use_this(wr_flathub);
Source_t source = chsrc_yield_source_and_confirm (this, option);
use_this_source(wr_flathub);
chsrc_alert2 ("若出现问题,可先调用以下命令:");
char *note = xy_strjoin (3,

View File

@ -39,8 +39,7 @@ wr_guix_prelude ()
void
wr_guix_setsrc (char *option)
{
use_this(wr_guix);
Source_t source = chsrc_yield_source_and_confirm (this, option);
use_this_source(wr_guix);
char *file = xy_strjoin (3, "(list (channel\n"
" (inherit (car %default-channels))\n"

View File

@ -56,8 +56,7 @@ wr_homebrew_getsrc (char *option)
void
wr_homebrew_setsrc (char *option)
{
use_this(wr_homebrew);
Source_t source = chsrc_yield_source_and_confirm (this, option);
use_this_source(wr_homebrew);
char *w = xy_str_gsub (RAWSTR_wr_homebrew_config_in_bash, "@1@", source.url);

View File

@ -52,8 +52,7 @@ wr_nix_setsrc (char *option)
{
wr_nix_check_cmd ();
use_this(wr_nix);
Source_t source = chsrc_yield_source_and_confirm (this, option);
use_this_source(wr_nix);
char *cmd = xy_strjoin (3, "nix-channel --add ", source.url, "nixpkgs-unstable nixpkgs");
chsrc_run (cmd, RunOpt_Default);

View File

@ -85,8 +85,7 @@ wr_tex_setsrc (char *option)
bool tlmgr_exist, mpm_exist;
wr_tex_check_cmd (&tlmgr_exist, &mpm_exist);
use_this(wr_tex);
Source_t source = chsrc_yield_source_and_confirm (this, option);
use_this_source(wr_tex);
char *cmd = NULL;

View File

@ -46,8 +46,7 @@ wr_winget_getsrc (char *option)
void
wr_winget_setsrc (char *option)
{
use_this(wr_winget);
Source_t source = chsrc_yield_source_and_confirm (this, option);
use_this_source(wr_winget);
chsrc_run ("winget source remove winget", RunOpt_Default);
chsrc_run (xy_strjoin (3, "winget source add winget ", source.url, " --trust-level trusted"), RunOpt_Default);