X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/06b955b84a0abec6d6baae9eb295793574cb76d7..250bd850e2d41769075a201b098f2961179a8f8c:/IkiWiki.pm?ds=sidebyside diff --git a/IkiWiki.pm b/IkiWiki.pm index a6bfddab0..679ca716e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -6,6 +6,7 @@ use strict; use Encode; use HTML::Entities; use URI::Escape q{uri_escape_utf8}; +use POSIX; use open qw{:utf8 :std}; use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase @@ -16,9 +17,11 @@ use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match bestlink htmllink readfile writefile pagetype srcfile pagename displaytime will_render gettext urlto targetpage - %config %links %renderedfiles %pagesources); + %config %links %renderedfiles %pagesources %destsources); our $VERSION = 1.02; # plugin interface version, next is ikiwiki version -our $version="1.45";my $installdir="/usr"; +our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE +my $installdir=''; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE + # Optimisation. use Memoize; memoize("abs2rel"); @@ -83,8 +86,6 @@ sub checkconfig () { #{{{ delete $ENV{LC_ALL}; } if (defined $config{locale}) { - eval q{use POSIX}; - error($@) if $@; if (POSIX::setlocale(&POSIX::LC_ALL, $config{locale})) { $ENV{LANG}=$config{locale}; $gettext_obj=undef; @@ -247,7 +248,7 @@ sub srcfile ($) { #{{{ return "$config{srcdir}/$file" if -e "$config{srcdir}/$file"; return "$config{underlaydir}/$file" if -e "$config{underlaydir}/$file"; - error("internal error: $file cannot be found"); + error("internal error: $file cannot be found in $config{srcdir} or $config{underlaydir}"); } #}}} sub readfile ($;$$) { #{{{ @@ -434,8 +435,6 @@ sub abs2rel ($$) { #{{{ sub displaytime ($) { #{{{ my $time=shift; - eval q{use POSIX}; - error($@) if $@; # strftime doesn't know about encodings, so make sure # its output is properly treated as utf8 return decode_utf8(POSIX::strftime(