Yield source

This commit is contained in:
Aoran Zeng 2024-06-13 23:43:31 +08:00
parent 419168fcf7
commit 92b3446531
2 changed files with 24 additions and 0 deletions

View File

@ -346,6 +346,27 @@ source_has_empty_url (SourceInfo *source)
return source->url == NULL;
}
/**
* ** SourceInfo
*
* 1. MirrorCode
* 2. ()
* 3. URL
*
* @dependency option
* @dependency source
*/
#define chsrc_yield_source(for_what) \
if (is_url (option)) \
{ \
SourceInfo __tmp = { &UserDefine, option }; \
source = __tmp; \
} \
else \
{ \
int __index = use_specific_mirror_or_auto_select (option, for_what); \
source = pl_ruby_sources[__index]; \
}

View File

@ -51,7 +51,9 @@ pl_ruby_setsrc (char *option)
}
SourceInfo source;
chsrc_yield_source (pl_ruby);
/*
if (is_url (option))
{
SourceInfo tmp = { &UserDefine, option };
@ -62,6 +64,7 @@ pl_ruby_setsrc (char *option)
int index = use_specific_mirror_or_auto_select (option, pl_ruby);
source = pl_ruby_sources[index];
}
*/
chsrc_confirm_selection (&source);