From b417a625aae6cc8bc2195cb4c1642ace2c29a416 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com> Date: Fri, 12 Feb 2021 10:39:17 -0500 Subject: [PATCH] build: Streamline the make-packaging-target script output. Repeating N times the same docstring hampers readability. Output it once as the generated file header. Change-Id: Id5ae8caa35f478919a2233754b17db15a29e2cd0 --- scripts/make-packaging-target.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/make-packaging-target.py b/scripts/make-packaging-target.py index 1bd31819..37bcf94b 100755 --- a/scripts/make-packaging-target.py +++ b/scripts/make-packaging-target.py @@ -23,11 +23,10 @@ import argparse -target_template = """\ -## -## Distro: %(distribution)s -## - +template_header = """\ +# -*- mode: makefile -*- +# This file was auto-generated by: scripts/make-packaging-target.py. +# # We don't simply use jami-packaging-distro as the docker image name because # we want to be able to build multiple versions of the same distro at the # same time and it could result in race conditions on the machine as we would @@ -35,6 +34,13 @@ target_template = """\ # # This does not impact caching as the docker daemon does not care about the image # names, just about the contents of the Dockerfile. +""" + +target_template = """\ +## +## Distro: %(distribution)s +## + PACKAGE_%(distribution)s_DOCKER_IMAGE_NAME:=jami-packaging-%(distribution)s$(RING_PACKAGING_IMAGE_SUFFIX) PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE:=.docker-image-$(PACKAGE_%(distribution)s_DOCKER_IMAGE_NAME) DOCKER_EXTRA_ARGS = @@ -313,6 +319,7 @@ def parse_args(): def main(): parsed_args = parse_args() + print(template_header) if parsed_args.generate: run_generate(parsed_args) elif parsed_args.generate_all: -- GitLab