Skip to content

Commit

Permalink
Merge branch 'release/0.38.1' into release/0.38
Browse files Browse the repository at this point in the history
  • Loading branch information
uilianries committed Sep 1, 2022
2 parents 015f2fa + 69087b5 commit 930ea5c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cpt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

__version__ = '0.38.0'
__version__ = '0.38.1'


def get_client_version():
Expand Down
2 changes: 2 additions & 0 deletions cpt/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
42 changes: 22 additions & 20 deletions cpt/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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


Expand Down

0 comments on commit 930ea5c

Please sign in to comment.