X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/bbe1f2e493f009b49aba6ab83304f9484e37c61d..824cf7db1b96a16b080e284bc3ebf90c1f14a203:/IkiWiki/Setup/Standard.pm diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index 92e97c4b4..07a66f3db 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -1,6 +1,4 @@ #!/usr/bin/perl -# Standard ikiwiki setup module. -# Parameters to import should be all the standard ikiwiki config stuff. package IkiWiki::Setup::Standard; @@ -8,6 +6,7 @@ use warnings; use strict; use IkiWiki; +# Parameters to import should be all the standard ikiwiki config, in a hash. sub import { IkiWiki::Setup::merge($_[1]); } @@ -15,11 +14,14 @@ sub import { sub gendump ($@) { my $class=shift; - "#!/usr/bin/perl", + my $thisperl = eval q{use Config; $Config{perlpath}}; + error($@) if $@; + + "#!$thisperl", "#", (map { "# $_" } @_), "use IkiWiki::Setup::Standard {", - IkiWiki::Setup::commented_dump(\&dumpline), + IkiWiki::Setup::commented_dump(\&dumpline, "\t"), "}" } @@ -31,6 +33,7 @@ sub dumpline ($$$$) { eval q{use Data::Dumper}; error($@) if $@; + no warnings 'once'; local $Data::Dumper::Terse=1; local $Data::Dumper::Indent=1; local $Data::Dumper::Pad="\t"; @@ -38,6 +41,7 @@ sub dumpline ($$$$) { local $Data::Dumper::Quotekeys=0; # only the perl version preserves utf-8 in output local $Data::Dumper::Useperl=1; + use warnings; my $dumpedvalue; if (($type eq 'boolean' || $type eq 'integer') && $value=~/^[0-9]+$/) {