From 7b01893dc87e5c6442cae28a3bc91b18c713fad0 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Fri, 12 Sep 2025 12:38:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=BD=E9=87=8F=E6=B6=88=E9=99=A4=E5=AF=B9?= =?UTF-8?q?=20`system()`=20=E7=9A=84=E7=9B=B4=E6=8E=A5=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recipe/lang/Python/uv.c | 2 +- src/recipe/os/APT/Debian.c | 6 +++--- src/recipe/os/pacman/Arch-Linux.c | 7 +++---- src/recipe/ware/Homebrew/Homebrew.c | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/recipe/lang/Python/uv.c b/src/recipe/lang/Python/uv.c index 1290b3d..b2d1e46 100644 --- a/src/recipe/lang/Python/uv.c +++ b/src/recipe/lang/Python/uv.c @@ -142,7 +142,7 @@ pl_python_uv_setsrc (char *option) /* 当 uv_config 存在,如果存在 [[index]] 则更新,否则追加到文件末尾 */ char *cmd = xy_str_gsub (RAWSTR_pl_python_test_uv_if_set_source, "@f@", uv_config); chsrc_ensure_program ("grep"); - int status = system (cmd); + int status = xy_run_get_status (cmd); if (0==status) { chsrc_run (update_config_cmd, RunOpt_Default); diff --git a/src/recipe/os/APT/Debian.c b/src/recipe/os/APT/Debian.c index 970e873..44cd22c 100644 --- a/src/recipe/os/APT/Debian.c +++ b/src/recipe/os/APT/Debian.c @@ -10,7 +10,7 @@ os_debian_prelude () chef_prep_this (os_debian, gsr); chef_set_created_on (this, "2023-09-02"); - chef_set_last_updated (this, "2025-08-10"); + chef_set_last_updated (this, "2025-09-12"); chef_set_sources_last_updated (this, "2025-07-11"); chef_set_chef (this, NULL); @@ -73,7 +73,7 @@ os_debian_does_old_sourcelist_use_cdrom (void) { /* 我们只检查旧版sourcelist,因为 common.h 中的填充只支持旧版 */ char *cmd = xy_2strcat ("grep -q '^deb cdrom:' ", OS_Debian_old_SourceList); - int ret = system (cmd); + int ret = xy_run_get_status (cmd); bool use_cdrom = ret == 0; return use_cdrom; @@ -135,7 +135,7 @@ os_debian_setsrc (char *option) if (use_cdrom) { chsrc_backup (OS_Debian_old_SourceList); - int rm_status = system ("rm " OS_Debian_old_SourceList); + int rm_status = xy_run_get_status ("rm " OS_Debian_old_SourceList); if (rm_status != 0) { /* Placate -Wunused-result */ } chsrc_warn2 ("旧版源配置文件中使用了 CDROM 源,已删除(但备份)该配置文件,重新配置"); diff --git a/src/recipe/os/pacman/Arch-Linux.c b/src/recipe/os/pacman/Arch-Linux.c index 77e6e8f..e77760c 100644 --- a/src/recipe/os/pacman/Arch-Linux.c +++ b/src/recipe/os/pacman/Arch-Linux.c @@ -116,7 +116,7 @@ os_archlinuxcn_prelude () chef_prep_this (os_archlinuxcn, gs); chef_set_created_on (this, "2023-09-05"); - chef_set_last_updated (this, "2025-08-10"); + chef_set_last_updated (this, "2025-09-12"); chef_set_sources_last_updated (this, "2024-07-03"); chef_set_chef (this, NULL); @@ -133,7 +133,7 @@ os_archlinuxcn_prelude () def_sources_begin() - {&UpstreamProvider, "https://repo.archlinuxcn.org/", DelegateToUpstream}, + {&UpstreamProvider, "https://repo.archlinuxcn.org/", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/archlinuxcn/", DelegateToMirror}, {&Bfsu, "https://mirrors.bfsu.edu.cn/archlinuxcn/", DelegateToMirror}, {&Ustc, "https://mirrors.ustc.edu.cn/archlinuxcn/", DelegateToMirror}, @@ -157,7 +157,6 @@ os_archlinuxcn_getsrc (char *option) /** * @consult https://mirrors.tuna.tsinghua.edu.cn/help/archlinuxcn/ - * @update 2025-05-24 */ void os_archlinuxcn_setsrc (char *option) @@ -172,7 +171,7 @@ os_archlinuxcn_setsrc (char *option) /* 检查是否已存在 archlinuxcn 配置段 */ char *check_cmd = "grep -q '\\[archlinuxcn\\]' " OS_Pacman_ArchLinuxCN_MirrorList; - int ret = system(check_cmd); + int ret = xy_run_get_status (check_cmd); if (ret == 0) { diff --git a/src/recipe/ware/Homebrew/Homebrew.c b/src/recipe/ware/Homebrew/Homebrew.c index cc76335..286fdb5 100644 --- a/src/recipe/ware/Homebrew/Homebrew.c +++ b/src/recipe/ware/Homebrew/Homebrew.c @@ -12,7 +12,7 @@ wr_homebrew_prelude () chef_prep_this (wr_homebrew, gs); chef_set_created_on (this, "2023-09-10"); - chef_set_last_updated (this, "2025-08-09"); + chef_set_last_updated (this, "2025-09-12"); chef_set_sources_last_updated (this, "2025-07-13"); chef_set_chef (this, NULL); @@ -39,7 +39,7 @@ wr_homebrew_prelude () void wr_homebrew_getsrc (char *option) { - int status = system (RAWSTR_wr_homebrew_read_config_cmd); + int status = xy_run_get_status (RAWSTR_wr_homebrew_read_config_cmd); if (status != 0) { xy_noop(); } }