mirror of
https://github.com/AdaCore/git-hooks.git
synced 2026-02-12 12:43:11 -08:00
This makes sure that we no longer force the use of this version of Python if it happens to be available on the machine where the hooks are being run. Using gnatpython is no longer desirable since it does not support Python 3.x. Change-Id: I0505e455e3319b78502acbc79c359b79ca555b92 TN: U530-006
49 lines
1.6 KiB
Bash
Executable File
49 lines
1.6 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
|
|
|
|
# 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 -u `dirname $0`/update.py "$@"
|
|
|