[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] website-auto-update faq update with LANG env. problem's solution

From: Alexandre B <alex_at_bourget.cc>
Date: 2005-01-24 05:58:13 CET

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>
 #include &lt;stdlib.h&gt;
 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

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.