sub localmirrors { my @mlist; # 定义存储本地镜像列表的数组 # 读取本地镜像列表文件 open LM, "$scriptdir/localmirrors" and do { while () { chomp $; push @mlist, $ if $; } close LM; }; # 读取配置文件中的本地镜像列表 open CONFIG, "<".$ENV{'TOPDIR'}."/.config" and do { while () { # 匹配本地镜像列表配置项 /^CONFIG_LOCALMIRROR="(.+)"/ and do { chomp $; # 将配置项中的本地镜像列表转换为数组并添加到 @mlist 中 my @local_mirrors = split(/;/, $1); push @mlist, @local_mirrors; }; } close CONFIG; }; # 返回本地镜像列表数组 return @mlist;

sub localmirrors my mlist; open LM $scriptdirlocalmirrors and do while LM chomp $; push mlist $ if $_; close LM; ; open CONFIG $ENVTOPDIRconfig and do while CONFIG ^CONFIG_LOCALMIRROR=+ and do

原文地址: https://www.cveoy.top/t/topic/cqTa 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录