diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-07-09 22:47:06 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-07-09 22:47:06 -0400 |
commit | aa1f0080a81ac253ae4ff8822132327ee29fe835 (patch) | |
tree | 7c6c920ce5f8de03c7211f9cc53894fc756aae61 | |
parent | fb1aaacd90e444cbd7552d4618f655c5e4c9a570 (diff) |
clarifications, comments
-rw-r--r-- | IkiWiki/Setup.pm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index 778e1b495..a37264cd7 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -1,4 +1,11 @@ #!/usr/bin/perl +# Ikiwiki setup files are perl files that 'use IkiWiki::Setup::foo', +# passing it some sort of configuration data. +# +# There can be multiple modules, with different configuration styles. +# The setup modules each convert the data into the hashes used by ikiwiki +# internally (if it's not already in that format), and store it in +# IkiWiki::Setup::$raw_setup, to pass it back to this module. package IkiWiki::Setup; use warnings; @@ -6,8 +13,6 @@ use strict; use IkiWiki; use open qw{:utf8 :std}; -# This hashref is where setup files store settings while they're being -# loaded. It is not used otherwise. our $raw_setup; sub load ($) { # {{{ @@ -67,14 +72,14 @@ sub setup () { #{{{ next if $c eq 'syslog'; if (defined $setup{$c}) { if (! ref $setup{$c}) { - $config{$c}=IkiWiki::possibly_foolish_untaint($setup{$c}); + $config{$c}=possibly_foolish_untaint($setup{$c}); } elsif (ref $setup{$c} eq 'ARRAY') { - $config{$c}=[map { IkiWiki::possibly_foolish_untaint($_) } @{$setup{$c}}] + $config{$c}=[map { possibly_foolish_untaint($_) } @{$setup{$c}}] } elsif (ref $setup{$c} eq 'HASH') { foreach my $key (keys %{$setup{$c}}) { - $config{$c}{$key}=IkiWiki::possibly_foolish_untaint($setup{$c}{$key}); + $config{$c}{$key}=possibly_foolish_untaint($setup{$c}{$key}); } } } |