From 549c5377db73deed4411a50b29105274f713c34c Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Tue, 4 Sep 2018 15:30:43 +1200 Subject: [PATCH] rrs_distros: ensure we only run distro processing once We do not need to get the distro package lists for every layerbranch, just once. Signed-off-by: Paul Eggleton --- rrs/tools/rrs_distros.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rrs/tools/rrs_distros.py b/rrs/tools/rrs_distros.py index fb20eb9..c8ccf66 100755 --- a/rrs/tools/rrs_distros.py +++ b/rrs/tools/rrs_distros.py @@ -113,6 +113,7 @@ if __name__=="__main__": logger.debug("Starting recipe distros update ...") origsyspath = sys.path + pkglst_dir = None for maintplan in maintplans: for item in maintplan.maintenanceplanlayerbranch_set.all(): layerbranch = item.layerbranch @@ -127,10 +128,12 @@ if __name__=="__main__": with transaction.atomic(): utils.setup_core_layer_sys_path(settings, layerbranch.branch.name) - from oe import distro_check - logger.debug("Downloading distro's package information ...") - distro_check.create_distro_packages_list(fetchdir, d) - pkglst_dir = os.path.join(fetchdir, "package_lists") + if not pkglst_dir: + # Only need to do this once + from oe import distro_check + logger.debug("Downloading distro's package information ...") + distro_check.create_distro_packages_list(fetchdir, d) + pkglst_dir = os.path.join(fetchdir, "package_lists") RecipeDistro.objects.filter(recipe__layerbranch = layerbranch).delete()