summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/MDV/Distribconf.pm3
-rw-r--r--t/01distribconf.t4
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/MDV/Distribconf.pm b/lib/MDV/Distribconf.pm
index 5dbaa12..21c2057 100644
--- a/lib/MDV/Distribconf.pm
+++ b/lib/MDV/Distribconf.pm
@@ -440,6 +440,9 @@ sub getvalue {
/^synthesis$/ and $default = 'synthesis.' . lc($distrib->getvalue($media, 'hdlist', $level));
/^hdlist$/ and $default = 'hdlist_' . lc($distrib->getvalue($media, 'name', $level)) . '.cz';
/^pubkey$/ and $default = 'pubkey_' . lc($distrib->getvalue($media, 'name', $level));
+ /^(pubkey|hdlist|synthesis)$/ and do {
+ $default =~ s![/ ]+!_!g;
+ };
/^name$/ and do {
$default = $media;
$default =~ s![/ ]+!_!g;
diff --git a/t/01distribconf.t b/t/01distribconf.t
index 987b284..f73a154 100644
--- a/t/01distribconf.t
+++ b/t/01distribconf.t
@@ -12,7 +12,7 @@ my %testdpath = (
'http://server/path/' => 'testdata/test/media/media_info/media.cfg',
);
-plan tests => 14 + 28 * scalar(keys %testdpath);
+plan tests => 14 + 29 * scalar(keys %testdpath);
use_ok('MDV::Distribconf');
@@ -58,6 +58,8 @@ foreach my $path (keys %testdpath) {
like($dconf->getfullmediapath('main', 'hdlist'), qr!^/*$path/*media/+main/+media_info/+hdlist.cz$!, "Can get media fullpath"); # vim color: */
like($dconf->getdpath('main', 'hdlist'), qr!^/*media/+main/+media_info/+hdlist.cz$!, "can get dpath");
like($dconf->getfulldpath('main', 'hdlist'), qr!^/*$path/*media/+main/+media_info/+hdlist.cz$!, "can get fulldpath");
+ like($dconf->getfullpath('../SRPMS/contrib', 'pubkey'),
+ qr!^/*$path/*media/+media_info/+pubkey_[^ ]+$!, "can get pubkey full path");
is($dconf->getdpath(undef, 'root'), $path, "can get fulldpath");
is($dconf->getfulldpath(undef, 'VERSION'), "$path/VERSION", "can get fulldpath");
is($dconf->getdpath('main', 'root'), $path, "can get fulldpath root even media is given");