commit: b70366b239ca21dda65c928df8963bd115ebdd98
Author: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 19 00:00:53 2019 +0000
Commit: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
CommitDate: Thu Dec 19 20:57:49 2019 +0000
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=b70366b2
Makefile: do not blindly overwrite documents.js
In case search_index.py fails, it will truncate documents.js. Create
documents in a separate file and atomically move it upon completion.
Suggested-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Signed-off-by: Göktürk Yüksek <gokturk <AT> gentoo.org>
.gitignore | 1 +
Makefile | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index ce644c7..5413cdc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
*.html
*.png
+_documents.js
documents.js
eclass-reference/
diff --git a/Makefile b/Makefile
index 90990a8..4e591ac 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,8 @@ prereq:
# updating it, we pass it the names of ALL prerequisites ($^) and not
# just the names of the ones that are new ($?).
documents.js: $(XMLS)
- ./search_index.py $^ > documents.js
+ ./search_index.py $^ > _documents.js
+ mv _documents.js documents.js
%.png : %.svg
convert $< $@
@@ -48,6 +49,6 @@ validate: prereq
&& echo "xmllint validation successful"
clean:
- rm -f $(HTMLS) $(IMAGES) documents.js
+ rm -f $(HTMLS) $(IMAGES) _documents.js documents.js
.PHONY: all prereq validate clean