From 7a5f56ffe620c9b9c2b1eef954f1b44bf941c9dd Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Sat, 14 Dec 2024 18:26:20 +0800 Subject: [PATCH] Remove banner version --- src/chsrc-main.c | 3 +-- src/framework/core.c | 2 +- src/recipe/os/APT/common.h | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/chsrc-main.c b/src/chsrc-main.c index 2577a10..8cca7b3 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -28,7 +28,6 @@ #define Chsrc_Version "0.1.9.6" #define Chsrc_Release_Date "2024/12/13" -#define Chsrc_Banner_Version "v" Chsrc_Version "-" Chsrc_Release_Date #define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc" #define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc" @@ -408,7 +407,7 @@ void cli_print_help () { say (xy_strjoin (3, "chsrc: Change Source (GPLv3+) ", - purple (Chsrc_Banner_Version), " by RubyMetric")); + purple("v" Chsrc_Version "-" Chsrc_Release_Date), " by RubyMetric")); br(); if (CliOpt_InEnglish) diff --git a/src/framework/core.c b/src/framework/core.c index 63c598a..172f42a 100644 --- a/src/framework/core.c +++ b/src/framework/core.c @@ -495,7 +495,7 @@ measure_speed_for_url (void *url) char *curl_cmd = xy_strjoin (8, "curl -qsL ", ipv6, " -o ", os_devnull, " -w \"%{http_code} %{speed_download}\" -m", time_sec, - " -A chsrc/" Chsrc_Banner_Version " ", url); + " -A chsrc/" Chsrc_Version " ", url); // chsrc_info (xy_2strjoin ("测速命令 ", curl_cmd)); diff --git a/src/recipe/os/APT/common.h b/src/recipe/os/APT/common.h index 0c7b096..b1179b7 100644 --- a/src/recipe/os/APT/common.h +++ b/src/recipe/os/APT/common.h @@ -75,7 +75,7 @@ ensure_apt_sourcelist (int debian_type) if (debian_type == OS_Is_Ubuntu) { makeup = xy_strjoin (9, - "# Generated by chsrc " Chsrc_Banner_Version "\n\n" + "# Generated by chsrc " Chsrc_Version "\n\n" "deb " Chsrc_Maintain_URL "/ubuntu ", codename, " main restricted universe multiverse\n" "deb " Chsrc_Maintain_URL "/ubuntu ", codename, "-updates main restricted universe multiverse\n" "deb " Chsrc_Maintain_URL "/ubuntu ", codename, "-backports main restricted universe multiverse\n" @@ -89,7 +89,7 @@ ensure_apt_sourcelist (int debian_type) // https://mirrors.tuna.tsinghua.edu.cn/help/debian/ // 从 Debian 12 开始,开始有一项 non-free-firmware makeup = xy_strjoin (9, - "# Generated by chsrc " Chsrc_Banner_Version "\n\n" + "# Generated by chsrc " Chsrc_Version "\n\n" "deb " Chsrc_Maintain_URL "/debian ", codename, " main contrib non-free non-free-firmware\n" "deb " Chsrc_Maintain_URL "/debian ", codename, "-updates main contrib non-free non-free-firmware\n" "deb " Chsrc_Maintain_URL "/debian ", codename, "-backports main contrib non-free non-free-firmware\n" @@ -99,7 +99,7 @@ ensure_apt_sourcelist (int debian_type) else if (version >= 11) { makeup = xy_strjoin (9, - "# Generated by chsrc " Chsrc_Banner_Version "(" Chsrc_Maintain_URL ")\n\n" + "# Generated by chsrc " Chsrc_Version "(" Chsrc_Maintain_URL ")\n\n" "deb " Chsrc_Maintain_URL "/debian ", codename, " main contrib non-free\n" "deb " Chsrc_Maintain_URL "/debian ", codename, "-updates main contrib non-free\n" "deb " Chsrc_Maintain_URL "/debian ", codename, "-backports main contrib non-free\n" @@ -108,7 +108,7 @@ ensure_apt_sourcelist (int debian_type) else if (version >= 10) { makeup = xy_strjoin (9, - "# Generated by chsrc " Chsrc_Banner_Version "(" Chsrc_Maintain_URL ")\n\n" + "# Generated by chsrc " Chsrc_Version "(" Chsrc_Maintain_URL ")\n\n" "deb " Chsrc_Maintain_URL "/debian ", codename, " main contrib non-free\n" "deb " Chsrc_Maintain_URL "/debian ", codename, "-updates main contrib non-free\n" "deb " Chsrc_Maintain_URL "/debian ", codename, "-backports main contrib non-free\n"