]> sipb.mit.edu Git - ikiwiki.git/commitdiff
add --refresh and make it with with --setup
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 26 Mar 2006 05:08:41 +0000 (05:08 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 26 Mar 2006 05:08:41 +0000 (05:08 +0000)
IkiWiki/CGI.pm
IkiWiki/Setup.pm
IkiWiki/Setup/Standard.pm
doc/bugs.mdwn
doc/usage.mdwn
ikiwiki

index 560377f0e4709d32bc0356b97185a0425ce40729..f472413b80765be538d293b82ec77297f5a45102 100644 (file)
@@ -513,7 +513,7 @@ sub cgi () { #{{{
                # is entered
                my $page=lc($q->param('title'));
                $page=~y/ /_/;
                # is entered
                my $page=lc($q->param('title'));
                $page=~y/ /_/;
-               $page=~s/([^-A-Za-z0-9_:+/])/"__".ord($1)."__"/eg;
+               $page=~s/([^-A-Za-z0-9_:+\/])/"__".ord($1)."__"/eg;
                # if the page already exist, munge it to be unique
                my $from=$q->param('from');
                my $add="";
                # if the page already exist, munge it to be unique
                my $from=$q->param('from');
                my $add="";
index 0c8ad9208d50768d8f2eb37473ddc2f5d85187f4..40ed788624a16ba5f38413e74be6802f7fb1ad5f 100644 (file)
@@ -19,6 +19,7 @@ sub setup () { # {{{
 
        eval $code;
        error($@) if $@;
 
        eval $code;
        error($@) if $@;
+
        exit;
 } #}}}
 
        exit;
 } #}}}
 
index c5a67afdf7cce69f4e1fea08f7dae4b377f14111..b26df006b9d3e1d0ae58249ed4417f0f3c9f3746 100644 (file)
@@ -20,21 +20,27 @@ package IkiWiki;
 sub setup_standard {
        my %setup=%{$_[1]};
 
 sub setup_standard {
        my %setup=%{$_[1]};
 
-       debug("generating wrappers..");
-       my %startconfig=(%config);
-       foreach my $wrapper (@{$setup{wrappers}}) {
-               %config=(%startconfig, verbose => 0, %setup, %{$wrapper});
-               checkconfig();
-               gen_wrapper();
+       if (! $config{refresh}) {
+               debug("generating wrappers..");
+               my %startconfig=(%config);
+               foreach my $wrapper (@{$setup{wrappers}}) {
+                       %config=(%startconfig, verbose => 0, %setup, %{$wrapper});
+                       checkconfig();
+                       gen_wrapper();
+               }
+               %config=(%startconfig);
        }
        }
-       %config=(%startconfig);
-       
-       debug("rebuilding wiki..");
        foreach my $c (keys %setup) {
                $config{$c}=possibly_foolish_untaint($setup{$c})
                        if defined $setup{$c} && ! ref $setup{$c};
        }
        foreach my $c (keys %setup) {
                $config{$c}=possibly_foolish_untaint($setup{$c})
                        if defined $setup{$c} && ! ref $setup{$c};
        }
-       $config{rebuild}=1;
+       if (! $config{refresh}) {
+               $config{rebuild}=1;
+               debug("rebuilding wiki..");
+       }
+       else {
+               debug("refreshing wiki..");
+       }
 
        checkconfig();
        lockwiki();
 
        checkconfig();
        lockwiki();
index ede1c48377b02236e8567c6e76eb36dd763b0648..3d6ea906b00ce07fe13ec813ef3dec1deda544b8 100644 (file)
@@ -25,3 +25,6 @@
   will linger around and not be deleted.
 * Currently only one blog is supported per page. Attempts to add more
   will make it only update one of the blogs on the page.
   will linger around and not be deleted.
 * Currently only one blog is supported per page. Attempts to add more
   will make it only update one of the blogs on the page.
+* If I edit blog/entry/blog_moved, add a link to code/ikiwiki, and hit
+  preview, it doesn't get the link right because it makes it relative to
+  where the page will be saved to, not to where the cgi script is.
index aa4978773552d90f0f0e2287dc4fcfd8edc722c6..f2f0fba9af39ec714c97b6dd77f2b479d2954601 100644 (file)
@@ -30,6 +30,11 @@ flags such as --verbose can be negated with --no-verbose.
 
   Force a rebuild of all pages.
 
 
   Force a rebuild of all pages.
 
+* --refresh
+
+  Refresh the wiki, updating any changes pages. This is the default
+  behavior so you don't normally need to specify it.
+
 * --fixctime
 
   Pull last changed time for all pages out of the revision control system.
 * --fixctime
 
   Pull last changed time for all pages out of the revision control system.
@@ -117,12 +122,12 @@ flags such as --verbose can be negated with --no-verbose.
 * --setup configfile
 
   In setup mode, ikiwiki reads the config file, which is really a perl
 * --setup configfile
 
   In setup mode, ikiwiki reads the config file, which is really a perl
-  program that can call ikiwiki internal functions. Uses of this are
-  various; the normal one is to automatically generate wrappers for a
-  wiki based on data in a config file.
-  
-  Note that the wiki will be (re)built as part of the setup process to
-  ensure that any changes take effect.
+  program that can call ikiwiki internal functions.
+
+  The default action when --setup is specified is to automatically generate
+  wrappers for a wiki based on data in a config file, and rebuild the wiki.
+  If you also pass the --refresh option, ikiwiki will instead just refresh
+  the wiki described in the setup file.
 
   [[ikiwiki.setup]] is an example of such a config file.
 
 
   [[ikiwiki.setup]] is an example of such a config file.
 
diff --git a/ikiwiki b/ikiwiki
index ab9f3fc2f68d862284787258c699ebc33bdcd410..c5ac7c0b824549d5ef895953fd6b93b04784950a 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -34,6 +34,7 @@ sub getconfig () { #{{{
                        anonok => 0,
                        rss => 0,
                        rebuild => 0,
                        anonok => 0,
                        rss => 0,
                        rebuild => 0,
+                       refresh => 0,
                        getctime => 0,
                        wrapper => undef,
                        wrappermode => undef,
                        getctime => 0,
                        wrapper => undef,
                        wrappermode => undef,
@@ -50,6 +51,7 @@ sub getconfig () { #{{{
                        "wikiname=s" => \$config{wikiname},
                        "verbose|v!" => \$config{verbose},
                        "rebuild!" => \$config{rebuild},
                        "wikiname=s" => \$config{wikiname},
                        "verbose|v!" => \$config{verbose},
                        "rebuild!" => \$config{rebuild},
+                       "refresh!" => \$config{refresh},
                        "getctime" => \$config{getctime},
                        "wrappermode=i" => \$config{wrappermode},
                        "svn!" => \$config{svn},
                        "getctime" => \$config{getctime},
                        "wrappermode=i" => \$config{wrappermode},
                        "svn!" => \$config{svn},