From bb6c5da7afa4225314c9e7534a52f8b9719b0c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 16 Oct 2017 09:17:24 +0200 Subject: [PATCH] pkgset: Clean up path generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The path prefix for packages is identical for all architectures. There's no reason to compute it multiple times and check the directory existence repeatedly. Signed-off-by: Lubomír Sedlář --- pungi/phases/pkgset/sources/source_repos.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pungi/phases/pkgset/sources/source_repos.py b/pungi/phases/pkgset/sources/source_repos.py index 2ff9d23a..83748a96 100644 --- a/pungi/phases/pkgset/sources/source_repos.py +++ b/pungi/phases/pkgset/sources/source_repos.py @@ -52,6 +52,9 @@ def get_pkgset_from_repos(compose): for i in range(10): pool.add(LinkerThread(pool)) + path_prefix = os.path.join(compose.paths.work.topdir(arch="global"), "download") + "/" + makedirs(path_prefix) + seen_packages = set() for arch in compose.get_arches(): # write a pungi config for remote repos and a local comps repo @@ -89,8 +92,6 @@ def get_pkgset_from_repos(compose): # TODO: runroot run(cmd, logfile=pungi_log, show_cmd=True, stdout=False) - path_prefix = os.path.join(compose.paths.work.topdir(arch="global"), "download") + "/" - makedirs(path_prefix) for root, dirs, files in os.walk(pungi_dir): for fn in files: if not fn.endswith(".rpm"):