Files
openssh-rpms/docker/modify_dnf_source.pl
ChowRex f0b2bf7905 Important Version Updates (#19)
* Important Version Updates
- Add dockerfile support for centos 8 series.
- Modify Dockerfile.centos to add CentOS 8 support and fix the problem of CentOS 5 series not being able to build.
- Modify modify_yum_source.sh to add CentOS 8 support and fix CentOS 5 series yum source problem.

* Update CentOS Stream support                                                                           INT ✘  base 
- Changed compile.sh to add support for CentOS Stream 8/9 series.
- Modified docker.README.md to add Stream series description.
- Modified Dockerfile.amazonlinux to add cleanup operations and reduce image size.
- Modify Dockerfile.centos, add cleanup operation, reduce image size
- Added Dockerfile.centos-stream to support Stream series build images.
- Added modify_dnf_source.pl to add Stream series yum source modification function.
- Modified README.md to add Stream series test pass information and correct formatting and word spelling errors.

---------

Co-authored-by: Rex Zhou <zhouruixi@goldwind.com>
2024-06-04 17:01:06 +08:00

37 lines
1.0 KiB
Perl

#!/usr/bin/perl
use strict;
use warnings;
use autodie;
my $mirrors = 'https://mirrors.tuna.tsinghua.edu.cn/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 $_;
}
}