Always use lookasides for repoclosure

There's no point in checking for a layered release first. If there are
no repos, the loop will simply not execute even once. If there are
lookasides configured, we want to use them no matter if the release is
layered or not.

Also the log is updated to include the actual command for easier
debugging next time.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-07-11 10:12:39 +02:00
parent a509064696
commit 2c6b784f70

View File

@ -60,7 +60,6 @@ def run_repoclosure(compose):
repo_dir = compose.paths.compose.repository(arch=arch, variant=variant) repo_dir = compose.paths.compose.repository(arch=arch, variant=variant)
repos[repo_id] = repo_dir repos[repo_id] = repo_dir
if compose.conf["release_is_layered"]:
for i, lookaside_url in enumerate(get_lookaside_repos(compose, arch, variant)): for i, lookaside_url in enumerate(get_lookaside_repos(compose, arch, variant)):
lookaside["lookaside-%s.%s-%s" % (variant.uid, arch, i)] = lookaside_url lookaside["lookaside-%s.%s-%s" % (variant.uid, arch, i)] = lookaside_url
@ -74,8 +73,14 @@ def run_repoclosure(compose):
# cause any error to be printed directly to stderr. # cause any error to be printed directly to stderr.
# https://github.com/release-engineering/kobo/pull/26 # https://github.com/release-engineering/kobo/pull/26
try: try:
run(cmd, logfile=compose.paths.log.log_file(arch, "repoclosure-%s" % variant), run(
workdir=tmp_dir) cmd,
logfile=compose.paths.log.log_file(
arch, "repoclosure-%s" % variant
),
workdir=tmp_dir,
show_cmd=True,
)
except RuntimeError as exc: except RuntimeError as exc:
if conf and conf[-1] == 'fatal': if conf and conf[-1] == 'fatal':
raise raise