mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-02-02 14:41:18 +08:00
Split lua out
This commit is contained in:
parent
7416a9d74d
commit
6c53a19e2e
|
@ -103,9 +103,7 @@ MirrorSite
|
|||
"https://mirrors.163.com/deepin-cd" Big_File_deepin},
|
||||
|
||||
Sohu = {"sohu", "SOHU", "搜狐开源镜像站", "https://mirrors.sohu.com/",
|
||||
"https://mirrors.sohu.com/deepin-cd" Big_File_deepin},
|
||||
|
||||
Api7 = {"api7", "api7.ai", "深圳支流科技有限公司", "https://www.apiseven.com/", NULL};
|
||||
"https://mirrors.sohu.com/deepin-cd" Big_File_deepin};
|
||||
|
||||
|
||||
// 开源社区
|
||||
|
@ -187,17 +185,6 @@ pl_php_sources[] = {
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* 2023-09-27 更新
|
||||
*
|
||||
* @note 目前只有唯一一个源
|
||||
*/
|
||||
pl_lua_sources[] = {
|
||||
{&Upstream, NULL},
|
||||
{&Api7, "https://luarocks.cn"},
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 2024-04-18 更新
|
||||
*
|
||||
|
@ -875,7 +862,7 @@ wr_tex_sources[] = {
|
|||
#define def_sources_n(t) const size_t t##_sources_n = xy_arylen(t##_sources)
|
||||
|
||||
def_sources_n(pl_nodejs);
|
||||
def_sources_n(pl_perl); def_sources_n(pl_php); def_sources_n(pl_lua);
|
||||
def_sources_n(pl_perl); def_sources_n(pl_php);
|
||||
def_sources_n(pl_go); def_sources_n(pl_rust);
|
||||
def_sources_n(pl_java); def_sources_n(pl_clojure);
|
||||
def_sources_n(pl_dotnet); def_sources_n(pl_dart); def_sources_n(pl_haskell);
|
||||
|
|
36
src/chsrc.c
36
src/chsrc.c
|
@ -188,40 +188,7 @@ pl_php_setsrc (char *option)
|
|||
chsrc_say_lastly (&source, ChsrcTypeSemiAuto);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pl_lua_getsrc (char *option)
|
||||
{
|
||||
chsrc_view_file ("~/.luarocks/config.lua");
|
||||
chsrc_view_file ("~/.luarocks/upload_config.lua");
|
||||
}
|
||||
|
||||
/**
|
||||
* Lua 换源,参考:https://luarocks.cn/
|
||||
*/
|
||||
void
|
||||
pl_lua_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (pl_lua);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
char *config = xy_strjoin (3, "rocks_servers = {\n"
|
||||
" \"", source.url, "\"\n"
|
||||
"}");
|
||||
|
||||
chsrc_note2 ("请手动修改 ~/.luarocks/config.lua 文件 (用于下载):");
|
||||
puts (config);
|
||||
|
||||
char *upload_config = xy_strjoin (3, "key = \"<Your API Key>\"\n"
|
||||
"server = \"", source.url, "\"");
|
||||
|
||||
chsrc_note2 ("请手动修改 ~/.luarocks/upload_config.lua 文件 (用于上传):");
|
||||
puts (upload_config);
|
||||
|
||||
chsrc_say_lastly (&source, ChsrcTypeManual);
|
||||
}
|
||||
|
||||
#include "recipe/lang/lua.c"
|
||||
|
||||
|
||||
void
|
||||
|
@ -2141,7 +2108,6 @@ wr_anaconda_setsrc (char *option)
|
|||
|
||||
/************************************** Begin Target Matrix ****************************************/
|
||||
def_target(pl_nodejs); def_target(pl_perl); def_target(pl_php);
|
||||
def_target(pl_lua);
|
||||
def_target(pl_rust); def_target(pl_go); def_target(pl_java); def_target(pl_dart); def_target(pl_ocaml);
|
||||
def_target(pl_r); def_target(pl_julia);
|
||||
def_target_noget (pl_clojure);
|
||||
|
|
58
src/recipe/lang/lua.c
Normal file
58
src/recipe/lang/lua.c
Normal file
|
@ -0,0 +1,58 @@
|
|||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* Contributors : Aoran Zeng <ccmywish@qq.com>
|
||||
* Created on : <2023-09-27>
|
||||
* Last modified : <2024-08-09>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
static MirrorSite
|
||||
Api7 = {"api7", "api7.ai", "深圳支流科技有限公司", "https://www.apiseven.com/", NULL};
|
||||
|
||||
|
||||
/**
|
||||
* @time 2023-09-27 更新
|
||||
* @note 目前只有一个源
|
||||
*/
|
||||
static SourceInfo
|
||||
pl_lua_sources[] = {
|
||||
{&Upstream, NULL},
|
||||
{&Api7, "https://luarocks.cn"},
|
||||
};
|
||||
def_sources_n(pl_lua);
|
||||
|
||||
|
||||
void
|
||||
pl_lua_getsrc (char *option)
|
||||
{
|
||||
chsrc_view_file ("~/.luarocks/config.lua");
|
||||
chsrc_view_file ("~/.luarocks/upload_config.lua");
|
||||
}
|
||||
|
||||
/**
|
||||
* Lua 换源,参考:https://luarocks.cn/
|
||||
*/
|
||||
void
|
||||
pl_lua_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (pl_lua);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
char *config = xy_strjoin (3, "rocks_servers = {\n"
|
||||
" \"", source.url, "\"\n"
|
||||
"}");
|
||||
|
||||
chsrc_note2 ("请手动修改 ~/.luarocks/config.lua 文件 (用于下载):");
|
||||
puts (config);
|
||||
|
||||
char *upload_config = xy_strjoin (3, "key = \"<Your API Key>\"\n"
|
||||
"server = \"", source.url, "\"");
|
||||
|
||||
chsrc_note2 ("请手动修改 ~/.luarocks/upload_config.lua 文件 (用于上传):");
|
||||
puts (upload_config);
|
||||
|
||||
chsrc_say_lastly (&source, ChsrcTypeManual);
|
||||
}
|
||||
|
||||
def_target(pl_lua);
|
Loading…
Reference in New Issue
Block a user