Domanda

Sto cercando di implementare svnperms in un repository, ma sto avendo difficoltà con un paio di cose:

pre-commit ha le autorizzazioni di esecuzione:

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

Questa è la mia chiamata a svnperms all'interno di pre-commit:

# 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

Ho svnperms.py installato nella posizione specificata:

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

svnperms.py è in formato UNIX -. Non ^ M fine riga

TortoiseSVN torna con:

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  

La chiamata svnperms senza paramters mostra:

/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

L'amministratore UNIX ha recentemente installato python, ma non era sicuro se tutte le dipendenze ci sono. Se questo è il problema, non sono sicuro di come determinare che, dal pitone sembra funzionare in base alla produzione di cui sopra.

Che cosa mi manca?

È stato utile?

Soluzione

La mia ipotesi è che la posizione del binario python non è in $PATH per il server svn. La linea di shabang svnperms.py legge:

#!/usr/bin/env python

Ma questo presuppone che l'eseguibile si trova nel $PATH del chiamante. Se non si dispone di autorizzazioni per modificare l'ambiente di runtime del server di sovversione, provare a sostituire python nella linea shabang con il percorso data dal which python quando si esegue in modo interattivo.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top