mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-08 19:25:33 +08:00
Fix bugs in archlinux
This commit is contained in:
parent
f0181fed20
commit
baf0297fb2
15
chsrc.c
15
chsrc.c
@ -1189,7 +1189,7 @@ os_arch_setsrc(char* option)
|
|||||||
system(backup);
|
system(backup);
|
||||||
|
|
||||||
|
|
||||||
|
bool arch_flag = false;
|
||||||
xy_info ("chsrc: 备份文件名: /etc/pacman.d/mirrorlist.bak");
|
xy_info ("chsrc: 备份文件名: /etc/pacman.d/mirrorlist.bak");
|
||||||
char* new_file ;
|
char* new_file ;
|
||||||
|
|
||||||
@ -1199,12 +1199,14 @@ os_arch_setsrc(char* option)
|
|||||||
char* cmd;
|
char* cmd;
|
||||||
if(strncmp(arch, "x86_64", 6)==0)
|
if(strncmp(arch, "x86_64", 6)==0)
|
||||||
{
|
{
|
||||||
|
arch_flag = true;
|
||||||
new_file = xy_strjoin(3,"Server = ",
|
new_file = xy_strjoin(3,"Server = ",
|
||||||
source.url,
|
source.url,
|
||||||
"archlinux/$repo/os/$arch");
|
"archlinux/$repo/os/$arch");
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
arch_flag = false;
|
||||||
new_file = xy_strjoin(3,"Server = ",
|
new_file = xy_strjoin(3,"Server = ",
|
||||||
source.url,
|
source.url,
|
||||||
"archlinuxarm/$repo/os/$arch");
|
"archlinuxarm/$repo/os/$arch");
|
||||||
@ -1222,7 +1224,18 @@ os_arch_setsrc(char* option)
|
|||||||
chsrc_logcmd(cmd);
|
chsrc_logcmd(cmd);
|
||||||
system(cmd);
|
system(cmd);
|
||||||
|
|
||||||
|
cmd = "pacman -Sy archlinux-keyring";
|
||||||
|
chsrc_logcmd(cmd);
|
||||||
|
system(cmd);
|
||||||
|
|
||||||
|
if(arch_flag)
|
||||||
|
{
|
||||||
xy_info ("Please use \"pacman -Syyu \" to update your source");
|
xy_info ("Please use \"pacman -Syyu \" to update your source");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xy_info ("Please use \"pacman -Syy \" to update your source");
|
||||||
|
}
|
||||||
|
|
||||||
chsrc_say_thanks(&source);
|
chsrc_say_thanks(&source);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user