X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/912521ef0711204965aa2319d41c7741bd3f4f4c..89484c06d97cc7d47118ba9bcf6039431d3ff368:/IkiWiki/Plugin/aggregate.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 46cd3102c..7fceb0df3 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -233,7 +233,7 @@ sub aggregate () { #{{{ $feed->{newposts}=0; $IkiWiki::forcerebuild{$feed->{sourcepage}}=1; - debug(sprintf(gettext("checking feed %s ..."), $feed->{name})); + debug(sprintf(gettext("checking feed %s ..."), $feed->{name})); if (! length $feed->{feedurl}) { my @urls=XML::Feed->find_feeds($feed->{url}); @@ -270,7 +270,7 @@ sub aggregate () { #{{{ ); } - $feed->{message}=sprintf(gettext("processed ok at "), + $feed->{message}=sprintf(gettext("processed ok at %s"), displaytime($feed->{lastupdate})); $feed->{error}=0; } @@ -310,6 +310,20 @@ sub add_page (@) { #{{{ -e pagefile($page.$c)) { $c++ } + + # Make sure that the file name isn't too long. + # NB: This doesn't check for path length limits. + eval q{use POSIX}; + my $max=POSIX::pathconf($config{srcdir}, &POSIX::_PC_NAME_MAX); + if (defined $max && length(htmlpage($page)) >= $max) { + $c=""; + $page=$feed->{dir}."/item"; + while (exists $IkiWiki::pagecase{lc $page.$c} || + -e pagefile($page.$c)) { + $c++ + } + } + $guid->{page}=$page; debug(sprintf(gettext("creating new page %s"), $page)); }