FreeBSD is not user definable temporarily

This commit is contained in:
Aoran Zeng 2024-06-14 00:29:40 +08:00
parent 4395ece89d
commit 3e4ce0df59

View File

@ -5,7 +5,7 @@
* Authors : Aoran Zeng <ccmywish@qq.com> * Authors : Aoran Zeng <ccmywish@qq.com>
* | Heng Guo <2085471348@qq.com> * | Heng Guo <2085471348@qq.com>
* Created on : <2023-08-29> * Created on : <2023-08-29>
* Last modified : <2024-06-13> * Last modified : <2024-06-14>
* *
* chsrc * chsrc
* ------------------------------------------------------------*/ * ------------------------------------------------------------*/
@ -48,6 +48,14 @@ bool Cli_Option_IPv6 = false;
bool Cli_Option_Locally = false; bool Cli_Option_Locally = false;
bool Cli_Option_InEnglish = false; bool Cli_Option_InEnglish = false;
bool
is_url (const char *str)
{
return (xy_str_start_with (str, "http://") || xy_str_start_with (str, "https://"));
}
/** /**
* *
* *
@ -106,6 +114,12 @@ query_file_exist (char *path)
int int
query_mirror_exist (SourceInfo *sources, size_t size, char *target, char *input) query_mirror_exist (SourceInfo *sources, size_t size, char *target, char *input)
{ {
if (is_url (input))
{
chsrc_error ("暂不支持对该软件使用用户自定义源,请联系开发者询问原因或请求支持");
exit (1);
}
if (0==size || 1==size) if (0==size || 1==size)
{ {
chsrc_error (xy_strjoin (3, "当前 ", target, " 无任何可用源,请联系维护者")); chsrc_error (xy_strjoin (3, "当前 ", target, " 无任何可用源,请联系维护者"));
@ -322,11 +336,6 @@ auto_select_ (SourceInfo *sources, size_t size, const char *target)
(NULL!=(input)) ? find_mirror(s, input) : auto_select(s) (NULL!=(input)) ? find_mirror(s, input) : auto_select(s)
bool
is_url (const char *str)
{
return (xy_str_start_with (str, "http://") || xy_str_start_with (str, "https://"));
}
bool bool
source_is_upstream (SourceInfo *source) source_is_upstream (SourceInfo *source)