2009-05-27 7 views
0

私はリポジトリにsvnpermsを実装しようとしているが、いくつかのことの難しさを持っています:セットアップsvnperms事前にコミットフック

事前にコミットが実行権限を持っています

-rwxrwxr-x 1 svnadm  svn   3018 May 27 10:11 pre-commit 

この

:私はsvnperms.pyが指定した場所に設置持っ

# Check that the author of this commit has the rights to perform 
# the commit on the files and directories being modified. 
SVNPERMS=/usr/local/svn/scripts/svnperms.py 
$SVNPERMS -r $REPOS -t $TXN || exit 1 

:内svnpermsに私の呼び出しは、プリコミットされます

# ls -l /usr/local/svn/scripts 
total 24 
-rwxrwxr-x 1 svnadm  svn   11840 May 25 07:48 svnperms.py 

svnperms.pyはUNIX形式です。^ M行の終了はありません。

TortoiseSVNはバックが付属しています:なし偶然にして

Command: Commit 
Modified: C:\projects\Sandbox\Trunk\Test.txt 
Sending content: C:\projects\Sandbox\Trunk\Test.txt 
Error: Commit failed (details follow): 
Error: 'pre-commit' hook failed with error output: 
Error: No such file or directory: python 

呼び出すsvnpermsを示しています。

/usr/local/svn/scripts/svnperms.py 
missing required option(s): repository, either transaction or a revision 
Usage: svnperms.py OPTIONS 

Options: 
    -r PATH Use repository at PATH to check transactions 
    -t TXN  Query transaction TXN for commit information 
    -f PATH Use PATH as configuration file (default is repository 
       path + /conf/svnperms.conf) 
    -s NAME Use section NAME as permission section (default is 
       repository name, extracted from repository path) 
    -R REV  Query revision REV for commit information (for tests) 
    -A AUTHOR Check commit as if AUTHOR had commited it (for tests) 
    -h   Show this message 

UNIX管理者は、最近のpythonをインストールしたのですが、すべての依存関係があるかどうかわからなかったしました。それが問題ならば、私はそれをどのように決定するのか分からない。なぜなら、Pythonは上記の出力に基づいて動作しているようだからだ。

私には何が欠けていますか?

答えて

6

私の推測では、pythonバイナリの場所は、svnサーバーの$PATHにありません。

#!/usr/bin/env python 
しかし、それは実行ファイルは、発信者の $PATHにあることを前提としています svnperms.pyのshabangラインを読み込みます。 Subversionサーバーのランタイム環境を変更する権限がない場合は、対話的に実行すると、shabang行の pythonwhich pythonで指定されたパスに置き換えてみてください。

+0

Dang!それに私を打つ。 ;-) –

+0

ありがとう!それはそれをした! ノートをもっと見ると、明らかに、スクリプトが$ PATHを継承しないという共通の問題です。 – jgreep

+1

http://svnbook.red-bean.com/en/1.5/svn.reposadmin.create.html#svn.reposadmin.create.hによると、セキュリティ上の理由から、プログラムによって空の環境が設計されています。 –

関連する問題