WelcomePage RecentChanges SpwWiki

DoPatch

If the "#DoPatch" command is the sole word on the first line of a wiki page, then after the 4 day veto period has elapsed, SPW will apply as a patch whatever is in between the first pair of <pre></pre> tags on that page. (SPW does this stuff when an "action=maintain" is called, which is done periodically).

SPW will apply the patch file with the command

/usr/bin/patch -d/ -p0 <your_patch_file

An example of using DoPatch can be found in SpwTutorial.

More info

So, to use DoPatch:

1. Create a wiki page on SPW. At the top, on the first line, put " #DoPatch". Then, somewhere afterwards, put <pre>my_patch</pre>. That is to say, in a text editor on your computer, copy the contents of your patch file (my_patch in the example) and paste it into the wiki page, in between <pre> tags. Note that the patch command is picky about tabs and newlines, so make sure there is a newline at the end (i.e. the final <pre> tag should be on its own line, below everything else) and that the tabs don't get screwed up. Also, however, put an extra newline at the start (so that the actual start of the patch is not on the same line as the <pre>).

2. Wait for the veto period to end. When the page you created has been standing for 4 days without any changes, whatever is in between the <pre></pre> tags will be applied. SPW will make an entry in RecentChanges? with UserName? "SPW" and summary "EXECUTED PATCH COMMAND". It will change the "#DoPatch" on the page to "#DidPatch?", and will append the results of the patch command.


CategoryDocumentation