Hi, I just solved a bad problem with post-commit scripts, and svn not being
able to 'recode strings' when called without the LANG environment variable.
It is important (here at least) to specify a LANG environment variable when
calling "svn update" in a website-auto-update-like script, otherwise it won't
work.. and you won't know why, because the outputs of each stack of scripts
will just don't show anytime soon :)
commit msg:
website-auto-update faq update with LANG env. problem's solution
wow, nice tagline
Alexandre Bourget
patch follows:
Index: faq.html
===================================================================
--- faq.html (revision 12830)
+++ faq.html (working copy)
@@ -1572,11 +1572,25 @@
that svnserve or apache runs as -- or at least the working copy must
have appropriate permissions set.</p>
+<p>Another thing to watch for is the <b>LANG</b> environment
+variable. If it is not set, <pre>svn</pre> will complain about not
+being able to recode a string. You're unlikely to see this error
+message at any time, because it appears when <pre>post-commit</pre>
+calls your suid program or a <pre>sudo -u user program</pre>, and that
+program calls <pre>svn</pre>. The output doesn't reach the top, so if
+you have a non-working <pre>post-commit</pre> script, try to
+<pre>export LANG=</pre>whatever your prefered language is. See
+<pre>/usr/bin/env</pre> in your regular shell for an example.</p>
+
<p>If the server needs to update a working copy that it doesn't own
(for example, user joe's ~/public_html/ area), one technique is create
a +s binary program to run the update, since Unix won't allow scripts
to run +s. Compile a tiny C program:</p>
+<p>Another technique is to use the sudo mechanism. Read
+<pre>man sudoers</pre> and <pre>man sudo</pre>, run <pre>visudo</pre>,
+edit+save and so on. You have great flexibility using this tool.</p>
+
<pre>
#include <stdlib.h>
int main(int argc, const char *argv[])
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jan 24 07:28:52 2005