From 8148384c1bda52b9dd7b7a95fd0d8de2d8c6de32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 29 Aug 2018 10:53:06 +0200
Subject: [PATCH] jstestnode: switch to buildout.hash.cfg

---
 software/jstestnode/buildout.hash.cfg | 30 +++++++++++++++++++++++++
 software/jstestnode/software.cfg      | 32 +++++++++++----------------
 2 files changed, 43 insertions(+), 19 deletions(-)
 create mode 100644 software/jstestnode/buildout.hash.cfg

diff --git a/software/jstestnode/buildout.hash.cfg b/software/jstestnode/buildout.hash.cfg
new file mode 100644
index 000000000..87b8978f7
--- /dev/null
+++ b/software/jstestnode/buildout.hash.cfg
@@ -0,0 +1,30 @@
+# THIS IS NOT A BUILDOUT FILE, despite purposedly using a compatible syntax.
+# The only allowed lines here are (regexes):
+# - "^#" comments, copied verbatim
+# - "^[" section beginings, copied verbatim
+# - lines containing an "=" sign which must fit in the following categorie.
+#   - "^\s*filename\s*=\s*path\s*$" where "path" is relative to this file
+#     Copied verbatim.
+#   - "^\s*hashtype\s*=.*" where "hashtype" is one of the values supported
+#     by the re-generation script.
+#     Re-generated.
+# - other lines are copied verbatim
+# Substitution (${...:...}), extension ([buildout] extends = ...) and
+# section inheritance (< = ...) are NOT supported (but you should really
+# not need these here).
+
+[instance]
+filename = instance.cfg.in
+md5sum = 7c907db5f803b03a218b49888a3a3799
+
+[template-nginx-service]
+filename = template-nginx-service.sh.in
+md5sum = 529532e1240a66bdf39e3cbbef90ba87
+
+[template-nginx-configuration]
+filename = template-nginx.cfg.in
+md5sum = 9f22db89a2679534aa8fd37dbca86782
+
+[template-runTestSuite]
+filename = runTestSuite.in
+md5sum = 2898d62902351e6df9ce887bd98e2ca1
diff --git a/software/jstestnode/software.cfg b/software/jstestnode/software.cfg
index f239f4de3..4b399462f 100644
--- a/software/jstestnode/software.cfg
+++ b/software/jstestnode/software.cfg
@@ -10,6 +10,7 @@ extends =
   ../../component/nginx/buildout.cfg
   ../../component/openssl/buildout.cfg
   ../../component/curl/buildout.cfg
+  ./buildout.hash.cfg
 
 parts =
   slapos-cookbook
@@ -31,13 +32,6 @@ parts =
 [nodejs-output]
 <= nodejs-8.6.0-output
 
-[instance]
-recipe = slapos.recipe.template
-md5sum = 7c907db5f803b03a218b49888a3a3799
-url = ${:_profile_base_location_}/instance.cfg.in
-output = ${buildout:directory}/instance.cfg
-mode = 0644
-
 [eggs]
 recipe = zc.recipe.egg
 eggs =
@@ -98,26 +92,26 @@ stop-on-error = true
 command = cd ${uritemplate-repository.git:location} && PATH=${git:location}/bin/:${nodejs:location}/bin/:$PATH ${nodejs:location}/bin/npm install .
 update-command = ${:command}
 
-[template-nginx-service]
+[macro-template]
 recipe = slapos.recipe.template
-url = ${:_profile_base_location_}/template-nginx-service.sh.in
-md5sum = 529532e1240a66bdf39e3cbbef90ba87
-output = ${buildout:directory}/template-nginx-service.sh.in
+url = ${:_profile_base_location_}/${:filename}
 mode = 0644
 
+[instance]
+<= macro-template
+output = ${buildout:directory}/instance.cfg
+
+[template-nginx-service]
+<= macro-template
+output = ${buildout:directory}/template-nginx-service.sh.in
+
 [template-nginx-configuration]
-recipe = slapos.recipe.template
-url = ${:_profile_base_location_}/template-nginx.cfg.in
-md5sum = 9f22db89a2679534aa8fd37dbca86782
+<= macro-template
 output = ${buildout:directory}/template-nginx.cfg.in
-mode = 0644
 
 [template-runTestSuite]
-recipe = slapos.recipe.template
-url = ${:_profile_base_location_}/runTestSuite.in
-md5sum = 2898d62902351e6df9ce887bd98e2ca1
+<= macro-template
 output = ${buildout:directory}/runTestSuite.in
-mode = 0644
 
 [versions]
 erp5.util = 0.4.51
-- 
2.30.9