Get cmd result in netbsd

This commit is contained in:
Aoran Zeng 2023-09-27 11:35:30 +08:00
parent fd6b9c6b9e
commit b5b32bcee8
2 changed files with 7 additions and 7 deletions

View File

@ -777,7 +777,7 @@ os_ubuntu_setsrc (char* option)
chsrc_backup ("/etc/apt/sources.list");
char* arch = xy_getcmd("arch", NULL);
char* cmd;
char* cmd = NULL;
if(strncmp(arch, "x86_64", 6)==0)
{
cmd = xy_strjoin(3, "sed -E -i \'s@https?://.*/ubuntu/?@", source.url, "@g\' /etc/apt/sources.list");
@ -1031,9 +1031,8 @@ os_arch_setsrc(char* option)
chsrc_backup ("/etc/pacman.d/mirrorlist");
bool arch_flag = false;
char* new_file;
char* new_file = NULL;
char* arch = xy_getcmd("arch", NULL);
char* cmd;
if (strncmp(arch, "x86_64", 6)==0) {
arch_flag = true;
@ -1376,7 +1375,8 @@ os_netbsd_setsrc(char* option)
chsrc_backup ("/usr/pkg/etc/pkgin/repositories.conf");
char* arch = xy_getcmd("arch", NULL);
char* version = "cat /etc/os-release | grep \"VERSION=\" | grep -Po \"[8-9].[0-9]+\"";
char* vercmd = "cat /etc/os-release | grep \"VERSION=\" | grep -Po \"[8-9].[0-9]+\"";
char* version = xy_getcmd(vercmd, NULL);
char* url = xy_strjoin(5, source.url, arch, "/", version, "/All");
chsrc_overwrite_file (url, "/usr/pkg/etc/pkgin/repositories.conf");

2
xy.h
View File

@ -3,7 +3,7 @@
* License : MIT
* Authors : Aoran Zeng <ccmywish@qq.com>
* Created on : <2023-08-28>
* Last modified : <2023-09-26>
* Last modified : <2023-09-27>
*
* xy:
*