bootstrap/config.py: add a hind how to rebuild generated files
authorStefan Metzmacher <metze@samba.org>
Thu, 11 Apr 2019 08:34:28 +0000 (10:34 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 18 Apr 2019 12:09:33 +0000 (12:09 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
bootstrap/config.py

index e4566a6..e56fb30 100644 (file)
@@ -172,9 +172,17 @@ PKGS = [
 DEB_PKGS = COMMON + [pkg for pkg, _ in PKGS if pkg]
 RPM_PKGS = COMMON + [pkg for _, pkg in PKGS if pkg]
 
+GENERATED_MARKER = r"""
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+"""
+
 
 APT_BOOTSTRAP = r"""
 #!/bin/bash
+{GENERATED_MARKER}
 set -xueo pipefail
 
 export DEBIAN_FRONTEND=noninteractive
@@ -191,6 +199,7 @@ apt-get -y clean
 
 YUM_BOOTSTRAP = r"""
 #!/bin/bash
+{GENERATED_MARKER}
 set -xueo pipefail
 
 yum -y -q update
@@ -206,6 +215,7 @@ yum clean all
 
 DNF_BOOTSTRAP = r"""
 #!/bin/bash
+{GENERATED_MARKER}
 set -xueo pipefail
 
 dnf -y -q update
@@ -218,6 +228,7 @@ dnf clean all
 
 ZYPPER_BOOTSTRAP = r"""
 #!/bin/bash
+{GENERATED_MARKER}
 set -xueo pipefail
 
 zypper --non-interactive refresh
@@ -236,6 +247,7 @@ fi
 # A generic shell script to setup locale
 LOCALE_SETUP = r"""
 #!/bin/bash
+{GENERATED_MARKER}
 set -xueo pipefail
 
 # refer to /usr/share/i18n/locales
@@ -288,6 +300,7 @@ fi
 
 
 DOCKERFILE = r"""
+{GENERATED_MARKER}
 FROM {docker_image}
 
 # pass in with --build-arg while build
@@ -324,6 +337,8 @@ VAGRANTFILE_SNIPPET = r"""
 
 # global Vagrantfile with snippets for all dists
 VAGRANTFILE_GLOBAL = r"""
+{GENERATED_MARKER}
+
 Vagrant.configure("2") do |config|
     config.ssh.insert_key = false
 
@@ -508,6 +523,7 @@ def expand_family_dists(family):
         config['name'] = name
         config['home'] = join(OUT, name)
         config['family'] = family['name']
+        config['GENERATED_MARKER'] = GENERATED_MARKER
 
         # replace dist specific pkgs
         replace = config.get('replace', {})
@@ -564,7 +580,10 @@ def render_vagrantfile(dists):
         dists[dist]['vagrantfile_snippet']
         for dist in sorted(dists.keys())]
 
-    return VAGRANTFILE_GLOBAL.format(vagrantfile_snippets=''.join(snippets))
+    return VAGRANTFILE_GLOBAL.format(
+            vagrantfile_snippets=''.join(snippets),
+            GENERATED_MARKER=GENERATED_MARKER
+            )
 
 
 VAGRANTFILE = render_vagrantfile(DISTS)