From 28ae68d405514364855fbdece5b22f636e802d12 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 30 Mar 2022 17:10:59 +0200 Subject: [PATCH 1/3] Update versions Signed-off-by: Uilian Ries --- cpt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpt/__init__.py b/cpt/__init__.py index 335f3e78..0c02f458 100644 --- a/cpt/__init__.py +++ b/cpt/__init__.py @@ -1,5 +1,5 @@ -__version__ = '0.37.0' +__version__ = '0.39.0-dev' def get_client_version(): From 87fcbd538d30e1ba87292a924c522d36c98121bc Mon Sep 17 00:00:00 2001 From: Sascha Bannier Date: Thu, 1 Sep 2022 15:40:07 +0200 Subject: [PATCH 2/3] Feature/build profile (#604) --- cpt/packager.py | 2 ++ cpt/profiles.py | 42 ++++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/cpt/packager.py b/cpt/packager.py index 686a7ae8..d3ef608b 100644 --- a/cpt/packager.py +++ b/cpt/packager.py @@ -709,6 +709,8 @@ def run_builds(self, curpage=None, total_pages=None, base_profile_name=None, r.run() self._packages_summary.append({"configuration": build, "package" : r.results}) else: + if not base_profile_build_text: + profile_build_text = None docker_image = self._get_docker_image(build) r = DockerCreateRunner(profile_text, base_profile_text, base_profile_name, build.reference, diff --git a/cpt/profiles.py b/cpt/profiles.py index 2dc945b3..70fe3c7c 100644 --- a/cpt/profiles.py +++ b/cpt/profiles.py @@ -15,7 +15,11 @@ def get_profiles(client_cache, build_config, base_profile_name=None, is_build_pr base_profile_path = os.path.join(client_cache.profiles_path, base_profile_name) base_profile_text = tools.load(base_profile_path) base_profile_name = base_profile_name or "default" - tmp = """ + + if is_build_profile: + profile_text = "include(%s)" % (base_profile_name) + else: + tmp = """ include(%s) [settings] @@ -28,27 +32,25 @@ def get_profiles(client_cache, build_config, base_profile_name=None, is_build_pr %s """ - def pairs_lines(items): - return "\n".join(["%s=%s" % (k, v) for k, v in items]) - if is_build_profile: - settings="" - options="" - else: + def pairs_lines(items): + return "\n".join(["%s=%s" % (k, v) for k, v in items]) + settings = pairs_lines(sorted(build_config.settings.items())) options = pairs_lines(build_config.options.items()) - env_vars = pairs_lines(build_config.env_vars.items()) - br_lines = "" - for pattern, build_requires in build_config.build_requires.items(): - br_lines += "\n".join(["%s:%s" % (pattern, br) for br in build_requires]) - - if os.getenv("CONAN_BUILD_REQUIRES"): - brs = os.getenv("CONAN_BUILD_REQUIRES").split(",") - brs = ['*:%s' % br.strip() if ":" not in br else br for br in brs] - if br_lines: - br_lines += "\n" - br_lines += "\n".join(brs) - - profile_text = tmp % (base_profile_name, settings, options, env_vars, br_lines) + env_vars = pairs_lines(build_config.env_vars.items()) + br_lines = "" + for pattern, build_requires in build_config.build_requires.items(): + br_lines += "\n".join(["%s:%s" % (pattern, br) for br in build_requires]) + + if os.getenv("CONAN_BUILD_REQUIRES"): + brs = os.getenv("CONAN_BUILD_REQUIRES").split(",") + brs = ['*:%s' % br.strip() if ":" not in br else br for br in brs] + if br_lines: + br_lines += "\n" + br_lines += "\n".join(brs) + + profile_text = tmp % (base_profile_name, settings, options, env_vars, br_lines) + return profile_text, base_profile_text From 69087b5598209c6135cfc78be2010ceff0d05ade Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 1 Sep 2022 15:44:13 +0200 Subject: [PATCH 3/3] Mark version 0.38.1 Signed-off-by: Uilian Ries --- cpt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpt/__init__.py b/cpt/__init__.py index 0c02f458..32edd4bf 100644 --- a/cpt/__init__.py +++ b/cpt/__init__.py @@ -1,5 +1,5 @@ -__version__ = '0.39.0-dev' +__version__ = '0.38.1' def get_client_version():