aboutsummaryrefslogtreecommitdiff
path: root/lib/WebCoso
diff options
context:
space:
mode:
Diffstat (limited to 'lib/WebCoso')
-rw-r--r--lib/WebCoso/Common.pm14
-rw-r--r--lib/WebCoso/Maker.pm8
2 files changed, 13 insertions, 9 deletions
diff --git a/lib/WebCoso/Common.pm b/lib/WebCoso/Common.pm
index 7b610f2..665de33 100644
--- a/lib/WebCoso/Common.pm
+++ b/lib/WebCoso/Common.pm
@@ -20,19 +20,19 @@ $xpath->registerNs('x', 'http://www.w3.org/1999/xhtml');
sub langOf {
my ($name)=@_;
- $name=~m{(^|/)document\.([^.]+)(\.|$)} and return $2;
+ $name=~m{(^|/)(?:document|feed)\.([^.]+)(\.|$)} and return $2;
return;
}
sub typeOf {
my ($name)=@_;
- $name=~m{(^|/)document\.[^.]+\.([^.]+\.[^.]+)$} and return $2;
+ $name=~m{(^|/)(?:document|feed)\.[^.]+\.((?:[^.]+\.)*[^.]+)$} and return $2;
return;
}
sub typedAs {
my ($name,$newtype)=@_;
- $name=~s{(^|/)(document\.[^.]+\.)([^.]+\.[^.]+)$}{$1$2$newtype};
+ $name=~s{(^|/)((?:document|feed)\.[^.]+\.)((?:[^.]+\.)*[^.]+)$}{$1$2$newtype};
return $name;
}
@@ -172,6 +172,7 @@ sub fromTo {
else {
push @ret,$file while $file=$iter->();
}
+ DEBUG("fromTo: @ret");
return uniq(@ret);
}
@@ -214,7 +215,10 @@ our %docfiles=(
files=>sub{m{^document\.}},
dirs=>sub{!m{^(tags$|_|\.)}});
our %feedfiles=(
- files=>sub{m{^feed\.[.]+\.tt$}},
- dirs=>sub{!m{^[^_.]}});
+ files=>sub{m{^feed\.[^.]+\.tt$}},
+ dirs=>sub{!m{^[_.]}});
+our %feedfilesXML=(
+ files=>sub{m{^feed\.[^.]+\.xml$}},
+ dirs=>sub{!m{^[_.]}});
1;
diff --git a/lib/WebCoso/Maker.pm b/lib/WebCoso/Maker.pm
index e8943be..11aa9c4 100644
--- a/lib/WebCoso/Maker.pm
+++ b/lib/WebCoso/Maker.pm
@@ -163,7 +163,7 @@ my @passes=(
WebCoso::Common::fromTo("$WebCoso::Common::SRCPATH/",
{
%WebCoso::Common::feedfiles,
- transform=>sub{WebCoso::Common::typedAs($_[0],'.xml')},
+ transform=>sub{WebCoso::Common::typedAs($_[0],'xml')},
}),
"$WebCoso::Common::SRCPATH/_webcoso/tags.yml",
"$WebCoso::Common::SRCPATH/_webcoso/changes.yml",
@@ -205,9 +205,9 @@ my @passes=(
"$WebCoso::Common::SRCPATH/\$1/feed.\$2.xml",
'=',
$xslt->fillFeed()],
- ["$WebCoso::Common::DSTPATH/feed.(*).xml",
+ ["$WebCoso::Common::DSTPATH/()feed.(*).xml",
':',
- "$WebCoso::Common::SRCPATH/feed.\$1.xml",
+ "$WebCoso::Common::SRCPATH/feed.\$2.xml",
'=',
$xslt->fillFeed()],
],
@@ -233,7 +233,7 @@ my @passes=(
}),
WebCoso::Common::fromTo("$WebCoso::Common::SRCPATH/",
{
- %WebCoso::Common::feedfiles,
+ %WebCoso::Common::feedfilesXML,
transform=>sub{
(my $file=$_[0])
=~s{^\Q$WebCoso::Common::SRCPATH\E/}{$WebCoso::Common::DSTPATH/};