Skip to content

Commit 81b9c29

Browse files
committed
使用 chsrc_register_contributors() 并将大部分 #include 放于 menu.c
1 parent f4718a0 commit 81b9c29

File tree

2 files changed

+140
-131
lines changed

2 files changed

+140
-131
lines changed

src/chsrc-main.c

Lines changed: 41 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,15 @@
11
/** ------------------------------------------------------------
2-
* Copyright © 2023-2025 Aoran Zeng, Heng Guo
2+
* Copyright © 2023-2025 曾奥然, 郭恒
33
* SPDX-License-Identifier: GPL-3.0-or-later
44
* -------------------------------------------------------------
5-
* Project Name : chsrc
6-
* Project Authors : Aoran Zeng <[email protected]>
7-
* | Heng Guo <[email protected]>
8-
* Contributors : Aaron Ruan <[email protected]>
9-
* | Rui Chen <[email protected]>
10-
* | Shengwei Chen <[email protected]>
11-
* | BlockLune <[email protected]>
12-
* | Mr. Will <[email protected]>
13-
* | Terrasse <[email protected]>
14-
* | Lontten <[email protected]>
15-
* | happy game <[email protected]>
16-
* | Word2VecT <[email protected]>
17-
* | xuan <[email protected]>
18-
* | GnixAij <[email protected]>
19-
* | ChatGPT <https://chatgpt.com>
20-
* | czyt <[email protected]>
21-
* | zouri <[email protected]>
22-
* | yongxiang <[email protected]>
23-
* | YU-7 <[email protected]>
24-
* | juzeon <[email protected]>
25-
* | Jialin Lyu <[email protected]>
26-
* | GitHub Copilot <https://github.com/copilot>
27-
28-
* | MadDogOwner <[email protected]>
29-
* | sanchuanhehe <[email protected]>
30-
* | Mikachu2333 <[email protected]>
31-
* | Rui Yang <[email protected]>
32-
* | BingChunMoLi <[email protected]>
33-
* |
34-
* Created On : <2023-08-28>
35-
* Last Modified : See <Chsrc_Release_Date>
365
*
37-
* chsrc: Change Source —— 全平台通用命令行换源工具
6+
* chsrc: Change Source
7+
*
8+
* 全平台通用换源工具与框架
9+
*
3810
* ------------------------------------------------------------*/
3911

12+
#define Chsrc_Initial_Date "2023-08-28"
4013
#define Chsrc_Version "0.2.2.3"
4114
#define Chsrc_Release_Date "2025/08/11"
4215
#define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc"
@@ -45,101 +18,39 @@
4518
#include "framework/core.c"
4619
#include "framework/chef.c"
4720

