From 08620fb3b28b9a3d5c030fe535a48d2f71179417 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Fri, 25 Oct 2019 16:54:19 +0200
Subject: [PATCH] stack/lamp: Use buildout.hash.cfg

---
 stack/lamp/buildout.cfg      | 12 ++----------
 stack/lamp/buildout.hash.cfg | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 10 deletions(-)
 create mode 100644 stack/lamp/buildout.hash.cfg

diff --git a/stack/lamp/buildout.cfg b/stack/lamp/buildout.cfg
index 03c617f88..f41a7707e 100644
--- a/stack/lamp/buildout.cfg
+++ b/stack/lamp/buildout.cfg
@@ -19,6 +19,7 @@ parts =
   instance-lamp
 
 extends =
+  buildout.hash.cfg
   ../../component/apache-php/buildout.cfg
   ../../component/apache/buildout.cfg
   ../../component/curl/buildout.cfg
@@ -77,8 +78,7 @@ part-list =
 [instance]
 recipe = slapos.recipe.template:jinja2
 rendered = ${buildout:directory}/instance.cfg
-template = ${:_profile_base_location_}/instance.cfg.in
-md5sum = b4fbd7dc8d7fda7dbd1b80f3de273ecf
+template = ${:_profile_base_location_}/${:filename}
 mode = 0644
 context =
     key application_location application:location
@@ -118,27 +118,19 @@ context =
 
 [instance-apache-php]
 <= template-download-base
-filename = instance-apache-php.cfg.in
 output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
-md5sum = 9d3eb7fcc44ac25bef8ee9df6eac8974
 
 [instance-lamp]
 <= template-download-base
-filename = instance-lamp.cfg.jinja2.in
 output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
-md5sum = cefe97d3a80d10655212d64ced180b2a
 
 [template-apache.conf]
 <= template-download-base
-filename = apache.conf.in
 output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
-md5sum = 04080510698732d84122b464fdb08c6a
 
 [template-php.ini]
 <= template-download-base
-filename = php.ini.in
 output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
-md5sum = 7de35e3f8619324119ff296580d2880f
 
 [erp5]
 # lamp stack reuses erp5 stack to have mariadb, but we don't need to checkout erp5 here.
diff --git a/stack/lamp/buildout.hash.cfg b/stack/lamp/buildout.hash.cfg
new file mode 100644
index 000000000..4234a6a0a
--- /dev/null
+++ b/stack/lamp/buildout.hash.cfg
@@ -0,0 +1,33 @@
+# 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 = b4fbd7dc8d7fda7dbd1b80f3de273ecf
+
+[instance-apache-php]
+filename = instance-apache-php.cfg.in
+md5sum = 9d3eb7fcc44ac25bef8ee9df6eac8974
+
+[instance-lamp]
+filename = instance-lamp.cfg.jinja2.in
+md5sum = cefe97d3a80d10655212d64ced180b2a
+
+[template-apache.conf]
+filename = apache.conf.in
+md5sum = 04080510698732d84122b464fdb08c6a
+
+[template-php.ini]
+filename = php.ini.in
+md5sum = 7de35e3f8619324119ff296580d2880f
-- 
2.30.9