]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Setup.pm
Removed redundant "configure'
[git.ikiwiki.info.git] / IkiWiki / Setup.pm
index a71a12d9d28ae53c5f4e9f2abe74a77c81b33232..ee5be95d2a1cdd2a6a07b8174120e9961755c037 100644 (file)
@@ -28,18 +28,19 @@ sub load ($;$) {
        }
        close IN;
 
-       if ($content=~/(use\s+)?(IkiWiki::Setup::\w+)/) {
+       if ($content=~/((?:use|require)\s+)?IkiWiki::Setup::(\w+)/) {
                $config{setuptype}=$2;
                if ($1) {
                        error sprintf(gettext("cannot load %s in safe mode"), $file)
                                if $safemode;
+                       no warnings;
                        eval IkiWiki::possibly_foolish_untaint($content);
                        error("$file: ".$@) if $@;
                }
                else {
-                       eval qq{require $config{setuptype}};
+                       eval qq{require IkiWiki::Setup::$config{setuptype}};
                        error $@ if $@;
-                       $config{setuptype}->loaddump(IkiWiki::possibly_foolish_untaint($content));
+                       "IkiWiki::Setup::$config{setuptype}"->loaddump(IkiWiki::possibly_foolish_untaint($content));
                }
        }
        else {
@@ -50,9 +51,9 @@ sub load ($;$) {
 sub dump ($) {
        my $file=IkiWiki::possibly_foolish_untaint(shift);
        
-       eval qq{require $config{setuptype}};
+       eval qq{require IkiWiki::Setup::$config{setuptype}};
        error $@ if $@;
-       my @dump=$config{setuptype}->gendump(
+       my @dump="IkiWiki::Setup::$config{setuptype}"->gendump(
                "Setup file for ikiwiki.",
                "",
                "Passing this to ikiwiki --setup will make ikiwiki generate",