mirror of
https://github.com/raymond999999/shell.git
synced 2026-03-12 17:51:35 +08:00
update reset_v8 shell files and README.md file
This commit is contained in:
1859
reset/v8/reset_v8_1.sh
Normal file
1859
reset/v8/reset_v8_1.sh
Normal file
File diff suppressed because it is too large
Load Diff
2600
reset/v8/reset_v8_2.sh
Normal file
2600
reset/v8/reset_v8_2.sh
Normal file
File diff suppressed because it is too large
Load Diff
39
reset/v8/update_mirror.pl
Normal file
39
reset/v8/update_mirror.pl
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use autodie;
|
||||
|
||||
# 要修改镜像源,请去修改url变量!
|
||||
my $url = 'mirrors.aliyun.com';
|
||||
my $mirrors = "https://$url/centos-stream";
|
||||
|
||||
if (@ARGV < 1) {
|
||||
die "Usage: $0 <filename1> <filename2> ...\n";
|
||||
}
|
||||
|
||||
while (my $filename = shift @ARGV) {
|
||||
my $backup_filename = $filename . '.bak';
|
||||
rename $filename, $backup_filename;
|
||||
|
||||
open my $input, "<", $backup_filename;
|
||||
open my $output, ">", $filename;
|
||||
|
||||
while (<$input>) {
|
||||
s/^metalink/# metalink/;
|
||||
|
||||
if (m/^name/) {
|
||||
my (undef, $repo, $arch) = split /-/;
|
||||
$repo =~ s/^\s+|\s+$//g;
|
||||
($arch = defined $arch ? lc($arch) : '') =~ s/^\s+|\s+$//g;
|
||||
|
||||
if ($repo =~ /^Extras/) {
|
||||
$_ .= "baseurl=${mirrors}/SIGs/\$releasever-stream/extras" . ($arch eq 'source' ? "/${arch}/" : "/\$basearch/") . "extras-common\n";
|
||||
} else {
|
||||
$_ .= "baseurl=${mirrors}/\$releasever-stream/$repo" . ($arch eq 'source' ? "/" : "/\$basearch/") . ($arch ne '' ? "${arch}/tree/" : "os") . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
print $output $_;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user