Skip to content

Commit b7ad60e

Browse files
committed
Ubuntu 检测架构提前至 prelude 阶段
1 parent 1683e1b commit b7ad60e

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/recipe/os/APT/Ubuntu.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ os_ubuntu_prelude ()
1111
chef_prep_this (os_ubuntu, gsr);
1212

1313
chef_set_created_on (this, "2023-08-30");
14-
chef_set_last_updated (this, "2026-01-20");
15-
chef_set_sources_last_updated (this, "2026-01-20");
14+
chef_set_last_updated (this, "2026-01-21");
15+
chef_set_sources_last_updated (this, "2026-01-21");
1616

1717
chef_set_chef (this, NULL);
1818
chef_set_cooks (this, 2, "@ccmywish", "@G_I_Y");
@@ -43,6 +43,13 @@ os_ubuntu_prelude ()
4343
// {&Sohu, "https://mirrors.sohu.com/ubuntu", FeedByPrelude}
4444
def_sources_end()
4545

46+
char *arch = chsrc_get_cpuarch ();
47+
// Ubuntu 非 x86_64 架构的默认源地址有所不同
48+
if (strncmp (arch, "x86_64", 6)!=0)
49+
{
50+
chef_set_repoURL (this, &UpstreamProvider, "http://ports.ubuntu.com/ubuntu");
51+
}
52+
4653
chef_set_rest_smURL_with_postfix (this, "/dists/noble/Contents-amd64.gz");
4754
}
4855

@@ -148,13 +155,5 @@ os_ubuntu_setsrc (char *option)
148155
void
149156
os_ubuntu_resetsrc (char *option)
150157
{
151-
chef_use_this (os_ubuntu);
152-
char *arch = chsrc_get_cpuarch ();
153-
if (strncmp (arch, "x86_64", 6)!=0)
154-
{
155-
// Ubuntu 非 x86_64 架构的源地址有所不同
156-
chef_set_repoURL (this, &UpstreamProvider, "http://ports.ubuntu.com/ubuntu");
157-
// this->sources[0].url = "http://ports.ubuntu.com/ubuntu";
158-
}
159158
os_ubuntu_setsrc (option);
160159
}

0 commit comments

Comments
 (0)