From 270ded2b2187395fd46f57e1cd56411016074fd3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Fri, 25 Oct 2019 17:44:27 +0200
Subject: [PATCH] software/htmlvalidatorserver: Use buildout.hash.cfg

---
 .../htmlvalidatorserver/buildout.hash.cfg     | 29 +++++++++++++++++++
 software/htmlvalidatorserver/software.cfg     | 17 +++++------
 2 files changed, 36 insertions(+), 10 deletions(-)
 create mode 100644 software/htmlvalidatorserver/buildout.hash.cfg

diff --git a/software/htmlvalidatorserver/buildout.hash.cfg b/software/htmlvalidatorserver/buildout.hash.cfg
new file mode 100644
index 000000000..6915ddb1b
--- /dev/null
+++ b/software/htmlvalidatorserver/buildout.hash.cfg
@@ -0,0 +1,29 @@
+# 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).
+[template-tomcat-configuration]
+filename = server.xml.in
+md5sum = fd2562b9ac0c52a2e9cc02e3ef3cef78
+
+[template-tomcat-service]
+filename = template-tomcat-service.sh.in
+md5sum = 09803fb71404edbccb32c44a0040dae4
+
+[template-validator]
+filename = instance-validator.cfg.in
+md5sum = 0275d7a8a021f84a1303e5c8933c07c3
+
+[template]
+filename = instance.cfg.in
+md5sum = 2b4d33e9ef1082dd4d6a53f55b391772
diff --git a/software/htmlvalidatorserver/software.cfg b/software/htmlvalidatorserver/software.cfg
index 123db87aa..2e9991752 100644
--- a/software/htmlvalidatorserver/software.cfg
+++ b/software/htmlvalidatorserver/software.cfg
@@ -1,5 +1,6 @@
 [buildout]
 extends =
+  buildout.hash.cfg
   ../../component/dash/buildout.cfg
   ../../component/grep/buildout.cfg
   ../../component/findutils/buildout.cfg
@@ -19,16 +20,14 @@ parts =
 ##########################################################
 [template-tomcat-configuration]
 recipe = slapos.recipe.template
-url = ${:_profile_base_location_}/server.xml.in
-md5sum = fd2562b9ac0c52a2e9cc02e3ef3cef78
-output = ${buildout:directory}/server.xml.in
+url = ${:_profile_base_location_}/${:filename}
+output = ${buildout:directory}/${:filename}
 mode = 0644
 
 [template-tomcat-service]
 recipe = slapos.recipe.template
-url = ${:_profile_base_location_}/template-tomcat-service.sh.in
-md5sum = 09803fb71404edbccb32c44a0040dae4
-output = ${buildout:directory}/template-tomcat-service.sh.in
+url = ${:_profile_base_location_}/${:filename}
+output = ${buildout:directory}/${:filename}
 mode = 0644
 
 ##########################################################
@@ -36,15 +35,13 @@ mode = 0644
 ##########################################################
 [template-validator]
 recipe = slapos.recipe.template
-url = ${:_profile_base_location_}/instance-validator.cfg.in
-md5sum = 0275d7a8a021f84a1303e5c8933c07c3
+url = ${:_profile_base_location_}/${:filename}
 output = ${buildout:directory}/template-validator.cfg
 mode = 0644
 
 [template]
 recipe = slapos.recipe.template
-url = ${:_profile_base_location_}/instance.cfg.in
-md5sum = 2b4d33e9ef1082dd4d6a53f55b391772
+url = ${:_profile_base_location_}/${:filename}
 output = ${buildout:directory}/template.cfg
 mode = 0644
 
-- 
2.30.9