Merge branch 'master' into sipb Conflicts: po/Makefile templates/page.tmpl
More cautious escaping of environment values. Tightened the escaping per this review comment: http://source.ikiwiki.branchable.com/?p=source.git;a=commitdiff;h=f35fc6a603b5473ce2c07bb0236e28e57f718315 (I didn't introduce a $tmp, as $val was local to that block already, and each hex encoding is in its own C string literal to avoid consuming subsequent chars that are valid hex digits.)
Installing ikiwiki on a shared-hosting server, there may be no access to install prerequisite Perl modules in the systemwide locations. They may have to be installed under the home directory, such as by using local::lib (which is how the cPanel Perl-module installer works, on systems that use it). For that to work, the local::lib-defined value for PERL5LIB must be in the environment when Perl starts up. The former way %config{ENV} was handled was too late, depending on the Perl code to unpack it from the storable and put it into the environment. Easy solution is to build the wrapper to repopulate the environment based on %config{ENV} before ever exec'ing Perl (and then remove it from the storable as there is nothing more that the Perl code will need to do with it).
Merge branch 'master' into sipb
Merge commit '546da9bac7135d7d1b02dce0c0eef2209d939fc6' into sipb Conflicts: templates/page.tmpl
Merge commit '156f70912213b6520e9056050a8827de66e80176' into sipb Conflicts: templates/page.tmpl
Merge commit 'd4a0732752e79b57509cee33001ab757132366c5' into sipb Conflicts: IkiWiki/Wrapper.pm
Merge commit '4dbb8120f760d9009f0c2639f2ccb9808150aed5' into sipb Conflicts: IkiWiki/Wrapper.pm
Merge commit '21fe996544f43ad5cfcdf36388015971b7fc56d1' into sipb Conflicts: templates/page.tmpl
Merge commit '58a07f9e5436ec815c0cb5736a9680096c977eed' into sipb Conflicts: templates/page.tmpl
Merge commit 'baaa848f6c06b0b3a59677d3551e130c65e5fde7' into sipb Conflicts: templates/page.tmpl
add void prototype
Fix longstanding bug (chdir to nonexistent dirs). In test, set up the post-commit hook for more realism (and bugs!). To make wrappers work in test, set PERL5LIB, and allow the wrappee's path to be overridden. Meta-test that post-commit is really hooked up by verifying that content is getting generated in destdir. About the longstanding bug, which as far as I know was harmless: CVS can't operate outside a srcdir, so we're always setting $CWD. "local $CWD" restores the previous value when we go out of scope. Usually that's correct. But if we're removing the last file from a directory, the post-commit hook will exec in a working directory that's about to not exist (CVS will prune it). The fix: chdir() manually in cvs_runcvs(), so we can selectively not chdir() back.
add cgi_overload_message
add cgi_overload_delay tunable Try to avoid a situation in which so many ikiwiki cgi wrapper programs are running, all waiting on some long-running thing like a site rebuild, that it prevents the web server from doing anything else. The current approach only avoids this problem for GET requests; if multiple cgi's run GETs on a site at the same time, one will display a "please wait" page for a configurable number of seconds, which then redirects to retry. To enable this protection, set cgi_overload_delay to the number of seconds to wait. This is not enabled by default.
Split CFLAGS into words when building wrapper. Closes: #682237
Use lockf rather than flock when taking the cgilock, for better portability. This kind of change is scary, but this particular lock is very simply used and so it seems ok to make it even just for better portability to SunOS. (People still use that?)
let thru HTTP_ACCEPT Needed for attachment to return json when requested. I think some browsers send Accept: * , so I made sure to check that json was explicitly listed as to be accepted, as well as having a high priority.
fix use of debug() without sprintf() Previous commit substituted a printf call (two arguments) for debug (accepts only one). Interleave an sprintf call to resolve.
use debug() for wrapper-generation print outs Use the debug() subroutine for printing out when wrappers are generated. This has the effect of hiding the messages unless verbose mode is enabled.