mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-02-09 03:05:00 +08:00
Split ros out
This commit is contained in:
parent
37886aba47
commit
bf3ded202f
|
@ -297,23 +297,6 @@ os_openkylin_sources[] = {
|
||||||
{&Upstream, "https://archive.openkylin.top/openkylin/"},
|
{&Upstream, "https://archive.openkylin.top/openkylin/"},
|
||||||
{&Ali, "https://mirrors.aliyun.com/openkylin/"},
|
{&Ali, "https://mirrors.aliyun.com/openkylin/"},
|
||||||
{&Netease, "https://mirrors.163.com/openkylin/"},
|
{&Netease, "https://mirrors.163.com/openkylin/"},
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @time 2024-04-18 更新
|
|
||||||
* @note 未经测试是否有效
|
|
||||||
*/
|
|
||||||
os_ros_sources[] = {
|
|
||||||
{&Upstream, NULL},
|
|
||||||
{&Ali, "https://mirrors.aliyun.com"},
|
|
||||||
{&Bfsu, "https://mirrors.bfsu.edu.cn"},
|
|
||||||
{&Ustc, "https://mirrors.ustc.edu.cn"},
|
|
||||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn"},
|
|
||||||
{&Tencent, "https://mirrors.tencent.com"},
|
|
||||||
{&Huawei, "https://mirrors.huaweicloud.com"},
|
|
||||||
{&Netease, "https://mirrors.163.com"},
|
|
||||||
{&Sohu, "https://mirrors.sohu.com"}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -435,8 +418,6 @@ def_sources_n(os_rocky); def_sources_n(os_alma);
|
||||||
|
|
||||||
def_sources_n(os_linuxlite);
|
def_sources_n(os_linuxlite);
|
||||||
|
|
||||||
def_sources_n(os_ros);
|
|
||||||
|
|
||||||
def_sources_n(os_deepin); def_sources_n(os_openeuler); def_sources_n(os_openkylin);
|
def_sources_n(os_deepin); def_sources_n(os_openeuler); def_sources_n(os_openkylin);
|
||||||
def_sources_n(os_anolis);
|
def_sources_n(os_anolis);
|
||||||
|
|
||||||
|
|
30
src/chsrc.c
30
src/chsrc.c
|
@ -76,6 +76,7 @@ pl_clojure_setsrc (char *option)
|
||||||
#include "recipe/os/apt-family/trisquel.c"
|
#include "recipe/os/apt-family/trisquel.c"
|
||||||
#include "recipe/os/apt-family/armbian.c"
|
#include "recipe/os/apt-family/armbian.c"
|
||||||
#include "recipe/os/apt-family/raspberrypi.c"
|
#include "recipe/os/apt-family/raspberrypi.c"
|
||||||
|
#include "recipe/os/apt-family/ros.c"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -308,7 +309,7 @@ os_linuxlite_setsrc (char *option)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "./recipe/os/openwrt.c"
|
#include "recipe/os/openwrt.c"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -386,33 +387,6 @@ os_openkylin_setsrc (char *option)
|
||||||
#include "recipe/os/netbsd.c"
|
#include "recipe/os/netbsd.c"
|
||||||
#include "recipe/os/openbsd.c"
|
#include "recipe/os/openbsd.c"
|
||||||
|
|
||||||
/**
|
|
||||||
* 参考:
|
|
||||||
* https://mirrors.tuna.tsinghua.edu.cn/help/ros/
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
os_ros_setsrc (char *option)
|
|
||||||
{
|
|
||||||
chsrc_ensure_root ();
|
|
||||||
|
|
||||||
SourceInfo source;
|
|
||||||
chsrc_yield_source (os_ros);
|
|
||||||
chsrc_confirm_source (&source);
|
|
||||||
|
|
||||||
chsrc_backup ("/etc/apt/sources.list.d/ros-latest.list");
|
|
||||||
|
|
||||||
char *cmd = NULL;
|
|
||||||
cmd = xy_strjoin(3, "sed -E -i \'s@https?://.*/ros/ubuntu/?@", source.url, "@/ros/ubuntug\' /etc/apt/sources.list");
|
|
||||||
chsrc_run(cmd, RunOpt_Default);
|
|
||||||
|
|
||||||
cmd = "apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654";
|
|
||||||
chsrc_run (cmd, RunOpt_Default);
|
|
||||||
|
|
||||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
|
||||||
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ def_target_noget(os_rocky);
|
||||||
def_target_noget(os_alma);
|
def_target_noget(os_alma);
|
||||||
def_target_noget(os_openeuler);
|
def_target_noget(os_openeuler);
|
||||||
def_target_noget(os_anolis);
|
def_target_noget(os_anolis);
|
||||||
def_target_noget(os_ros);
|
|
||||||
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};
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,13 @@
|
||||||
#define OS_Is_Debian_Literally 1
|
#define OS_Is_Debian_Literally 1
|
||||||
#define OS_Is_Ubuntu 2
|
#define OS_Is_Ubuntu 2
|
||||||
|
|
||||||
|
// independent
|
||||||
|
#define OS_ROS_SourceList OS_Apt_SourceList_D "ros-latest.list"
|
||||||
|
|
||||||
|
// Ubuntu based
|
||||||
#define OS_LinuxMint_SourceList OS_Apt_SourceList_D "official-package-repositories.list"
|
#define OS_LinuxMint_SourceList OS_Apt_SourceList_D "official-package-repositories.list"
|
||||||
|
|
||||||
|
// Debian based
|
||||||
#define OS_Armbian_SourceList OS_Apt_SourceList_D "armbian.list"
|
#define OS_Armbian_SourceList OS_Apt_SourceList_D "armbian.list"
|
||||||
#define OS_RaspberryPi_SourceList OS_Apt_SourceList_D "raspi.list"
|
#define OS_RaspberryPi_SourceList OS_Apt_SourceList_D "raspi.list"
|
||||||
|
|
||||||
|
|
54
src/recipe/os/apt-family/ros.c
Normal file
54
src/recipe/os/apt-family/ros.c
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/** ------------------------------------------------------------
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
* -------------------------------------------------------------
|
||||||
|
* File Authors : Heng Guo <2085471348@qq.com>
|
||||||
|
* Contributors : Aoran Zeng <ccmywish@qq.com>
|
||||||
|
* Created On : <2023-09-03>
|
||||||
|
* Last Modified : <2024-08-16>
|
||||||
|
* ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @time 2024-04-18 更新
|
||||||
|
* @note 未经测试是否有效
|
||||||
|
*/
|
||||||
|
static SourceInfo
|
||||||
|
os_ros_sources[] = {
|
||||||
|
{&Upstream, NULL},
|
||||||
|
{&Ali, "https://mirrors.aliyun.com"},
|
||||||
|
{&Bfsu, "https://mirrors.bfsu.edu.cn"},
|
||||||
|
{&Ustc, "https://mirrors.ustc.edu.cn"},
|
||||||
|
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn"},
|
||||||
|
{&Tencent, "https://mirrors.tencent.com"},
|
||||||
|
{&Huawei, "https://mirrors.huaweicloud.com"},
|
||||||
|
{&Netease, "https://mirrors.163.com"},
|
||||||
|
{&Sohu, "https://mirrors.sohu.com"}
|
||||||
|
};
|
||||||
|
def_sources_n(os_ros);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参考:
|
||||||
|
* https://mirrors.tuna.tsinghua.edu.cn/help/ros/
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
os_ros_setsrc (char *option)
|
||||||
|
{
|
||||||
|
chsrc_ensure_root (OS_ROS_SourceList);
|
||||||
|
|
||||||
|
SourceInfo source;
|
||||||
|
chsrc_yield_source (os_ros);
|
||||||
|
chsrc_confirm_source (&source);
|
||||||
|
|
||||||
|
chsrc_backup (OS_ROS_SourceList);
|
||||||
|
|
||||||
|
char *cmd = NULL;
|
||||||
|
cmd = xy_strjoin(3, "sed -E -i \'s@https?://.*/ros/ubuntu/?@", source.url, "@/ros/ubuntug\' " OS_ROS_SourceList);
|
||||||
|
chsrc_run(cmd, RunOpt_Default);
|
||||||
|
|
||||||
|
cmd = "apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654";
|
||||||
|
chsrc_run (cmd, RunOpt_Default);
|
||||||
|
|
||||||
|
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||||
|
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
||||||
|
}
|
||||||
|
|
||||||
|
def_target_noget(os_ros);
|
Loading…
Reference in New Issue
Block a user