shorten setuptype
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 19 Mar 2010 19:55:10 +0000 (15:55 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 19 Mar 2010 19:55:10 +0000 (15:55 -0400)
IkiWiki.pm
IkiWiki/Setup.pm

index 241fb45b7f09cfdbab4cf285fd63f78406ee5b4e..022bfe3bd7c0e3901311e7768a7abc5571e756d8 100644 (file)
@@ -469,7 +469,7 @@ sub getsetup () {
        },
        setuptype => {
                type => "internal",
-               default => "IkiWiki::Setup::Standard",
+               default => "Standard",
                description => "perl class to use to dump setup file",
                safe => 0,
                rebuild => 0,
index a71a12d9d28ae53c5f4e9f2abe74a77c81b33232..2cf01ea684e634da1b8bb4e0254256ca3507e59c 100644 (file)
@@ -28,7 +28,7 @@ sub load ($;$) {
        }
        close IN;
 
-       if ($content=~/(use\s+)?(IkiWiki::Setup::\w+)/) {
+       if ($content=~/(use\s+)?IkiWiki::Setup::(\w+)/) {
                $config{setuptype}=$2;
                if ($1) {
                        error sprintf(gettext("cannot load %s in safe mode"), $file)
@@ -37,9 +37,9 @@ sub load ($;$) {
                        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 +50,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",