forked from Unidata/UDUNITS-2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck-commit
More file actions
executable file
·50 lines (42 loc) · 842 Bytes
/
check-commit
File metadata and controls
executable file
·50 lines (42 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
exec >$HOME/check-commit.log 2>&1
echo pwd=`pwd`
echo '$0'=\"$0\"
echo '$-'=\"$-\"
echo '$$'=\"$$\"
ps -O pgid -p $$
for arg in "$@"; do
echo arg=\"$arg\"
done
set -x -m
topSrcDir=`dirname $0`
if cd $topSrcDir; then
(
#
# Allow only one process to proceed.
#
while ! ln -s /dev/null check-commit.ln 2>/dev/null
do
sleep 10
done
trap 'rm -f check-commit.ln' EXIT
trap 'exit 1' HUP INT QUIT TERM
if test -f check-commit.pid; then
pid=`cat check-commit.pid`
kill -- -$pid
while kill -n 0 $pid
do
sleep 1
done
fi
echo $! >check-commit.pid
trap 'rm -f check-commit.pid' EXIT
#
# Allow another process to proceed.
#
rm check-commit.ln
sleep 300
make remote-checks 2>&1 | ssh zero mailx \
-s '"UDUNITS-2: \"make remote-checks\" output"' \
$USER@unidata.ucar.edu
) &
fi