From ac5611be7aabc24a96632a00946a4e4aa686a3bb Mon Sep 17 00:00:00 2001
From: Simon Rose <simon.rose@ess.eu>
Date: Mon, 14 Feb 2022 13:04:59 +0100
Subject: [PATCH] Small fix for weird buffering issue

This seems to be a very specific, limited issue, affecting virtualbox VMs only. There appears to
be an issue with how append data is buffered and written to disk. You can see this with the
following commands:

```console
$ rm -f out.tmp && seq 1569 >> out.tmp && ls -l out.tmp
-rw-r--r-- 1 simonrose vagrant 8188 Feb 14 12:12 se.tmp
$ rm -f out.tmp && seq 1560 >> out.tmp && ls -l out.tmp
-rw-r--r-- 1 simonrose vagrant 8192 Feb 14 12:12 se.tmp
$ rm -f out.tmp && seq 9999 >> out.tmp && ls -l out.tmp
-rw-r--r-- 1 simonrose vagrant 8192 Feb 14 12:12 se.tmp
```
Note that the last two files are the same size, when they should clearly be quite different. If we
remove the `>>` and replace it with a `>`, then all works correctly:
```console
$ rm -f out.tmp && seq 9999 > out.tmp && ls -l out.tmp
-rw-r--r-- 1 simonrose vagrant 48888 Feb 14 13:14 out.tmp
```
Note the file size in this case.
---
 require-ess/tools/driver.makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/require-ess/tools/driver.makefile b/require-ess/tools/driver.makefile
index f9a13412..205886a8 100644
--- a/require-ess/tools/driver.makefile
+++ b/require-ess/tools/driver.makefile
@@ -868,7 +868,7 @@ ${DEPFILE}: ${LIBOBJS} $(USERMAKEFILE)
 	$(RM) $@.tmp
 	@echo "# Generated file. Do not edit." > $@
 # Check dependencies on other module headers.
-	cat *.d 2>/dev/null | sed 's/ /\n/g' | grep -v '$(EPICS_BASE)/include' | sed -n '$(DEP_PARSER)' >> $@.tmp
+	cat *.d 2>/dev/null | sed 's/ /\n/g' | grep -v '$(EPICS_BASE)/include' | sed -n '$(DEP_PARSER)' > $@.tmp
 # Manully added dependencies: ${REQ}
 	@$(foreach m,${REQ},echo "$m $(or $(and $(or $(wildcard $(EPICS_MODULES)/$m/$($m_VERSION)),$(wildcard $(E3_SITEMODS_PATH)/$m/$($m_VERSION))),$($m_VERSION)),$(error REQUIRED module '$m' version '$($m_VERSION)' does not exist))" >> $@.tmp;)
 	cat $@.tmp | sort -u >> $@
-- 
GitLab