إعداد svnperms ما قبل الالتزام هوك
-
06-09-2019 - |
سؤال
أحاول تنفيذ svnperms في مستودع، لكنني أواجه صعوبة في عدد قليل من الأشياء:
قبل الالتزام لديه أذونات تنفيذ:
-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 - لا تنتهيات خط ^ م.
Butoissvn يعود مع:
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
ثنائي ليس في $PATH
لخادم SVN. خط شابانغ من svnperms.py
يقرأ:
#!/usr/bin/env python
لكن هذا يفترض أن الملف التنفيذ يكمن في $PATH
المتصل. إذا لم يكن لديك أذونات لتعديل بيئة وقت التشغيل من خادم التخريب الخاص بك، فحاول استبدال python
في خط Shabang مع المسار الذي قدمه which python
عند تشغيله بشكل تفاعلي.