move generic comment into IkiWiki::Setup
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 19 Mar 2010 19:35:21 +0000 (15:35 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 19 Mar 2010 19:35:21 +0000 (15:35 -0400)
IkiWiki/Setup.pm
IkiWiki/Setup/Standard.pm

index 369ff44d094df5cd5efd5757f9a9059d790f03de..45f263bc8988b990f447c3d7c84947bd4997043e 100644 (file)
@@ -52,7 +52,14 @@ sub dump ($) {
        
        eval qq{require $config{setuptype}};
        error $@ if $@;
-       my @dump=$config{setuptype}->gendump("Setup file for ikiwiki.");
+       my @dump=$config{setuptype}->gendump(
+               "Setup file for ikiwiki.",
+               "",
+               "Passing this to ikiwiki --setup will make ikiwiki generate",
+               "wrappers and build the wiki.",
+               "",
+               "Remember to re-run ikiwiki --setup any time you edit this file.",
+       );
 
        open (OUT, ">", $file) || die "$file: $!";
        print OUT "$_\n" foreach @dump;
index 9c177e497ae105a4e8646c40425cfc46f8a25644..92e97c4b41fcbaed41b1a4ca2e787da7913f0526 100644 (file)
@@ -12,20 +12,15 @@ sub import {
        IkiWiki::Setup::merge($_[1]);
 }
 
-sub gendump ($$) {
+sub gendump ($@) {
        my $class=shift;
-       my $description=shift;
 
        "#!/usr/bin/perl",
-       "# $description",
        "#",
-       "# Passing this to ikiwiki --setup will make ikiwiki generate",
-       "# wrappers and build the wiki.",
-       "#",
-       "# Remember to re-run ikiwiki --setup any time you edit this file.",
+       (map { "# $_" } @_),
        "use IkiWiki::Setup::Standard {",
        IkiWiki::Setup::commented_dump(\&dumpline),
-       "}";
+       "}"
 }
 
 sub dumpline ($$$$) {