mirror of
https://github.com/AdaCore/git-hooks.git
synced 2026-02-12 12:43:11 -08:00
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.
54 lines
1.9 KiB
Bash
Executable File
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 "$@"
|
|
|