mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-27 04:59:29 +08:00
Delete new line when iter
This commit is contained in:
@@ -60,13 +60,10 @@ ensure_apt_sourcelist (int debian_type)
|
||||
chsrc_note2 (msg);
|
||||
}
|
||||
|
||||
// 反向引用需要escape一下
|
||||
/* 反向引用需要escape */
|
||||
char *codename = xy_run ("sed -nr 's/VERSION_CODENAME=(.*)/\\1/p' " ETC_OS_RELEASE, 0);
|
||||
codename = xy_str_delete_suffix (codename, "\n");
|
||||
|
||||
char *version_id = xy_run ("sed -nr 's/VERSION_ID=\"(.*)\"/\\1/p' " ETC_OS_RELEASE, 0);
|
||||
version_id = xy_str_delete_suffix (codename, "\n");
|
||||
|
||||
|
||||
double version = atof (version_id);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ def_sources_n(os_rockylinux);
|
||||
|
||||
|
||||
/**
|
||||
* 参考: https://help.mirrors.cernet.edu.cn/rocky/
|
||||
* @consult https://help.mirrors.cernet.edu.cn/rocky/
|
||||
*/
|
||||
void
|
||||
os_rockylinux_setsrc (char *option)
|
||||
@@ -37,9 +37,7 @@ os_rockylinux_setsrc (char *option)
|
||||
|
||||
chsrc_yield_source_and_confirm (os_rockylinux);
|
||||
|
||||
|
||||
char *version_str = xy_run ("sed -nr 's/ROCKY_SUPPORT_PRODUCT_VERSION=\"(.*)\"/\\1/p' " ETC_OS_RELEASE, 0);
|
||||
version_str = xy_str_delete_suffix (version_str, "\n");
|
||||
double version = atof (version_str);
|
||||
|
||||
char *cmd = NULL;
|
||||
|
||||
@@ -28,7 +28,7 @@ static Source_t os_arch_sources[] =
|
||||
|
||||
/**
|
||||
* @update 2024-07-03
|
||||
* @note 根据 GitHub:@zheng7fu2 建议,拆分 archlinuxcn 出来
|
||||
* @note 根据 @zheng7fu2 建议,拆分 archlinuxcn 出来
|
||||
*/
|
||||
os_archlinuxcn_sources[] =
|
||||
{
|
||||
@@ -53,9 +53,9 @@ os_arch_getsrc (char *option)
|
||||
}
|
||||
|
||||
/**
|
||||
* 参考:
|
||||
* 1. https://mirrors.tuna.tsinghua.edu.cn/help/archlinux/
|
||||
* 2. https://mirrors.tuna.tsinghua.edu.cn/help/archlinuxarm/
|
||||
* @consult
|
||||
* 1. https://mirrors.tuna.tsinghua.edu.cn/help/archlinux/
|
||||
* 2. https://mirrors.tuna.tsinghua.edu.cn/help/archlinuxarm/
|
||||
*/
|
||||
void
|
||||
os_arch_setsrc (char *option)
|
||||
@@ -104,7 +104,7 @@ os_archlinuxcn_getsrc (char *option)
|
||||
}
|
||||
|
||||
/**
|
||||
* 参考 https://mirrors.tuna.tsinghua.edu.cn/help/archlinuxcn/
|
||||
* @consult https://mirrors.tuna.tsinghua.edu.cn/help/archlinuxcn/
|
||||
*/
|
||||
void
|
||||
os_archlinuxcn_setsrc (char *option)
|
||||
|
||||
Reference in New Issue
Block a user