* [Bug 1586] ntpd 4.2.7p40 doesn't write to syslog after fork on QNX.
+* Avoid race with parallel builds using same source directory in
+ scripts/genver by using build directory for temporary files.
(4.2.7p40) 2010/07/12 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 1395] ease ntpdate elimination with ntpd -w/--wait-sync
* [Bug 1396] allow servers on ntpd command line like ntpdate
case "$$x" in ''|$$y) ;; *) echo $$x > version ;; esac
$(srcdir)/version.m4: $(srcdir)/packageinfo.sh
- cd $(srcdir) && \
+ TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \
./scripts/genver version.m4
$(srcdir)/include/version.def: $(srcdir)/packageinfo.sh
- cd $(srcdir) && \
+ TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \
./scripts/genver include/version.def
$(srcdir)/include/version.texi: $(srcdir)/packageinfo.sh
- cd $(srcdir) && \
+ TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \
./scripts/genver include/version.texi
libtool: $(LIBTOOL_DEPS)
for i in $*
do
case "$i" in
- -f) force=1 ;;
+ -f)
+ force=1
+ ;;
version.m4)
outputs="version.m4 $outputs"
;;
set +e
+# Create intermediate files in $TEMPDIR defaulting it to /tmp
+# if not set. This avoids races when multiple builds run in
+# parallel on shared source.
+
+TEMPDIR=${TEMPDIR=/tmp}
+
case "$outputs" in
*version.m4*)
- echo "m4_define([VERSION_NUMBER],[${dversion}])" > /tmp/version.m4+
- cmp -s /tmp/version.m4+ version.m4
+ echo "m4_define([VERSION_NUMBER],[${dversion}])" > "${TEMPDIR}/version.m4+"
+ cmp -s "${TEMPDIR}/version.m4+" version.m4
rc=$?
case "$force$rc" in
00)
- rm -f /tmp/version.m4+
+ rm -f "${TEMPDIR}/version.m4+"
;;
*)
- mv /tmp/version.m4+ version.m4
+ mv "${TEMPDIR}/version.m4+" version.m4
;;
esac
;;
case "$outputs" in
*version.def*)
- echo "version = '${dversion}';" > /tmp/version.def+
- cmp -s /tmp/version.def+ include/version.def
+ echo "version = '${dversion}';" > "${TEMPDIR}/version.def+"
+ cmp -s "${TEMPDIR}/version.def+" include/version.def
rc=$?
case "$force$rc" in
00)
- rm -f /tmp/version.def+
+ rm -f "${TEMPDIR}/version.def+"
;;
*)
- mv /tmp/version.def+ include/version.def
+ mv "${TEMPDIR}/version.def+" include/version.def
;;
esac
;;
case "$outputs" in
*version.texi*)
- echo "@set UPDATED `date +'%d %B %Y'`" > /tmp/version.texi+
- echo "@set EDITION $dversion" >> /tmp/version.texi+
- echo "@set VERSION $dversion" >> /tmp/version.texi+
- cmp -s /tmp/version.texi+ include/version.texi
+ echo "@set UPDATED `date +'%d %B %Y'`" > "${TEMPDIR}/version.texi+"
+ echo "@set EDITION $dversion" >> "${TEMPDIR}/version.texi+"
+ echo "@set VERSION $dversion" >> "${TEMPDIR}/version.texi+"
+ cmp -s "${TEMPDIR}/version.texi+" include/version.texi
rc=$?
case "$force$rc" in
00)
- rm -f /tmp/version.texi+
+ rm -f "${TEMPDIR}/version.texi+"
;;
*)
- mv /tmp/version.texi+ include/version.texi
+ mv "${TEMPDIR}/version.texi+" include/version.texi
;;
esac
;;