-
-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from happy-game/main
fix `mint` setsrc
- Loading branch information
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 2,10 @@ | |
* SPDX-License-Identifier: GPL-3.0-or-later | ||
* ------------------------------------------------------------- | ||
* File Authors : Aoran Zeng <[email protected]> | ||
* Contributors : Nil Null <[email protected]> | ||
* Contributors : Happy Game <[email protected]> | ||
* | | ||
* Created On : <2023-09-29> | ||
* Last Modified : <2024-11-21> | ||
* Last Modified : <2025-01-07> | ||
* ------------------------------------------------------------*/ | ||
|
||
/** | ||
|
@@ -49,15 50,21 @@ os_linuxmint_setsrc (char *option) | |
|
||
chsrc_backup (OS_LinuxMint_SourceList); | ||
|
||
char* cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/.*/?@", source.url, | ||
"@g' " OS_LinuxMint_SourceList); | ||
// deb xxx wilma main upstream import backport 为mint主要源, wilma为版本代号 | ||
// 暂不实现自动替换基于debian或ubuntu的基础源 | ||
char *version_codename = xy_run ("sed -nr 's/^VERSION_CODENAME=([^\"] )/\1/p' " ETC_OS_RELEASE, 0); | ||
// sed -i '/<version_codename>/ s|http[^ ]*|<source.url>|g' OS_LinuxMint_SourceList | ||
char* cmd = xy_strjoin (5, "sed -i '/", | ||
version_codename, "/ s|http[^ ]*|", | ||
source.url, "|g' " OS_LinuxMint_SourceList); | ||
|
||
chsrc_run (cmd, RunOpt_Default); | ||
chsrc_run ("apt update", RunOpt_No_Last_New_Line); | ||
|
||
ProgMode_ChgType = ChgType_Auto; | ||
chsrc_conclude (&source); | ||
chsrc_warn2 ("完成后请不要再使用 mintsources(自带的图形化软件源设置工具)进行任何操作,因为在操作后,无论是否有按“确定”,mintsources 均会覆写我们刚才换源的内容"); | ||
chsrc_warn2 ("已自动更换mint主要源, 但mint也使用基于debian或ubuntu的基础源, 可参考对应的debian或ubuntu换源方法进行手动换源"); | ||
} | ||
|
||
def_target(os_linuxmint); |