Files
git-hooks/hooks/update
Joel Brobecker 228cf0682c post-receive, update: Update hardcoded path to Git & Python.
sourceware now provides a more central location where specific versions
of some tools can be installed. Git and Python have now been installed
there, so update the scripts accordingly.
2014-12-26 18:46:09 +04:00

54 lines
1.9 KiB
Bash
Executable File

#! /usr/bin/env bash
# This script is expected to be called with the following arguments:
# (1) refname: The name of the reference being updated
# (refs/heads/master, for instance).
# (2) oldrev: This is the commit that the reference was pointing to
# before the update.
# (3) newrev: This is the commit that the ref should point to, if
# the update is accepted.
#
# This script should return 0 if the update should be allowed,
# and nonzero otherwise.
# The following safety checks verify that the script is being
# called correctly. They have been copied directly from the
# sample "update" script provided by git.
if [ -z "$GIT_DIR" ]; then
echo "Don't run this script from the command line." >&2
echo " (if you want, you could supply GIT_DIR then run" >&2
echo " $0 <ref> <oldrev> <newrev>)" >&2
exit 1
fi
# The following is sourceware-specific. Some of the tools installed
# on that machine are too old, causing some really interesting features
# to be missing (Eg: python's OrderedDict, for instance, or git's %B
# format placeholder). So, local installs of more recent versions have
# been placed in /opt/rh/[...].
for tool in git19 python27
do
if [ -f /opt/rh/$tool/enable ]; then
. /opt/rh/$tool/enable
fi
done
# The following is AdaCore-specific: It allows us to make sure that
# we are not running a random version of Python, but rather the
# baseline version installed in /gnatmail.
export PATH=/gnatmail/local/gnatpython/bin:$PATH
# Similarly, update the PATH and LD_LIBRARY_PATH to include the location
# where cvs_check is installed.
for cvs_check_dir in /svn/Dev/hooks /usr/local/svn-hooks \
/jouy.a/web/services/gnos/bin; do
if [ -d $cvs_check_dir ]; then
export PATH=$cvs_check_dir:$PATH
export LD_LIBRARY_PATH=$cvs_check_dir/cvs_check.libs:$LD_LIBRARY_PATH
fi
done
python `dirname $0`/update.py "$@"