From fa974eb8dd225205d9faa1f39ab5db83012de2f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20d=27Anterroches?= Date: Sun, 9 Jan 2011 11:02:27 +0100 Subject: [PATCH] Fixed the detection of the paths to the commit hooks. The symlinks to the post commit/post update scripts are absolute path symlinks, so a simple readlink is used. The is relative, so a bit of shell skill is used to resolve the path to the absolute path. --- scripts/git-post-update | 5 +---- scripts/svn-post-commit | 4 +--- scripts/svn-post-revprop-change | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/git-post-update b/scripts/git-post-update index b407b1d..f1b2b73 100755 --- a/scripts/git-post-update +++ b/scripts/git-post-update @@ -17,11 +17,8 @@ # git$ ln -s /home/www/indefero/scripts/git-post-update post-update # -dir=$(dirname "$0") -res=$(cd "$dir" && /bin/pwd || "$dir") -SCRIPTDIR="$res/$(readlink $0)" +SCRIPTDIR=$(dirname $(readlink $0)) FULL_GIT_DIR=$(cd "$GIT_DIR" && /bin/pwd || "$GIT_DIR") - PHP_POST_UPDATE=$SCRIPTDIR/gitpostupdate.php echo php $PHP_POST_UPDATE $FULL_GIT_DIR | at now > /dev/null 2>&1 diff --git a/scripts/svn-post-commit b/scripts/svn-post-commit index ae2ce01..649da83 100755 --- a/scripts/svn-post-commit +++ b/scripts/svn-post-commit @@ -18,9 +18,7 @@ # www$ ln -s /home/www/indefero/scripts/svn-post-commit post-commit # -dir=$(dirname "$0") -res=$(cd "$dir" && /bin/pwd || "$dir") -SCRIPTDIR="$res/$(readlink $0)" +SCRIPTDIR=$(dirname $(readlink $0)) PHP_POST_COMMIT=$SCRIPTDIR/svnpostcommit.php echo php $PHP_POST_COMMIT "$1" "$2" | at now > /dev/null 2>&1 diff --git a/scripts/svn-post-revprop-change b/scripts/svn-post-revprop-change index 0fc63b8..97b9283 100755 --- a/scripts/svn-post-revprop-change +++ b/scripts/svn-post-revprop-change @@ -18,9 +18,7 @@ # www$ ln -s /home/www/indefero/scripts/svn-post-revprop-change post-revprop-change # -dir=$(dirname "$0") -res=$(cd "$dir" && /bin/pwd || "$dir") -SCRIPTDIR="$res/$(readlink $0)" +SCRIPTDIR=$(dirname $(readlink $0)) PHP_POST_REVPROP=$SCRIPTDIR/svnpostrevpropchange.php echo php $PHP_POST_REVPROP "$1" "$2" "$3" "$4" "$5" | at now > /dev/null 2>&1