Skip to content

Commit a6d5591

Browse files
committed
Update to Git pre-commit hook. Also fixed Travis CI clang builds.
1 parent 6e73117 commit a6d5591

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
env:
2+
global:
3+
# Required for clang.
4+
- CXXFLAGS="-fno-fast-math"
15
branches:
26
except:
37
- /^v[0-9]/
@@ -15,7 +19,6 @@ compiler:
1519
matrix:
1620
allow_failures:
1721
- os: osx
18-
- compiler: clang
1922

2023
sudo: false
2124

tools/git/hooks/pre-commit

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@ then
9292
fi
9393
fi
9494

95-
echo "unix/VERSION identifies this as version:"
96-
echo " $ver_VERSION"
97-
98-
if [ x"$ver_VERSION" != x"$ver_povray_h-$prerelease_povray_h" ]
95+
if [ x"$ver_VERSION" != x"" ]
9996
then
100-
echo "MISMATCH."
101-
exit 1
97+
echo "unix/VERSION identifies this as version:"
98+
echo " $ver_VERSION"
99+
if [ x"$ver_VERSION" != x"$ver_povray_h-$prerelease_povray_h" ]
100+
then
101+
echo "MISMATCH."
102+
exit 1
103+
fi
102104
fi
103105

104106
########################################################################################################################
@@ -130,15 +132,19 @@ then
130132
-e 's/\(#define [ ]*POV_RAY_PRERELEASE [ ]*".*[^0-9]\)[0-9][0-9]*"/\1'"$revision"'"/g' \
131133
-e "$sed_newline_fix" \
132134
"$versionfile" >/dev/null 2>/dev/null
133-
sed -i \
134-
-e 's/\([^0-9]\)[0-9][0-9]*$/\1'"$revision"'/g' \
135-
-e "$sed_newline_fix" \
136-
unix/VERSION >/dev/null 2>/dev/null
137-
138-
sed_i_fix "$versionfile" unix/VERSION
139-
140-
# stage updates
141-
git add "$versionfile" unix/VERSION >/dev/null 2>/dev/null
135+
sed_i_fix "$versionfile"
136+
# stage update
137+
git add "$versionfile" >/dev/null 2>/dev/null
138+
if [ -f unix/VERSION ]
139+
then
140+
sed -i \
141+
-e 's/\([^0-9]\)[0-9][0-9]*$/\1'"$revision"'/g' \
142+
-e "$sed_newline_fix" \
143+
unix/VERSION >/dev/null 2>/dev/null
144+
sed_i_fix unix/VERSION
145+
# stage update
146+
git add unix/VERSION >/dev/null 2>/dev/null
147+
fi
142148
fi
143149
else
144150
echo "changes are limited to accompanying files, no need to update POV_RAY_PRERELEASE."

0 commit comments

Comments
 (0)