48-
49-
#include "recipe/lang/rawstr4c.h"
50-
51-
#include "recipe/lang/Ruby/Ruby.c"
52-
#include "recipe/lang/Python/common.h"
53-
#include "recipe/lang/Python/pip.c"
54-
#include "recipe/lang/Python/Poetry.c"
55-
#include "recipe/lang/Python/PDM.c"
56-
#include "recipe/lang/Python/Rye.c"
57-
#include "recipe/lang/Python/uv.c"
58-
#include "recipe/lang/Python/Python.c"
59-
60-
#include "recipe/lang/JavaScript/common.h"
61-
#include "recipe/lang/JavaScript/npm.c"
62-
#include "recipe/lang/JavaScript/pnpm.c"
63-
#include "recipe/lang/JavaScript/Yarn.c"
64-
#include "recipe/lang/JavaScript/JavaScript.c"
65-
#include "recipe/lang/JavaScript/Bun.c"
66-
#include "recipe/lang/JavaScript/nvm.c"
67-
68-
#include "recipe/lang/Perl.c"
69-
#include "recipe/lang/PHP.c"
70-
#include "recipe/lang/Lua.c"
71-
#include "recipe/lang/Go.c"
72-
#include "recipe/lang/Java.c"
73-
74-
#include "recipe/lang/Rust/common.h"
75-
#include "recipe/lang/Rust/rustup.c"
76-
#include "recipe/lang/Rust/Cargo.c"
77-
78-
#include "recipe/lang/Dart/common.h"
79-
#include "recipe/lang/Dart/Pub.c"
80-
#include "recipe/lang/Dart/Flutter.c"
81-
82-
#include "recipe/lang/Haskell.c"
83-
#include "recipe/lang/OCaml.c"
84-
#include "recipe/lang/R.c"
85-
#include "recipe/lang/Julia.c"
86-
#include "recipe/lang/NuGet.c"
87-
#include "recipe/lang/Clojure.c"
88-
89-
90-
#include "recipe/os/rawstr4c.h"
91-
#include "recipe/os/APT/common.h"
92-
// Debian-based
93-
#include "recipe/os/APT/Debian.c"
94-
#include "recipe/os/APT/Ubuntu.c"
95-
#include "recipe/os/APT/Kali-Linux.c"
96-
#include "recipe/os/APT/Raspberry-Pi-OS.c"
97-
// Ubuntu-based
98-
#include "recipe/os/APT/Linux-Mint.c"
99-
#include "recipe/os/APT/Trisquel.c"
100-
#include "recipe/os/APT/Linux-Lite.c"
101-
// Debian-based and Ubuntu-based
102-
#include "recipe/os/APT/Armbian.c"
103-
// Independent
104-
#include "recipe/os/APT/ROS.c"
105-
#include "recipe/os/APT/Termux.c"
106-
#include "recipe/os/APT/openKylin.c"
107-
#include "recipe/os/APT/deepin.c"
108-
109-
#include "recipe/os/YUM/common.h"
110-
#include "recipe/os/YUM/Fedora-Linux.c"
111-
#include "recipe/os/YUM/AlmaLinux.c"
112-
#include "recipe/os/YUM/Rocky-Linux.c"
113-
#include "recipe/os/YUM/openEuler.c"
114-
#include "recipe/os/YUM/Anolis-OS.c"
115-
116-
#include "recipe/os/pacman/Arch-Linux.c"
117-
#include "recipe/os/pacman/Manjaro-Linux.c"
118-
#include "recipe/os/pacman/MSYS2.c"
119-
120-
#include "recipe/os/openSUSE.c"
121-
#include "recipe/os/Alpine-Linux.c"
122-
#include "recipe/os/Gentoo-Linux.c"
123-
#include "recipe/os/Void-Linux.c"
124-
#include "recipe/os/Solus.c"
125-
#include "recipe/os/OpenWrt.c"
126-
127-
#include "recipe/os/BSD/FreeBSD.c"
128-
#include "recipe/os/BSD/NetBSD.c"
129-
#include "recipe/os/BSD/OpenBSD.c"
130-
131-
132-
#include "recipe/ware/TeX-Live.c"
133-
#include "recipe/ware/Emacs.c"
134-
#include "recipe/ware/WinGet.c"
135-
#include "recipe/ware/Homebrew/Homebrew.c"
136-
#include "recipe/ware/CocoaPods.c"
137-
#include "recipe/ware/Nix.c"
138-
#include "recipe/ware/Guix.c"
139-
#include "recipe/ware/Flatpak.c"
140-
#include "recipe/ware/Docker/Docker.c"
141-
#include "recipe/ware/Anaconda/Anaconda.c"
142-
21+
void
22+
chsrc_register_contributors ()
23+
{
24+
/* 项目创建者 */
25+
chef_register_contributor ("@ccmywish", "曾奥然", "[email protected]", NULL);
26+
chef_register_contributor ("@G_I_Y", "郭恒", "[email protected]", NULL);
27+
/* 所有贡献者 (按参与贡献时间排序) */
28+
chef_register_contributor ("@Aaron-212", "Aaron Ruan", "[email protected]", NULL);
29+
chef_register_contributor ("@chenrui333", "Rui Chen", "[email protected]", NULL);
30+
chef_register_contributor ("@livelycode36", "Shengwei Chen", "[email protected]", NULL);
31+
chef_register_contributor ("@BlockLune", "BlockLune", "[email protected]", NULL);
32+
chef_register_contributor ("@MrWillCom", "Mr. Will", "[email protected]", NULL);
33+
chef_register_contributor ("@Jerry-Terrasse", "Terrasse", "[email protected]", NULL);
34+
chef_register_contributor ("@lontten", "Lontten", "[email protected]", NULL);
35+
chef_register_contributor ("@happy-game", "Happy Game", "[email protected]", NULL);
36+
chef_register_contributor ("@Word2VecT", "Word2VecT", "[email protected]", NULL);
37+
chef_register_contributor ("@wickdynex", "Xuan", "[email protected]", NULL);
38+
chef_register_contributor ("@Efterklang", "GnixAij", "[email protected]", NULL);
39+
chef_register_contributor ("@ChatGPT", "ChatGPT", "chatgpt.com", NULL);
40+
chef_register_contributor ("@czyt", "czyt", "[email protected]", NULL);
41+
chef_register_contributor ("@zouri", "Zouri", "[email protected]", NULL);
42+
chef_register_contributor ("@xyx1926885268", "Yongxiang", "[email protected]", NULL);
43+
chef_register_contributor ("@YU-7", "YU-7", "[email protected]", NULL);
44+
chef_register_contributor ("@juzeon", "juzeon", "[email protected]", NULL);
45+
chef_register_contributor ("@jialinlvcn", "Jialin Lyu", "[email protected]", NULL);
46+
chef_register_contributor ("@GitHub Copilot", "GitHub Copilot", "github.com/copilot", NULL);
47+
chef_register_contributor ("@Kattos", "ccy", "[email protected]", NULL);
48+
chef_register_contributor ("@xrgzs", "MadDogOwner", "[email protected]", NULL);
49+
chef_register_contributor ("@sanchuanhehe", "sanchuanhehe", "[email protected]", NULL);
50+
chef_register_contributor ("@Mikachu2333", "Mikachu2333", "[email protected]", NULL);
51+
chef_register_contributor ("@techoc", "Rui Yang", "[email protected]", NULL);
52+
chef_register_contributor ("@BingChunMoLi", "BingChunMoLi", "[email protected]", NULL);
53+
}
14354

