version 1.16, 2019/10/02 22:28:24
|
version 1.18, 2021/03/13 19:38:32
|
Line 202 if ($dist =~ /^fedora(\d+)$/) {
|
Line 202 if ($dist =~ /^fedora(\d+)$/) {
|
} elsif ($dist =~ /^(debian|ubuntu)\d+$/) { |
} elsif ($dist =~ /^(debian|ubuntu)\d+$/) { |
my %apt_get_source = ( |
my %apt_get_source = ( |
debian5 => { |
debian5 => { |
regexp => '\s*deb\s+'.$loninst_re.'/debian/\s+lenny\s+main', |
regexp => '\s*deb\s+'.$loninst_re.'/debian/?\s+lenny\s+main', |
text => "deb $loninst/debian/ lenny main", |
text => "deb $loninst/debian lenny main", |
}, |
}, |
ubuntu6 => { |
ubuntu6 => { |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/\s+dapper\s+main', |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+dapper\s+main', |
text => "deb $loninst/ubuntu/ dapper main", |
text => "deb $loninst/ubuntu dapper main", |
}, |
}, |
ubuntu8 => { |
ubuntu8 => { |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/\s+hardy\s+main', |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+hardy\s+main', |
text => "deb $loninst/ubuntu/ hardy main", |
text => "deb $loninst/ubuntu hardy main", |
}, |
}, |
ubuntu10 => { |
ubuntu10 => { |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/\s+lucid\s+main', |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+lucid\s+main', |
text => "deb $loninst/ubuntu/ lucid main", |
text => "deb $loninst/ubuntu lucid main", |
}, |
}, |
ubuntu12 => { |
ubuntu12 => { |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/\s+precise\s+main', |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+precise\s+main', |
text => "deb $loninst/ubuntu/ precise main", |
text => "deb $loninst/ubuntu precise main", |
}, |
}, |
ubuntu14 => { |
ubuntu14 => { |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/\s+trusty\s+main', |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+trusty\s+main', |
text => "deb $loninst/ubuntu/ trusty main", |
text => "deb $loninst/ubuntu trusty main", |
}, |
}, |
ubuntu16 => { |
ubuntu16 => { |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/\s+xenial\s+main', |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+xenial\s+main', |
text => "deb $loninst/ubuntu/ xenial main", |
text => "deb $loninst/ubuntu xenial main", |
}, |
}, |
ubuntu18 => { |
ubuntu18 => { |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/\s+bionic\s+main', |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+bionic\s+main', |
text => "deb $loninst/ubuntu/ bionic main", |
text => "deb $loninst/ubuntu bionic main", |
|
}, |
|
ubuntu20 => { |
|
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+focal\s+main', |
|
text => "deb $loninst/ubuntu focal main", |
}, |
}, |
); |
); |
my $apt_status; |
my $apt_status; |
Line 372 sub write_config_file {
|
Line 376 sub write_config_file {
|
if (! defined($structure) || ! ref($structure)) { |
if (! defined($structure) || ! ref($structure)) { |
return 'Bad subroutine inputs'; |
return 'Bad subroutine inputs'; |
} |
} |
open(OUTPUT,'>'.$file) || return('Unable to open '.$file.' for writing'); |
open(OUTPUT,'>',$file) || return('Unable to open '.$file.' for writing'); |
for (my $i=0;$i<scalar(@$structure);$i++) { |
for (my $i=0;$i<scalar(@$structure);$i++) { |
my $line = $structure->[$i]; |
my $line = $structure->[$i]; |
chomp($line); |
chomp($line); |
Line 515 sub update_rhn_source {
|
Line 519 sub update_rhn_source {
|
} |
} |
my $result = 0; |
my $result = 0; |
my $fh; |
my $fh; |
if (open($fh,"<$file")) { |
if (open($fh,'<',$file)) { |
my $total = 0; |
my $total = 0; |
my %found; |
my %found; |
foreach my $item (keys(%{$rhn_items})) { |
foreach my $item (keys(%{$rhn_items})) { |
Line 537 sub update_rhn_source {
|
Line 541 sub update_rhn_source {
|
} |
} |
close($fh); |
close($fh); |
if ($total < 2) { |
if ($total < 2) { |
if (open($fh,">>$file")) { |
if (open($fh,'>>',$file)) { |
foreach my $item (keys(%{$rhn_items})) { |
foreach my $item (keys(%{$rhn_items})) { |
unless ($found{$item}) { |
unless ($found{$item}) { |
if (ref($rhn_items->{$item}) eq 'HASH') { |
if (ref($rhn_items->{$item}) eq 'HASH') { |
Line 592 sub update_apt_source {
|
Line 596 sub update_apt_source {
|
} |
} |
my $result = 0; |
my $result = 0; |
my $fh; |
my $fh; |
if (open($fh,"<$file")) { |
if (open($fh,'<',$file)) { |
my $found = 0; |
my $found = 0; |
my $pattern = $deb_row->{regexp}; |
my $pattern = $deb_row->{regexp}; |
while(<$fh>) { |
while(<$fh>) { |
Line 603 sub update_apt_source {
|
Line 607 sub update_apt_source {
|
} |
} |
close($fh); |
close($fh); |
if (!$found) { |
if (!$found) { |
if (open($fh,">>$file")) { |
if (open($fh,'>>',$file)) { |
print $fh "\n".$deb_row->{text}."\n"; |
print $fh "\n".$deb_row->{text}."\n"; |
close($fh); |
close($fh); |
$result = 1; |
$result = 1; |