59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
{
|
|
my $ydb = esmith::ConfigDB->open_ro('yum_repositories')
|
|
or die "Couldn't open yum_repositories";
|
|
|
|
$OUT = "\n";
|
|
|
|
for my $repos ( $ydb->get_all_by_prop('type' => 'repository') )
|
|
{
|
|
my %props = ($DB->get('yum')->props(), $repos->props());
|
|
|
|
$OUT .= "[" . $repos->key . "]\n";
|
|
|
|
$OUT .= "enabled=" . (($repos->prop('status') eq 'enabled') ? 1 : 0)
|
|
. "\n";
|
|
|
|
if ( exists $props{MirrorList} )
|
|
{
|
|
$OUT .= 'mirrorlist=' . $props{MirrorList} . "\n";
|
|
}
|
|
else
|
|
{
|
|
$OUT .= 'baseurl=' . $props{BaseURL} . "\n";
|
|
}
|
|
|
|
for my $prop (qw(Name))
|
|
{
|
|
$OUT .= lc($prop) . '=' . $props{$prop} . "\n";
|
|
}
|
|
|
|
for my $prop (qw(GPGCheck EnableGroups))
|
|
{
|
|
$OUT .= lc($prop) . '=' . ($props{$prop} eq "yes" ? 1 : 0) . "\n";
|
|
}
|
|
|
|
if (exists $props{Exclude})
|
|
{
|
|
$OUT .= "exclude=" . join(' ', split(/,/, $props{Exclude})) . "\n";
|
|
}
|
|
|
|
if (exists $props{IncludePkgs})
|
|
{
|
|
$OUT .= "includepkgs=" . join(' ', split(/,/, $props{IncludePkgs})) . "\n";
|
|
}
|
|
|
|
if (exists $props{GPGKey})
|
|
{
|
|
$OUT .= "gpgkey" . '=' . $props{GPGKey} . "\n";
|
|
}
|
|
if (exists $props{Priority})
|
|
{
|
|
$OUT .= "priority" . '=' . $props{Priority} . "\n";
|
|
}
|
|
|
|
|
|
$OUT .= "\n";
|
|
}
|
|
}
|
|
|