14455
#include "recipe/menu.c"
14556

@@ -611,6 +522,8 @@ get_target (const char *input, TargetOp code, char *option)
611522

612523
if (!matched) return false;
613524

525+
chsrc_register_contributors ();
526+
614527
if (TargetOp_Set_Source==code)
615528
{
616529
if (target->setfn)

src/recipe/menu.c

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,110 @@
11
/** ------------------------------------------------------------
22
* SPDX-License-Identifier: GPL-3.0-or-later
33
* -------------------------------------------------------------
4-
* File Authors : Aoran Zeng <[email protected]>
4+
* File Authors : 曾奥然 <[email protected]>
55
* Contributors : Mikachu2333 <[email protected]>
66
* |
77
* Created On : <2023-09-01>
8-
* Major Revision : 3
9-
* Last Modified : <2025-08-10>
8+
* Major Revision : 4
9+
* Last Modified : <2025-08-20>
1010
* ------------------------------------------------------------*/
1111

12+
#include "lang/rawstr4c.h"
13+
14+
#include "lang/Ruby/Ruby.c"
15+
#include "lang/Python/common.h"
16+
#include "lang/Python/pip.c"
17+
#include "lang/Python/Poetry.c"
18+
#include "lang/Python/PDM.c"
19+
#include "lang/Python/Rye.c"
20+
#include "lang/Python/uv.c"
21+
#include "lang/Python/Python.c"
22+
23+
#include "lang/JavaScript/common.h"
24+
#include "lang/JavaScript/npm.c"
25+
#include "lang/JavaScript/pnpm.c"
26+
#include "lang/JavaScript/Yarn.c"
27+
#include "lang/JavaScript/JavaScript.c"
28+
#include "lang/JavaScript/Bun.c"
29+
#include "lang/JavaScript/nvm.c"
30+
31+
#include "lang/Perl.c"
32+
#include "lang/PHP.c"
33+
#include "lang/Lua.c"
34+
#include "lang/Go.c"
35+
#include "lang/Java.c"
36+
37+
#include "lang/Rust/common.h"
38+
#include "lang/Rust/rustup.c"
39+
#include "lang/Rust/Cargo.c"
40+
41+
#include "lang/Dart/common.h"
42+
#include "lang/Dart/Pub.c"
43+
#include "lang/Dart/Flutter.c"
44+
45+
#include "lang/Haskell.c"
46+
#include "lang/OCaml.c"
47+
#include "lang/R.c"
48+
#include "lang/Julia.c"
49+
#include "lang/NuGet.c"
50+
#include "lang/Clojure.c"
51+
52+
53+
#include "os/rawstr4c.h"
54+
#include "os/APT/common.h"
55+
// Debian-based
56+
#include "os/APT/Debian.c"
57+
#include "os/APT/Ubuntu.c"
58+
#include "os/APT/Kali-Linux.c"
59+
#include "os/APT/Raspberry-Pi-OS.c"
60+
// Ubuntu-based
61+
#include "os/APT/Linux-Mint.c"
62+
#include "os/APT/Trisquel.c"
63+
#include "os/APT/Linux-Lite.c"
64+
// Debian-based and Ubuntu-based
65+
#include "os/APT/Armbian.c"
66+
// Independent
67+
#include "os/APT/ROS.c"
68+
#include "os/APT/Termux.c"
69+
#include "os/APT/openKylin.c"
70+
#include "os/APT/deepin.c"
71+
72+
#include "os/YUM/common.h"
73+
#include "os/YUM/Fedora-Linux.c"
74+
#include "os/YUM/AlmaLinux.c"
75+
#include "os/YUM/Rocky-Linux.c"
76+
#include "os/YUM/openEuler.c"
77+
#include "os/YUM/Anolis-OS.c"
78+
79+
#include "os/pacman/Arch-Linux.c"
80+
#include "os/pacman/Manjaro-Linux.c"
81+
#include "os/pacman/MSYS2.c"
82+
83+
#include "os/openSUSE.c"
84+
#include "os/Alpine-Linux.c"
85+
#include "os/Gentoo-Linux.c"
86+
#include "os/Void-Linux.c"
87+
#include "os/Solus.c"
88+
#include "os/OpenWrt.c"
89+
90+
#include "os/BSD/FreeBSD.c"
91+
#include "os/BSD/NetBSD.c"
92+
#include "os/BSD/OpenBSD.c"
93+
94+
95+
#include "ware/TeX-Live.c"
96+
#include "ware/Emacs.c"
97+
#include "ware/WinGet.c"
98+
#include "ware/Homebrew/Homebrew.c"
99+
#include "ware/CocoaPods.c"
100+
#include "ware/Nix.c"
101+
#include "ware/Guix.c"
102+
#include "ware/Flatpak.c"
103+
#include "ware/Docker/Docker.c"
104+
#include "ware/Anaconda/Anaconda.c"
105+
106+
107+
12108
#define t(o) &o##_target, &o##_prelude
13109

14110
TargetRegisterInfo_t

0 commit comments

Comments
 (0)