sub verify_dir_override {
my ($value, $noerr) = @_;
- if ($value =~ m/^([-a-z]+)=\/.+$/ && verify_content($1, $noerr)) {
+ if ($value =~ m/^([a-z]+)=[^.]+$/ && verify_content($1, $noerr)) {
return $value;
}
die "storage definition has no path\n" if !$path;
die "unknown vtype '$vtype'\n" if !exists($vtype_subdirs->{$vtype});
- my $subdir = $scfg->{"content-dirs"}->{$vtype} // "/".$vtype_subdirs->{$vtype};
+ my $subdir = $scfg->{"content-dirs"}->{$vtype} // $vtype_subdirs->{$vtype};
- return $path.$subdir;
+ return "$path/$subdir";
}
sub filesystem_path {
# creates additional tests for overrides
foreach my $type (keys %$vtype_subdirs) {
- my $override = "/${type}_override";
+ my $override = "${type}_override";
my $scfg_with_override = { path => '/some/path', 'content-dirs' => { $type => $override } };
- push @$tests, [ $scfg_with_override, $type, "$scfg_with_override->{path}$scfg_with_override->{'content-dirs'}->{$type}" ];
+ push @$tests, [ $scfg_with_override, $type, "$scfg_with_override->{path}/$scfg_with_override->{'content-dirs'}->{$type}" ];
}
plan tests => scalar @$tests;