Remove xy_run() last parameter

This commit is contained in:
Aoran Zeng
2024-12-14 09:14:11 +08:00
parent 252a64924f
commit be3982bbff
10 changed files with 25 additions and 18 deletions

View File

@@ -37,7 +37,7 @@ pl_java_check_cmd (bool *maven_exist, bool *gradle_exist)
char *
pl_java_find_maven_config ()
{
char *buf = xy_run ("mvn -v", 2, NULL);
char *buf = xy_run ("mvn -v", 2);
char *maven_home = xy_str_delete_prefix (buf, "Maven home: ");
maven_home = xy_str_strip (maven_home);

View File

@@ -11,7 +11,7 @@
static double
pl_nodejs_yarn_get_yarn_version ()
{
char *ver = xy_run ("yarn --version", 0, NULL);
char *ver = xy_run ("yarn --version", 0);
double version = atof (ver);
return version;
}

View File

@@ -12,7 +12,7 @@
char *
pl_python_find_rye_config ()
{
char *buf = xy_run ("rye config --show-path", 0, NULL);
char *buf = xy_run ("rye config --show-path", 0);
char *rye_config = xy_normalize_path (xy_str_strip (buf));
return rye_config;

View File

@@ -74,7 +74,7 @@ pl_ruby_setsrc (char *option)
char *cmd = NULL;
xy_run ("gem sources -l", 0, pl_ruby_remove_gem_source);
xy_run_iter ("gem sources -l", 0, pl_ruby_remove_gem_source);
cmd = xy_2strjoin ("gem source -a ", source.url);
chsrc_run (cmd, RunOpt_Default);

View File

@@ -61,10 +61,10 @@ ensure_apt_sourcelist (int debian_type)
}
// 反向引用需要escape一下
char *codename = xy_run ("sed -nr 's/VERSION_CODENAME=(.*)/\\1/p' " ETC_OS_RELEASE, 0, NULL);
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, NULL);
char *version_id = xy_run ("sed -nr 's/VERSION_ID=\"(.*)\"/\\1/p' " ETC_OS_RELEASE, 0);
version_id = xy_str_delete_suffix (codename, "\n");

View File

@@ -53,7 +53,7 @@ os_netbsd_setsrc (char *option)
char *arch = chsrc_get_cpuarch ();
char *vercmd = "cat /etc/os-release | grep \"VERSION=\" | grep -Po \"[8-9].[0-9]+\"";
char *version = xy_run (vercmd, 0, NULL);
char *version = xy_run (vercmd, 0);
char *url = xy_strjoin (5, source.url, arch, "/", version, "/All");
chsrc_overwrite_file (url, "/usr/pkg/etc/pkgin/repositories.conf");

View File

@@ -38,7 +38,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, NULL);
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);

View File

@@ -97,7 +97,7 @@ wr_dockerhub_setsrc (char *option)
source.url,
"\")' ",
WARE_DockerHub_SourceConfig);
char *ret = xy_run(cmd, 0, NULL);
char *ret = xy_run(cmd, 0);
if (ret && !xy_streql(ret, "null\n"))
{
chsrc_note2 ("已存在源,无需重复添加");