Fix: add source URL in script for openSUSE

This commit is contained in:
Aoran Zeng 2025-08-09 10:56:36 +08:00
parent da82acc251
commit 64e625d486
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
3 changed files with 10 additions and 8 deletions

View File

@ -5,7 +5,7 @@
* Contributors : Aoran Zeng <ccmywish@qq.com> * Contributors : Aoran Zeng <ccmywish@qq.com>
* Created On : <2023-09-17> * Created On : <2023-09-17>
* Major Revision : 1 * Major Revision : 1
* Last Modified : <2025-07-22> * Last Modified : <2025-08-09>
* ------------------------------------------------------------*/ * ------------------------------------------------------------*/
/** /**
@ -36,7 +36,7 @@ def_sources_n(os_opensuse);
void void
os_opensuse_setsrc (char *option) os_opensuse_setsrc (char *option)
{ {
chsrc_ensure_root (); // chsrc_ensure_root ();
chsrc_yield_source_and_confirm (os_opensuse); chsrc_yield_source_and_confirm (os_opensuse);
@ -61,12 +61,14 @@ os_opensuse_setsrc (char *option)
} }
if (choice == 1) if (choice == 1)
{ {
chsrc_run_as_bash_file (RAWSTR_os_openSUSE_leap_in_bash); char *script = xy_str_gsub (RAWSTR_os_openSUSE_leap_in_bash, "@url@", source.url);
chsrc_run_as_bash_file (script);
break; break;
} }
if (choice == 2) if (choice == 2)
{ {
chsrc_run_as_bash_file (RAWSTR_os_openSUSE_tumbleweed_in_bash); char *script = xy_str_gsub (RAWSTR_os_openSUSE_tumbleweed_in_bash, "@url@", source.url);
chsrc_run_as_bash_file (script);
break; break;
} }
else else

View File

@ -6,5 +6,5 @@
char RAWSTR_os_openSUSE_leap_in_bash[] = "\x23\x20\xe9\xa6\x96\xe5\x85\x88\xe7\xa6\x81\xe7\x94\xa8\xe5\xae\x98\xe6\x96\xb9\xe8\xbd\xaf\xe4\xbb\xb6\xe6\xba\x90\x0a\x7a\x79\x70\x70\x65\x72\x20\x6d\x72\x20\x2d\x64\x61\x0a\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x72\x65\x70\x6f\x2f\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x6f\x73\x73\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x72\x65\x70\x6f\x2f\x6e\x6f\x6e\x2d\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x6e\x6f\x6e\x2d\x6f\x73\x73\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x75\x70\x64\x61\x74\x65\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x75\x70\x64\x61\x74\x65\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x75\x70\x64\x61\x74\x65\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x6e\x6f\x6e\x2d\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x75\x70\x64\x61\x74\x65\x2d\x6e\x6f\x6e\x2d\x6f\x73\x73\x0a\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x75\x70\x64\x61\x74\x65\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x73\x6c\x65\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x73\x6c\x65\x2d\x75\x70\x64\x61\x74\x65\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x75\x70\x64\x61\x74\x65\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x62\x61\x63\x6b\x70\x6f\x72\x74\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x62\x61\x63\x6b\x70\x6f\x72\x74\x73\x2d\x75\x70\x64\x61\x74\x65"; char RAWSTR_os_openSUSE_leap_in_bash[] = "\x23\x20\xe9\xa6\x96\xe5\x85\x88\xe7\xa6\x81\xe7\x94\xa8\xe5\xae\x98\xe6\x96\xb9\xe8\xbd\xaf\xe4\xbb\xb6\xe6\xba\x90\x0a\x7a\x79\x70\x70\x65\x72\x20\x6d\x72\x20\x2d\x64\x61\x0a\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x72\x65\x70\x6f\x2f\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x6f\x73\x73\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x72\x65\x70\x6f\x2f\x6e\x6f\x6e\x2d\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x6e\x6f\x6e\x2d\x6f\x73\x73\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x75\x70\x64\x61\x74\x65\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x75\x70\x64\x61\x74\x65\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x75\x70\x64\x61\x74\x65\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x6e\x6f\x6e\x2d\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x75\x70\x64\x61\x74\x65\x2d\x6e\x6f\x6e\x2d\x6f\x73\x73\x0a\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x75\x70\x64\x61\x74\x65\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x73\x6c\x65\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x73\x6c\x65\x2d\x75\x70\x64\x61\x74\x65\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x75\x70\x64\x61\x74\x65\x2f\x6c\x65\x61\x70\x2f\x24\x72\x65\x6c\x65\x61\x73\x65\x76\x65\x72\x2f\x62\x61\x63\x6b\x70\x6f\x72\x74\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x62\x61\x63\x6b\x70\x6f\x72\x74\x73\x2d\x75\x70\x64\x61\x74\x65";
char RAWSTR_os_openSUSE_tumbleweed_in_bash[] = "\x23\x20\xe9\xa6\x96\xe5\x85\x88\xe7\xa6\x81\xe7\x94\xa8\xe5\xae\x98\xe6\x96\xb9\xe8\xbd\xaf\xe4\xbb\xb6\xe6\xba\x90\x0a\x7a\x79\x70\x70\x65\x72\x20\x6d\x72\x20\x2d\x64\x61\x0a\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x68\x74\x74\x70\x73\x3a\x2f\x2f\x6d\x69\x72\x72\x6f\x72\x73\x2e\x74\x75\x6e\x61\x2e\x74\x73\x69\x6e\x67\x68\x75\x61\x2e\x65\x64\x75\x2e\x63\x6e\x2f\x6f\x70\x65\x6e\x73\x75\x73\x65\x2f\x74\x75\x6d\x62\x6c\x65\x77\x65\x65\x64\x2f\x72\x65\x70\x6f\x2f\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x6f\x73\x73\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x68\x74\x74\x70\x73\x3a\x2f\x2f\x6d\x69\x72\x72\x6f\x72\x73\x2e\x74\x75\x6e\x61\x2e\x74\x73\x69\x6e\x67\x68\x75\x61\x2e\x65\x64\x75\x2e\x63\x6e\x2f\x6f\x70\x65\x6e\x73\x75\x73\x65\x2f\x74\x75\x6d\x62\x6c\x65\x77\x65\x65\x64\x2f\x72\x65\x70\x6f\x2f\x6e\x6f\x6e\x2d\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x6e\x6f\x6e\x2d\x6f\x73\x73\x0a\x0a\x23\x20\xe5\x88\xb7\xe6\x96\xb0\xe8\xbd\xaf\xe4\xbb\xb6\xe6\xba\x90\x0a\x7a\x79\x70\x70\x65\x72\x20\x72\x65\x66"; char RAWSTR_os_openSUSE_tumbleweed_in_bash[] = "\x23\x20\xe9\xa6\x96\xe5\x85\x88\xe7\xa6\x81\xe7\x94\xa8\xe5\xae\x98\xe6\x96\xb9\xe8\xbd\xaf\xe4\xbb\xb6\xe6\xba\x90\x0a\x7a\x79\x70\x70\x65\x72\x20\x6d\x72\x20\x2d\x64\x61\x0a\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x74\x75\x6d\x62\x6c\x65\x77\x65\x65\x64\x2f\x72\x65\x70\x6f\x2f\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x6f\x73\x73\x0a\x7a\x79\x70\x70\x65\x72\x20\x61\x72\x20\x2d\x63\x66\x67\x20\x27\x40\x75\x72\x6c\x40\x2f\x74\x75\x6d\x62\x6c\x65\x77\x65\x65\x64\x2f\x72\x65\x70\x6f\x2f\x6e\x6f\x6e\x2d\x6f\x73\x73\x2f\x27\x20\x6d\x69\x72\x72\x6f\x72\x2d\x6e\x6f\x6e\x2d\x6f\x73\x73\x0a\x0a\x23\x20\xe5\x88\xb7\xe6\x96\xb0\xe8\xbd\xaf\xe4\xbb\xb6\xe6\xba\x90\x0a\x7a\x79\x70\x70\x65\x72\x20\x72\x65\x66";

View File

@ -5,7 +5,7 @@
! Config Authors: Aoran Zeng <ccmywish@qq.com> ! Config Authors: Aoran Zeng <ccmywish@qq.com>
! Contributors : Nil Null <nil@null.org> ! Contributors : Nil Null <nil@null.org>
! Created On : <2025-07-21> ! Created On : <2025-07-21>
! Last Modified : <2025-07-21> ! Last Modified : <2025-08-09>
! ---------------------------------------------------------- --> ! ---------------------------------------------------------- -->
# rawstr4c input for OS # rawstr4c input for OS
@ -43,8 +43,8 @@ zypper ar -cfg '@url@/update/leap/$releasever/backports/' mirror-backports-updat
# 首先禁用官方软件源 # 首先禁用官方软件源
zypper mr -da zypper mr -da
zypper ar -cfg 'https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/oss/' mirror-oss zypper ar -cfg '@url@/tumbleweed/repo/oss/' mirror-oss
zypper ar -cfg 'https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/non-oss/' mirror-non-oss zypper ar -cfg '@url@/tumbleweed/repo/non-oss/' mirror-non-oss
# 刷新软件源 # 刷新软件源
zypper ref zypper ref