mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/boypt/openssh-rpms.git
synced 2026-09-20 16:13:38 +08:00
* Refactoring logic - Modify all dockerfile files, unified replacement logic - Fix `perl` required error. - Add ignore file - Fix CentOS 5 support, by change mirror from `http://archive.kernel.org` to `http://linuxsoft.cern.ch` * Update README.md - Add a short usage for docker * Create Github Actions - Add `build-images.yml` to auto build docker images. Support: CentOS 7/6/5, CentOS Stream 8/9, Amazon Linux 1/2/2023. - Add `create-amd64-release.yml` to auto create amd64 release files. - Add `create-arm64-release.yml` to auto create arm64 release files. - Reformat release comment Features: - Using batch build and batch compile - Using latest action version
37 lines
1.0 KiB
Perl
37 lines
1.0 KiB
Perl
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
use warnings;
|
|
use autodie;
|
|
|
|
my $mirrors = 'MIRROR_HOLDER';
|
|
|
|
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 $_;
|
|
}
|
|
} |