2009-05-27 80 views
0

我試圖實現svnperms到存儲庫,但我有一個幾件事情的困難:設置svnperms pre-commit鉤子

預提交具有執行權限:

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

這是我內svnperms通話預提交:

# 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.py安裝在指定的位置:

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

svnperms.py是UNIX格式 - no^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 

沒有paramters調用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二進制文件的位置不在$PATH的svn服務器中。的svnperms.py的shabang一行:

#!/usr/bin/env python 

但是,假設可執行文件位於調用者的$PATH。如果您無權修改Subversion服務器的運行時環境,請嘗試在交叉運行時將shabang行中的python替換爲which python給出的路徑。

+0

當!打敗我吧。 ;-) – 2009-05-27 17:33:28

相關問題